-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·62 lines (41 loc) · 1.13 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
#CC=icpc -static -O3
#CC=g++ -static #-O3
CFLAGS = -std=c++11
#CFLAGS_DB="" #-static
CC=g++ # for mac os x
SOURCES=$(shell ls src/*.cpp)
OBJECTS=$(shell for file in $(SOURCES);\
do echo $$file | sed -e "s/\(.*\)\.cpp/\1\.o/"; echo " ";\
done)
GIT_VERSION := $(shell git describe --abbrev=7 --always --tags --dirty)
PRGNAME=quantinemo
PRGDIR=bin
INCS = -I. -D_SHOW_MEMORY
.PHONY: all clean debug release profile
all: touch release
#so that git version and compiled time is always correct
touch:
touch src/tsim_manager.cpp
thread: CFLAGS += -std=c++11
thread: INCS += -D_THREAD
thread: release
debug: INCS += -D_DEBUG
debug: CFLAGS += -Wall
debug: bin
release: CFLAGS += -O3 -static
release: CFLAGS += -DVERSIONGIT=\"$(GIT_VERSION)\"
release: bin
profile: CFLAGS += -pg
profile: bin
bin : CFLAGS += -Iinclude
bin : objects
echo $(OBJECTS)
$(CC)$(CFLAGS) src/*.o -o $(PRGDIR)/$(PRGNAME) $(LIBS)
objects : $(OBJECTS)
%.o : %.cpp
$(CC)$(CFLAGS) -c -w $< -o $@ $(INCS)
clean:
rm -f src/*.o $(PRGNAME)
depend:
$(CC)$(CFLAGS) -M *.cpp > $@
-include depend