-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (50 loc) · 1.22 KB
/
Makefile
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
63
64
65
66
67
68
# Compiladores
CXX = g++
CC = gcc
# Compactadores
ZIP = zip
TAR = tar
# Conversor odt -> pdf
ODT2PDF = unoconv
# Diretórios
DIRS=src
# Arquivos fonte
SRCSCXX := $(wildcard $(DIRS)/*.cpp)
SRCSH := $(wildcard $(DIRS)/*.h)
# Arquivos de objeto
OBJECTS := $(SRCSCXX:%.cpp=%.o)
BIN := deep-diver
DISTFILE := tp_ia_reversi
# Documentação
SRCDOCS := $(wildcard *.odt)
EXTRADIST := compila.sh launch.sh othello.sh documentation.pdf src/opening.dat src/expand.def
DOCS := $(SRCDOCS:%.odt=%.pdf)
# Variáveis para compilação
CXXFLAGS = -O3 -s -std=c++0x -Wall -Wextra -Wcast-qual -pedantic -MMD
CPPFLAGS =
INCFLAGS =
LDFLAGS = -Wl,-rpath,/usr/local/lib
LIBS =
# Alvos
all: $(BIN)
docs: $(DOCS)
time: CFLAGS += -DLOGTIME
time: CPPFLAGS += -DLOGTIME
time: $(BIN)
zip: docs
rm -f $(DISTFILE).zip
$(ZIP) -9 $(DISTFILE).zip Makefile $(SRCSCXX) $(SRCSH) $(DOCS) $(EXTRADIST)
clean:
rm -f $(DIRS)/*.o *~ $(DIRS)/*~ $(DIRS)/*.d $(BIN) *.zip *.tar.gz
distclean: clean
rm -f *.pdf
.PHONY: all clean distclean time zip tar docs
# Regras de construção
.SUFFIXES:
.SUFFIXES: .c .cc .C .cpp .o
$(BIN): $(OBJECTS)
$(CXX) -o $(BIN) $(OBJECTS) $(LDFLAGS) $(LIBS)
%.pdf: %.odt
$(ODT2PDF) -f pdf $<
# Dependências
-include $(OBJECTS:%.o=%.d)