-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·93 lines (67 loc) · 1.6 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
BIN_FILE = tec
SRC_FILES += main.cpp
SRC_FILES += syntax_exception.cpp
SRC_FILES += token.cpp
SRC_FILES += preprocessor.cpp
SRC_FILES += stack.cpp
SRC_FILES += pda.cpp
SRC_FILES += template_symbols.cpp
SRC_FILES +=
SRC_FILES +=
VPATH += src
INSTALL_DIR = /usr/local/bin
override CFLAGS += -Iinclude
override CFLAGS += -Wall -Wextra -Wuninitialized
override CFLAGS += -std=c++14
override CFLAGS += -pipe
build: override CFLAGS += -g0 -s -O3
debug: override CFLAGS += -g3 -ggdb3 -O0 -DTEC_DEBUG
override LDFLAGS +=
CXX = g++
ifeq ($(CXX), g++)
override LDFLAGS +=
endif
ifeq ($(CXX), clang++)
override LDFLAGS +=
endif
ifeq ($(CXX), x86_64-w64-mingw32-g++)
override CFLAGS +=
override LDFLAGS +=
endif
ifeq ($(CXX), i686-w64-mingw32-g++)
override CFLAGS +=
override LDFLAGS +=
endif
OBJ_FILES := $(patsubst %.cpp,obj/%.o,$(SRC_FILES))
QUIET_CXX = @echo ' ' CXX $(notdir $@);
.PHONY: build debug test docs
all: build
build: mkdirs _build
debug: mkdirs _debug
_build: $(OBJ_FILES)
$(CXX) $^ -o bin/$(BIN_FILE) $(LDFLAGS)
_debug: $(OBJ_FILES)
$(CXX) $^ -o bin/$(BIN_FILE) $(LDFLAGS)
test:
docs:
doxygen docs/Doxyfile
obj/%.o: %.cpp
$(QUIET_CXX) $(CXX) -c $< -o $@ $(CFLAGS)
install: mkdirs build
install bin/$(BIN_FILE) $(INSTALL_DIR)
install util/tec-gcc $(INSTALL_DIR)
install util/tec-clang $(INSTALL_DIR)
install util/tec-i686-w64-mingw32-gcc $(INSTALL_DIR)
install util/tec-x86_64-w64-mingw32-gcc $(INSTALL_DIR)
uninstall:
rm -f $(INSTALL_DIR)/$(BIN_FILE)
clean:
@rm -f obj/*
@rm -f bin/*
mkdirs:
@if [ ! -d bin ]; then \
mkdir bin; \
fi
@if [ ! -d obj ]; then \
mkdir obj; \
fi