-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
48 lines (35 loc) · 1.06 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
CC=g++
#CC=g++-4.8
#CC=g++-5 #significantly faster code compared to g++-4
#CC=g++-7
#DISABLEWARN = -Wno-unused-but-set-variable -Wno-unused-result
#ARCHFLAGS = -march=x86-64 -mno-avx
#CXXFLAGS += -O3 $(ARCHFLAGS) -Wall -static -I. -std=c++11
#CXXFLAGS += -O3 $(ARCHFLAGS) -Wall -I. -std=c++11
CXXFLAGS += -O3 $(ARCHFLAGS) -Wall -I. -std=c++11 -g -static
LIBS = -lpthread
CFLAGS = -O3
DEPS = *.cpp *.h
OBJS=argtable3.o options.o
.PHONY: all clean
PROGS= rknng
all: rknng
#Argtables should support compiling with g++, but there was a error message.
argtable3.o:
gcc -c $(CFLAGS) contrib/argtable3.c
options.o:
$(CC) -c $(CXXFLAGS) options.c
rknng: $(DEPS) $(OBJS)
$(CC) $(CXXFLAGS) $(DISABLEWARN) knng.cpp $(LIBS) $(OBJS) -o rknng
clean:
rm -f $(PROGS) *.o
# g++ -O3 -c -std=c++11 -fPIC -o rknng_lib.o rknng_lib.cpp
apitest:
$(CC) -O3 -c -std=c++11 -o rknng_lib.o rknng_lib.cpp $(LIBS)
gcc -c options.c
gcc -c apitest.c
$(CC) -o apitest apitest.o rknng_lib.o options.o $(LIBS)
python:
rm -f lib/*.so
rm -f *.so
python3 ./setup.py build_ext --inplace