-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
77 lines (63 loc) · 1.8 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
include config.mak
all: ods.py capim.py dispatch.$(CGI) capim.js index.html
SRC:=json2.js \
compat.js \
persistence.js \
dconsole.js \
combinacoes.js \
materias.js \
display.js \
combobox.js \
database.js \
state.js \
versao.js \
widgets.js \
ui_sobre_popup.js \
ui_avisos.js \
ui_campus.js \
ui_combinacoes.js \
ui_horario.js \
ui_logger.js \
ui_materias.js \
ui_planos.js \
ui_saver.js \
ui_turmas.js \
ui_updates.js \
main.js
SRC:=$(addprefix js/,$(SRC))
%.gz: %
gzip --best --no-name -c $< > $@
ifeq ($(RELEASE),1)
sed_RELEASE=-e "s/if(0)/if(1)/"
endif
ods.py: py/ods.py
sed "s|\$$BASE_PATH|${BASE_PATH}|" $^ | tee $@ > /dev/null
capim.py: py/capim.py
sed "s|\$$BASE_PATH|${BASE_PATH}|" $^ | tee $@ > /dev/null
dispatch.$(CGI): py/dispatch.fcgi
sed -e "s|\$$BASE_PATH|${BASE_PATH}|" -e "s|/usr/bin/python|${PYTHON_BIN}|" $^ | tee $@ > /dev/null
index.html: html/capim.html html/sobre.html
sed -e "/include_sobre/r html/sobre.html" -e "/include_sobre/d" ${sed_RELEASE} html/capim.html | tee $@ > /dev/null
capim.js: $(SRC)
# closure --compilation_level=ADVANCED_OPTIMIZATIONS $(addprefix --js=,$(SRC)) --js_output_file=$@
ifeq ($(RELEASE),1)
closure --compilation_level=SIMPLE_OPTIMIZATIONS $(addprefix --js=,$(SRC)) --js_output_file=$@
else
cat $^ > $@
endif
clean::
rm -rf capim.js index.html
rm -rf install
rm -f $(addsuffix /*~,. c db html js py) .htaccess~ .gitignore~
rm -f capim.py ods.py dispatch.$(CGI)
rm -f capim.css.gz capim.js.gz index.html.gz
distclean: clean
rm -f .htaccess
rm -f config.mak
install-gz:: install capim.css.gz capim.js.gz index.html.gz
cp capim.css.gz capim.js.gz index.html.gz install/
install:: all
mkdir -p install
cp capim.css capim.js dispatch.$(CGI) capim.py ods.py index.html install/
chmod 755 install/dispatch.$(CGI) install/capim.py install/ods.py
cp .htaccess install/