-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (36 loc) · 1.3 KB
/
Makefile
File metadata and controls
45 lines (36 loc) · 1.3 KB
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
HAXEPUNK_PATH=$(shell haxelib path HaxePunk | head -1)
SITE_PATH=$(shell pwd)
COMMAND=openfl
define DEMO_HEADER
layout: demo
directory: TITLE
thumb: TITLE.jpg
source: https://github.com/HaxePunk/HaxePunk/tree/dev/examples/TITLE
endef
export DEMO_HEADER
.PHONY: all docs demos site serve
all: clean docs demos site
clean:
rm -rf demos/*.md demos/html5/* demos/thumb/*.jpg documentation/api
touch demos/html5/.gitignore
site:
jekyll build
serve:
jekyll serve --watch --baseurl "/"
docs:
cd $(HAXEPUNK_PATH) && make docs && rm -rf $(SITE_PATH)/documentation/api && cp -r doc/pages $(SITE_PATH)/documentation/api
demos:
cd $(HAXEPUNK_PATH) && make examples COMMAND=$(COMMAND) TARGET=html5 && \
for i in `find examples -mindepth 1 -maxdepth 1 -type d`; do \
echo "Processing example" $$i; \
TITLE=`basename $$i`; \
rm -r $(SITE_PATH)/demos/html5/$$TITLE; \
cp -r $$i/bin/html5/bin $(SITE_PATH)/demos/html5/$$TITLE; \
cp $$i/thumb.jpg $(SITE_PATH)/demos/thumb/$$TITLE.jpg; \
echo "---" > $(SITE_PATH)/demos/$$TITLE.md; \
echo "$$DEMO_HEADER" | sed "s/TITLE/$$TITLE/g" >> $(SITE_PATH)/demos/$$TITLE.md; \
cat $$i/data.md >> $(SITE_PATH)/demos/$$TITLE.md; \
echo "---" >> $(SITE_PATH)/demos/$$TITLE.md; \
cat $$i/README.md >> $(SITE_PATH)/demos/$$TITLE.md; \
rm -f $(SITE_PATH)/demos/$$TITLE.html; \
done