-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (28 loc) · 881 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
40
41
42
CC = gcc
CXX = g++
INCDIR =
INCDEP =
CFLAGS = -g -Wall
CXXFLAGS = -g -Wall
LDFLAGS = -g
LDLIBS = -lm -lpthread
objs = tsp.o tsp-random.o tsp-sahc.o tsp-rmhc.o tsp-ga.o
.PHONY: default
default: tsp
tsp: $(objs) $(INCDEP)
$(CC) $(CFLAGS) $(INCDIR) $(LDLIBS) -o tsp $(objs) $(LDFLAGS)
tsp.o: ./src/tsp.c ./src/tsp.h
$(CC) $(CFLAGS) $(INCDIR) -c ./src/tsp.c
tsp-random.o: ./src/tsp-random.c ./src/tsp-random.h ./src/tsp.h
$(CC) $(CFLAGS) $(INCDIR) -c ./src/tsp-random.c
tsp-sahc.o: ./src/tsp-sahc.c ./src/tsp-sahc.h ./src/tsp.h
$(CC) $(CFLAGS) $(INCDIR) -c ./src/tsp-sahc.c
tsp-rmhc.o: ./src/tsp-rmhc.c ./src/tsp-rmhc.h ./src/tsp.h
$(CC) $(CFLAGS) $(INCDIR) -c ./src/tsp-rmhc.c
tsp-ga.o: ./src/tsp-ga.c ./src/tsp-ga.h ./src/tsp.h
$(CC) $(CFLAGS) $(INCDIR) -c ./src/tsp-ga.c
.PHONY: clean
clean:
rm -rf *.o a.out core tsp *.dSYM
.PHONY: all
all: clean default