-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (66 loc) · 1.83 KB
/
Copy pathMakefile
File metadata and controls
95 lines (66 loc) · 1.83 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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
help:
@echo Available targets: help dist
# ===== Distribution =====
CLOUDDIFF_DIR = chrome-extension/clouddiff
DROPBOX_DIR = chrome-extension/dropbox
LIB_DIR = chrome-extension/lib
dist: \
node_modules \
$(CLOUDDIFF_DIR)/bundle.js \
$(DROPBOX_DIR)/Dropbox-sdk.min.js \
$(LIB_DIR)/jquery.alertable.css \
$(LIB_DIR)/jquery.alertable.min.js \
$(LIB_DIR)/jquery.min.js \
$(LIB_DIR)/js.cookie.min.js
@echo Done.
node_modules:
npm clean-install
$(CLOUDDIFF_DIR)/bundle.js: $(wildcard src/*.js) webpack.config.js
npx webpack
$(DROPBOX_DIR)/Dropbox-sdk.%: node_modules/dropbox/dist/Dropbox-sdk.%
cp $< $@
$(LIB_DIR)/jquery.alertable.%: node_modules/@claviska/jquery-alertable/jquery.alertable.%
cp $< $@
$(LIB_DIR)/jquery.min.%: node_modules/jquery/dist/jquery.min.%
cp $< $@
# ===== Documentation =====
test:
@echo $(subst .dot,.svg,$(wildcard doc/*.dot))
doc: $(subst .yml,.svg,$(wildcard doc/*.yml))
doc/%.svg: doc/%.dot
dot -Tsvg $< -o $@
doc/%.dot: doc/%.yml
bin/yml-to-dot.py $< > $@
# ===== Legacy chrome-extension packaging =====
.PHONY: clouddiff.zip
zip: clouddiff.zip
INCLUDE_LIST = $(addprefix chrome-extension, $(shell cd chrome-extension; find . \
\( \
-name \*.swp \
-o -name .ignore \
-o -name .vagrant \
-o -name manifest.json \
\) \
-prune \
-o \
-type f \
\( \
! -wholename ./lib/codemirror-\* \
-o \( -false \
$(addprefix -o -wholename ./, \
$(shell awk -F'"' '/lib\/codemirror-/ {print $$2}' chrome-extension/manifest.json) \
) \
\) \
\) \
-print |\
cut -c2- \
))
clouddiff.zip: chrome-extension
@-rm -f $@
zip $@ $(INCLUDE_LIST)
@echo
@< chrome-extension/manifest.json jq 'delpaths([["key"]])' | zip $@ -
printf '@ -\n@=chrome-extension/manifest.json\n' | zipnote -w $@
@ls -hl $@
biggest: clouddiff.zip
@unzip -lv $< | tail -n +4 | sort -k3nr | less