-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
87 lines (72 loc) · 2.4 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
include helpers.mk
ifeq ($(CUR_OS),darwin)
LIB_TARGET = battlecode/c/lib/libbattlecode-darwin.a
endif
ifeq ($(CUR_OS),linux)
LIB_TARGET = battlecode/c/lib/libbattlecode-linux.a
endif
build: battlecode
@$(MAKE) -wC bindings
cp -R $(CARGO_TARGET_DIR)/debug/deps/libbattlecode.a $(LIB_TARGET)
@$(MAKE) copy
release: battlecode
@$(MAKE) -wC bindings release
cp -R $(CARGO_TARGET_DIR)/release/deps/libbattlecode.a $(LIB_TARGET)
@$(MAKE) copy
copy:
cp -R bindings/python/battlecode battlecode/python/
cp -R bindings/java/src/bc battlecode/java/
cp -R bindings/c/include battlecode/c/
battlecode:
rm -rf battlecode
mkdir -p battlecode/python/
mkdir -p battlecode/c/lib/
mkdir -p battlecode/java/
test:
@$(MAKE) -wC bindings test
$(call test_command,cargo test)
docs:
rm -rf docs
pdoc --html battlecode/python/battlecode --html-dir docs/python/
mv docs/python/battlecode/index.html docs/python/battlecode/bc.m.html
javadoc battlecode/java/bc/*.java -d docs/java/
clean:
@$(MAKE) -wC bindings clean
-rm -rf docker-manager/working_dir
rm -rf battlecode
# run build first, to generate code and stuff
generate:
@$(MAKE) -wC bindings generate
linux-libs:
sh scripts/linuxbuild.sh
docker-sandbox:
sh scripts/sandboxbuild.sh
docker-manager:
sh scripts/managerbuild.sh
bc18-scaffold:
git clone https://github.com/battlecode/bc18-scaffold
package:
-rm -rf battlecode-manager/working_dir
-rm -rf battlecode-manager/__pycache__
-rm -rf examplefuncsplayer-python/__pycache__
-rm -rf examplefuncsplayer-java/*class
-rm -rf bc18-scaffold/battlecode
-rm -rf bc18-scaffold/battlecode-manager
-rm -rf bc18-scaffold/battlecode-maps
-rm -rf bc18-scaffold/examplefuncsplayer-python
-rm -rf bc18-scaffold/examplefuncsplayer-c
-rm -rf bc18-scaffold/examplefuncsplayer-java
cp -R battlecode bc18-scaffold/battlecode
-find bc18-scaffold/battlecode/ -name .gitignore -delete
cp -R battlecode-manager bc18-scaffold/battlecode-manager
cp -R battlecode-maps bc18-scaffold/battlecode-maps
cp -R examplefuncsplayer-python bc18-scaffold/examplefuncsplayer-python
cp -R examplefuncsplayer-c bc18-scaffold/examplefuncsplayer-c
cp -R examplefuncsplayer-java bc18-scaffold/examplefuncsplayer-java
cp run_nodocker.sh bc18-scaffold/
cp run_nodocker.bat bc18-scaffold/
cp battlecode.sh bc18-scaffold/
cp battlecode.bat bc18-scaffold/
cp run.sh bc18-scaffold/
cp run.bat bc18-scaffold/
.PHONY: build test dockers battlecode docs