-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
49 lines (37 loc) · 1 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
COMPILER_FLAGS=-std=c++2a -Werror -g -O3 -fstack-protector-all -ggdb3 # AUTOGEN
CLANG_COMPILER_WARNINGS=-Wall # AUTOGEN
GCC_COMPILER_WARNINGS=-Wall # AUTOGEN
GXX_COMPILER_WARNINGS=-Wall # AUTOGEN
COMPILER_WARNINGS=$(GCC_COMPILER_WARNINGS) # AUTOGEN
COMPILER_WARNINGS=$(GXX_COMPILER_WARNINGS) # AUTOGEN
COMPILER_WARNINGS=$(CLANG_COMPILER_WARNINGS) # AUTOGEN
CXX=clang # AUTOGEN
# CXX=gcc # AUTOGEN
# CXX=cc # AUTOGEN
# CXX=g++ # AUTOGEN
LDLIBS+=-lstdc++ # AUTOGEN
CXXFLAGS=$(COMPILER_FLAGS) $(COMPILER_WARNINGS) # AUTOGEN
NAME=example
TARGET_OBJECTS=main.o
EXTRA_CXXFLAGS=
LDLIBS+=-lpthread
%.o: %.cpp
@echo $(CXX) $(EXTRA_CXXFLAGS) $(CXXFLAGS) -c -o $@ $<
@$(CXX) $(EXTRA_CXXFLAGS) $(CXXFLAGS) -c -o $@ $<
#
# link
#
TARGET=$(NAME)$(EXE)
$(TARGET): $(TARGET_OBJECTS)
$(CXX) $(TARGET_OBJECTS) $(LDLIBS) -o $(TARGET)
#
# To force clean and avoid "up to date" warning.
#
.PHONY: clean
.PHONY: clobber
clean:
rm -f *.o $(TARGET)
clobber: clean
all: $(TARGET)
# DO NOT DELETE
.o/main.o: ../common/common.h