-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (50 loc) · 1.55 KB
/
Makefile
File metadata and controls
62 lines (50 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Makefile para o Simulador de Tomasulo
# Compilador e flags
CXX = g++
CXXFLAGS = -std=c++11 -Wall -Wextra -O2
# Nome do executável
TARGET = tomasulo_simulator
# Arquivo fonte
SRC = Tomasulo_saidaArquivo.cpp
# Arquivo objeto
OBJ = $(SRC:.cpp=.o)
# Regra padrão
all: $(TARGET)
# Regra de compilação
$(TARGET): $(SRC)
@echo "Compilando $(SRC)..."
$(CXX) $(CXXFLAGS) $(SRC) -o $(TARGET)
@echo "✓ Compilação concluída! Executável: $(TARGET)"
# Compilação com debug
debug: CXXFLAGS += -g -DDEBUG
debug: clean $(TARGET)
@echo "✓ Versão debug compilada!"
# Limpeza
clean:
@echo "Removendo arquivos temporários..."
rm -f $(TARGET) $(OBJ) *.o
@echo "✓ Limpeza concluída!"
# Executar teste padrão
test: $(TARGET)
@echo "Executando teste padrão..."
./$(TARGET) input.txt output.txt
@echo "✓ Teste concluído! Veja output.txt"
# Executar todos os testes
test-all: $(TARGET)
@echo "Executando todos os testes..."
@./$(TARGET) tests/input1.txt tests/output1.txt || true
@./$(TARGET) tests/input2.txt tests/output2.txt || true
@./$(TARGET) tests/input3.txt tests/output3.txt || true
@echo "✓ Todos os testes executados!"
# Ajuda
help:
@echo "Makefile do Simulador de Tomasulo"
@echo ""
@echo "Uso:"
@echo " make - Compila o simulador"
@echo " make debug - Compila com símbolos de debug"
@echo " make clean - Remove arquivos compilados"
@echo " make test - Executa teste padrão"
@echo " make test-all - Executa todos os testes"
@echo " make help - Mostra esta mensagem"
.PHONY: all clean test test-all debug help