-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
83 lines (64 loc) · 1.72 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
MODE ?= dynamic
all: bin/icfp bin/testseq icfptimed
C_SRC = c_signal.c
C_OBJ = $(C_SRC:.c=.o)
ICFP_SRC = icfp.rc \
driver.rs \
state.rs \
path.rs \
pattern.rs \
evaluate.rs \
dlist.rs \
heuristics.rs \
path_find.rs path_find/brushfire.rs path_find/precise.rs path_find/astar.rs \
game_tree.rs game_tree/bblum.rs game_tree/simple.rs game_tree/tobruos.rs \
game_tree/cargomax.rs \
fuzzer.rs \
testseq.rc \
testseq_driver.rs \
game_tree/octopus.rs \
# Remember to add modules for your .rs files in icfp.rc too!
ifeq ($(MODE),dynamic)
bin/icfp: $(ICFP_SRC) $(C_OBJ)
mkdir -p ./bin
rustc -O icfp.rc -o ./bin/icfp
bin/testseq: $(ICFP_SRC) $(C_OBJ)
mkdir -p ./bin
rustc -O testseq.rc -o ./bin/testseq
else
CFLAGS=--static
LDFLAGS=-lpthread -lrt -ldl
bin/icfp: $(ICFP_SRC) $(C_OBJ)
rustc -O -c icfp.rc
mkdir -p ./bin
g++ -o ./bin/icfp ${CFLAGS} icfp.o c_signal.o lib/*.o lib/*.a ${LDFLAGS}
bin/testseq:
endif
check: $(ICFP_SRC) $(C_OBJ)
mkdir -p ./bin
rustc -O icfp.rc -o ./bin/icfp-test --test
./bin/icfp-test
clean:
rm -f icfp.o ./bin/icfp $(C_OBJ)
BUILD=$(shell date +icfp-%Y%m%d-%H%M)
PKGFILES=pkg/PACKAGES_TESTING pkg/README pkg/install pkg/lifter
ifneq ($(shell uname -n),icfp)
pkg:
@echo "You *must* build this package on the VM."; exit 1
else
pkg: bin/icfp
rm -rf $(BUILD)
mkdir $(BUILD)
cp $(PKGFILES) $(BUILD)
cp -R patterns $(BUILD)
cp bin/icfp $(BUILD)
mkdir $(BUILD)/lib
cp `ldd bin/icfp | grep /usr/local/lib/rustc | cut -d' ' -f3` $(BUILD)/lib
git archive --format tar --prefix src/ HEAD | tar x -C $(BUILD)
tar czvf $(BUILD).tar.gz -C $(BUILD) .
# rm -rf $(BUILD)
endif
.PHONY: pkg
.phony: etags
etags:
ctags -e -f TAGS --options=./etc/ctags.rust -R .