-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (26 loc) · 823 Bytes
/
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
O_SRCS = tsp.o
CPP_SRCS = algo_test.cpp tsp.cpp algo.cpp print.cpp util.cpp algo2.cpp
CFLAGS = -O2
OBJS = tsp.o print.o util.o
LIBS = -lm -L/usr/include -lpthread
algo.o: algo.cpp
g++ algo.cpp -c $(CFLAGS)
algo2.o: algo2.cpp
g++ algo2.cpp -c $(CFLAGS)
tsp.o: tsp.cpp
g++ tsp.cpp -c $(CFLAGS)
util.o: util.cpp
g++ util.cpp -c $(CFLAGS)
print.o: print.cpp
g++ print.cpp -c $(CFLAGS) -o print.o
algo_test_best.o: algo_test.cpp
g++ algo_test.cpp -c -D BEST $(CFLAGS) -o algo_test_best.o
algo_test.o: algo_test.cpp
g++ algo_test.cpp -c $(CFLAGS)
tsp: $(OBJS) algo_test.o algo2.o
g++ -o "tsp" $(OBJS) algo_test.o algo2.o $(LIBS)
best: $(OBJS) algo_test_best.o algo.o
g++ -o "tsp_best" $(OBJS) algo_test_best.o algo.o $(LIBS)
all: tsp
clean:
rm -f tsp tsp_best *.o