-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
46 lines (34 loc) · 1.6 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
FILES = $(shell find files -type f)
WCF_FILES = $(shell find files_wcf -type f)
JS_MODULE_FILES = $(shell find files_wcf/js/Bastelstu.be -type f)
all: be.bastelstu.chat.tar be.bastelstu.chat.tar.gz
be.bastelstu.chat.tar.gz: be.bastelstu.chat.tar
gzip -9 < $< > $@
be.bastelstu.chat.tar: files.tar files_wcf.tar acptemplates.tar templates.tar *.xml LICENSE sql/*.sql language/*.xml
tar cvf $@ --mtime="@$(shell git log -1 --format=%ct)" --owner=0 --group=0 --numeric-owner --exclude-vcs -- $^
files.tar: $(FILES)
files_wcf.tar: $(WCF_FILES) files_wcf/js/Bastelstu.be.Chat.min.js
acptemplates.tar: acptemplates/*.tpl
templates.tar: templates/*.tpl
%.tar:
tar cvf $@ --mtime="@$(shell git log -1 --format=%ct)" --owner=0 --group=0 --numeric-owner --exclude-vcs -C $* -- $(^:$*/%=%)
files_wcf/js/Bastelstu.be.Chat.min.js: Bastelstu.be.Chat.babel.js
yarn run terser --comments '/Copyright|stackoverflow/' -m -c pure_funcs=[console.debug] --verbose --timings -o $@ $^
Bastelstu.be.Chat.babel.js: Bastelstu.be.Chat.js .babelrc
yarn run babel $< --out-file $@
Bastelstu.be.Chat.js: $(JS_MODULE_FILES)
yarn run r_js -o require.build.js
clean:
-rm -f files.tar
-rm -f files_wcf.tar
-rm -f templates.tar
-rm -f acptemplates.tar
-rm -f Bastelstu.be.Chat.js
-rm -f Bastelstu.be.Chat.babel.js
-rm -f files_wcf/js/Bastelstu.be.Chat.min.js
distclean: clean
-rm -f be.bastelstu.chat.tar
-rm -f be.bastelstu.chat.tar.gz
constants.php: option.xml
(echo "<?php" ; xq -r '.data.import.options.option[] | "define(\"" + (.["@name"] | ascii_upcase) + "\", " + .defaultvalue + ");"' < option.xml) > constants.php
.PHONY: distclean clean