forked from simsim314/CatForce
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (30 loc) · 1.73 KB
/
Copy pathMakefile
File metadata and controls
35 lines (30 loc) · 1.73 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
CC = clang++
CFLAGS = -std=c++11 -Wall -Wextra -pedantic -O3 -march=native -mtune=native -flto -fno-stack-protector -fomit-frame-pointer -g
# CFLAGS = -std=c++11 -Wall -Wextra -pedantic -g -fno-stack-protector -fomit-frame-pointer
LDFLAGS =
# CC = /usr/local/bin/gcc-11
# CFLAGS = -O3 -std=c++11 -march=native -mtune=native -fno-stack-protector -fomit-frame-pointer
# LDFLAGS = -L /usr/local/opt/gcc/lib/gcc/11 -L /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lSystem -lstdc++
PROFDATAEXE = /Library/Developer/CommandLineTools/usr/bin/llvm-profdata
ifneq ($(wildcard instrumenting/profile.profdata),)
INSTRUMENTFLAGS = -fprofile-use=instrumenting/profile.profdata
else
INSTRUMENTFLAGS =
endif
all: CatForce
CatForce: CatForce.cpp LifeAPI.h
$(CC) $(CFLAGS) $(INSTRUMENTFLAGS) -o CatForce CatForce.cpp $(LDFLAGS)
instrument: CatForce.cpp LifeAPI.h
$(CC) $(CFLAGS) -fprofile-instr-generate=instrumenting/pass1.profraw -o instrumenting/pass1-CatForce CatForce.cpp
instrumenting/pass1-CatForce instrumenting/farm.in
rm instrumenting/farm.rle
$(PROFDATAEXE) merge instrumenting/pass1.profraw -o instrumenting/profile.profdata
touch CatForce.cpp
# $(CC) $(CFLAGS) -fprofile-generate=instrumenting -o instrumenting/pass1-CatForce CatForce.cpp
# instrumenting/pass1-CatForce instrumenting/farm.in
# rm instrumenting/farm.rle
# $(PROFDATA) merge instrumenting/default*.profraw -o instrumenting/pass1.profdata
# $(CC) $(CFLAGS) -fprofile-use=instrumenting/pass1.profdata -fcs-profile-generate=instrumenting -o instrumenting/pass2-CatForce CatForce.cpp
# instrumenting/pass2-CatForce instrumenting/farm.in
# rm instrumenting/farm.rle
# $(PROFDATAEXE) merge instrumenting/default*.profraw instrumenting/pass1.profdata -o instrumenting/profile.profdata