-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (26 loc) · 936 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
DIRS = common bst avl heap skiplist
BIN = website/js/bin.js
JS_OBJ := $(foreach dir, $(DIRS), $(wildcard $(dir)/*.o))
WEBSITE_SRC_DIR = website/public/src
.PHONY: all js clean serve website website-src publish
all:
-for dir in $(DIRS); do make -C $$dir all; done
js:
-for dir in $(DIRS); do make -C $$dir js; done
emmake make $(BIN)
$(BIN): $(JS_OBJ)
$(CXX) -s NO_EXIT_RUNTIME=1 $(JS_OBJ) -o $(BIN)
clean:
-for dir in $(DIRS); do make -C $$dir clean; done
serve:
cd website; broccoli serve
website: js website-src
rm -rf website/dist
cd website; broccoli build dist
website-src:
rm -rf $(WEBSITE_SRC_DIR)/*
-for dir in $(DIRS); do mkdir $(WEBSITE_SRC_DIR)/$$dir; \
cp $$dir/*.h $(WEBSITE_SRC_DIR)/$$dir; \
cp $$dir/*.cpp $(WEBSITE_SRC_DIR)/$$dir; done
publish: website
git subtree push --prefix website/dist origin gh-pages