-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
39 lines (31 loc) · 1.14 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
#If you have clang, it seems to generate a faster compile as of the beginning of 2018
#CXX=g++
all:
ifeq ($(ARCH), aarch64)
CXX=aarch64-linux-android21-clang++
CFLAGS=-c -DNDEBUG -D_ARM -O3 -flto -Wall -Wno-sign-compare -m64 -march=armv8-a+fp+simd+crypto+crc -std=c++17 -Isrc -Isrc/general -Isrc/learning
LDFLAGS= -flto -Wall -pie -lm -static-libstdc++
else ifeq ($(ARCH), armv7a)
CXX=armv7a-linux-androideabi16-clang++
CFLAGS=-c -DNDEBUG -D_ARM -O3 -flto -Wall -Wno-sign-compare -m32 -mthumb -mfloat-abi=softfp -march=armv7-a -mfpu=neon -std=c++17 -Isrc -Isrc/general -Isrc/learning
LDFLAGS= -flto -Wall -pie -lm -static-libstdc++
else
CXX=clang++
CFLAGS=-c -DNDEBUG -O3 -flto -Wall -Wno-sign-compare -m64 -march=native -std=c++17 -Isrc -Isrc/general -Isrc/learning
LDFLAGS= -flto -Wall -lpthread
endif
SOURCES=$(wildcard src/general/*.cc src/*.cc)
OBJECTS=$(SOURCES:.cc=.o)
EXE:=Winter
all: $(SOURCES) $(EXE)
$(EXE): $(OBJECTS)
$(CXX) -o $@ $(LDFLAGS) $(OBJECTS)
.cc.o:
$(CXX) $< -o $@ $(CFLAGS)
clean: clean-src clean-general clean-learning
clean-src:
rm -rf src/*.o
clean-general:
rm -rf src/general/*.o
clean-learning:
rm -rf src/learning/*.o