-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
81 lines (61 loc) · 1.98 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Copyright: VU University of Amsterdam, CWI Amsterdam
# License: Simplified BSD license
YARN_ARCHIVE=swish-node-modules.zip
YARN_URL=https://www.swi-prolog.org/download/swish/${YARN_ARCHIVE}
SWIPL=swipl
# Packs to download and configure. Run `git submodule` to see the
# available packs.
PACKS=profile rserve_client smtp pcache sCASP
all:
@echo "Targets"
@echo
@echo " yarn-zip -- Download zip with dependencies"
@echo " yarn -- Install dependencies using yarn"
@echo " src -- Prepare JavaScript dependencies for execution"
@echo " min -- Create minimized CSS and JavaScript"
@echo " clean -- Clean minimized CSS and JavaScript"
@echo " packs -- Download and configure packs"
@echo
yarn::
yarn
@$(MAKE) src
src::
@$(MAKE) -C web patch
@$(MAKE) -C web/js src
# Build and clean minimized versions
min:: css js
css::
@$(MAKE) -C web/css
js::
@$(MAKE) -C web/js
clean::
@$(MAKE) -C web/css clean
@$(MAKE) -C web/js clean
# Install dependencies from downloaded zip holding JavaScript components
yarn-zip: .yarn-senitel
.yarn-senitel: $(YARN_ARCHIVE)
unzip -q -u $(YARN_ARCHIVE)
touch $@
$(YARN_ARCHIVE)::
@if [ -e $(YARN_ARCHIVE) ]; then \
curl -o $(YARN_ARCHIVE) -z $(YARN_ARCHIVE) $(YARN_URL) ; \
else \
curl -o $(YARN_ARCHIVE) $(YARN_URL) ;\
fi
# Create the above
upload::
rm -f $(YARN_ARCHIVE)
zip -r $(YARN_ARCHIVE) web/node_modules
rsync $(YARN_ARCHIVE) plweb@oehoe:srv/plweb/data/download/swish/$(YARN_ARCHIVE)
################
# PACKS
PACKFILES=$(addprefix pack/, $(addsuffix /pack.pl, $(PACKS)))
ATTACH_PACKDIR=-g 'attach_packs(pack,[duplicate(replace),search(first)])'
packs: $(PACKFILES)
$(PACKFILES)::
@echo "Checking $(shell dirname $@) ..."
@if [ ! "`git submodule status $(shell dirname $@) | head -c 1`" = " " ]; then \
echo " Updating $(shell dirname $@) ..." ; \
git submodule update --init $(shell dirname $@) ; \
$(SWIPL) $(ATTACH_PACKDIR) -g 'pack_rebuild($(shell basename $$(dirname $@)))' -t halt ;\
fi