-
Notifications
You must be signed in to change notification settings - Fork 7
/
helper.make
43 lines (32 loc) · 1.22 KB
/
helper.make
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
ZIPDIR = .
jfbuild_hash = efd88d9cc24f753038a28479c9d8e7ac398909c8
jfmact_hash = 1f0746a3b9704906669d8aaed2bbb982053a393e
jfduke3d_hash = 41cd46bc00633e7457d07d88c8add9f99a7d9d41
jfsw_hash = 1282878348bff97c5cf92401c1253f81da290cc4
NBlood_hash = 5917ab82214a9f0fa8a9d408f9e40143ad72171b
jfbuild_list = src/* include/*
jfmact_list = *
jfduke3d_list = src/*
jfsw_list = src/*
NBlood_list = source/blood/src/*
.PHONY: all patch gitinit diff
all: jfbuild jfmact jfduke3d jfsw NBlood
download: $(patsubst %,$(ZIPDIR)/%.zip,jfbuild jfmact jfduke3d jfsw NBlood)
.PRECIOUS: $(ZIPDIR)/jf%.zip
$(ZIPDIR)/jf%.zip:
wget -O $@ "https://github.com/jonof/$(@:$(ZIPDIR)/%.zip=%)/archive/$($(@:$(ZIPDIR)/%.zip=%)_hash).zip"
$(ZIPDIR)/NBlood.zip:
wget -O $@ "https://github.com/nukeykt/NBlood/archive/$(NBlood_hash).zip"
%: $(ZIPDIR)/%.zip
name="$@-$($@_hash)"; unzip -q $< $(patsubst %,"$$name/%",$($@_list)) && mv $$name $@
for_fn = \
for n in jfbuild jfmact jfduke3d jfsw NBlood; do \
test ! -d $$n || ($(1);); \
done
patch:
$(call for_fn, patch -p1 -d $$n < $$n.patch)
cp eduke32/* NBlood/source/blood/src/
gitinit:
$(call for_fn, cd $$n && git init && git add . && git commit -m "init")
diff:
$(call for_fn, cd $$n && git diff > ../$$n.patch2)