-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
108 lines (81 loc) · 2.67 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#
# 'make dist' : Package source code in tar.gz. Files included in the package
# must be listed explicitly below.
#
# 'make rsync' : Copy the whole source directory to a remote location. Useful
# for copying the code to a computation cluster.
#
# 'make upload' : Package the source code and upload it to the web. It should
# only be used when releasing a new version. If you only want
# to edit the web, use the Makefile in web/ ('cd web/; make').
#
VERSION=0.996
DEBUG=0
TRACE=0
ifneq ($(DEBUG),0)
DEBUGFLAGS=-g3 -DMALLOC_CHECK_=3 -DDODEBUG=$(DEBUG)
else
DEBUGFLAGS=
endif
ifneq ($(TRACE),0)
TRACEFLAGS=-DTRACE=$(TRACE)
endif
OPT_FLAGS=-O2 -flto -ffast-math
WARN_FLAGS=-Wall -Wextra -std=c99 -pedantic
CFLAGS= -DVERSION=\"$(VERSION)\" $(WARN_FLAGS) $(OPT_FLAGS) $(DEBUGFLAGS) $(TRACEFLAGS)
LDLIBS+= $(OPT_FLAGS) -lm
OS:=$(shell uname)
ifeq ($(OS),Linux)
TIMER=unix
else
TIMER=dos
endif
.PHONY: default all clean rsync dist upload
default: acoqap acotsp
acoqap: acoqap.o aco.o QAP.o utilities.o ants.o qap-ants.o InOut.o $(TIMER)_timer.o qap-ls.o parse.o adaptation.o
acotsp: acotsp.o aco.o TSP.o utilities.o ants.o tsp-ants.o InOut.o $(TIMER)_timer.o ls.o parse.o adaptation.o
all: clean acoqap acotsp
clean:
@$(RM) *.o acotsp acoqap
aco.o: aco.c
acotsp.o: acotsp.c
acoqap.o: acoqap.c
TSP.o: TSP.c TSP.h
QAP.o: QAP.c QAP.h
ants.o: ants.c ants.h aco-parameters.def
qap-ants.o: qap-ants.c ants.h aco-parameters.def
InOut.o: InOut.c InOut.h
utilities.o: utilities.c utilities.h
ls.o: ls.c ls.h
parse.o: parse.c parse.h aco-parameters.def
$(TIMER)_timer.o: $(TIMER)_timer.c timer.h
adaptation.o : adaptation.h
TAGS: *.c *.h
etags *.c *.h
rsync : RNODE=iridiacluster
rsync : all
ifdef RNODE
rsync -rlp -CIzc -L --delete --copy-unsafe-links \
--exclude=.svn --progress --relative --exclude=acotsp --exclude=acoqap \
. \
$(RNODE):~/src/acoqap/
else
@echo "ERROR: You must specify a remote node (e.g., RNODE=b21)"
@exit 1
endif
dist : DIST_SRC_FILES=*.c *.h README.md Makefile gpl.txt *.def tsp/*.tsp qap/*.dat irace/
dist : DISTFILENAME:=ACOTSPQAP-$(VERSION)
dist : DISTDIR:=../
dist : all
@(mkdir -p $(DISTDIR)/$(DISTFILENAME) \
&& rsync --relative -rlpC --exclude=.svn $(DIST_SRC_FILES) $(DISTDIR)/$(DISTFILENAME)/ \
&& cd $(DISTDIR) \
&& tar cf - $(DISTFILENAME) | gzip -f9 > $(DISTFILENAME).tar.gz \
&& rm -rf ./$(DISTFILENAME) \
&& echo " $(DISTDIR)/$(DISTFILENAME).tar.gz created." && cd $(CWD) )
upload:
$(MAKE) DISTDIR=web dist
$(MAKE) -C web update
@echo "****"
@echo "**** DO NOT forget to update the link to $(DISTFILENAME).tar.gz in web/index.html! (TODO: do this automatically using 'sed') ***"
@echo "****"