-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
56 lines (37 loc) · 893 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# vars
PATH := $(shell npm bin):$(PATH)
FORMAT := $(basename $(notdir $(wildcard src/node/format/*.js)))
MESSAGE = 'Update from source material' -e
# args
ifdef msg
MESSAGE = '$(subst $(shell echo \'),'\'',$(msg))'
endif
# default
all: $(FORMAT)
force:
# aliases
$(FORMAT): %: pages/data/anime.%
# tasks
clean: reset
rm -r node_modules
reset:
rm -r tmp
serve:
docker run -it -p 4000:4000 -v "$$PWD/pages":/srv/jekyll jekyll/pages jekyll serve
update: all
cd pages && \
git commit -m $(MESSAGE) data && \
git push
# targets
node_modules: package.json
npm install --production
touch $@
pages:
git clone -b gh-pages [email protected]:mal/pokemon.git pages
pages/data/%: tmp/raw.json force pages
node src/node/index.js $(suffix $@) > $@
tmp:
mkdir $@
tmp/raw.json: node_modules tmp
DISPLAY=:0 electron src/atom/index.js $@
.PHONY: clean force reset serve update