www/Makefile

branch
stable
changeset 665
4d01937ae7af
parent 626
571473f62c1e
child 667
1246550451ca
equal deleted inserted replaced
521:9d1aa6f3a4da 665:4d01937ae7af
1 # Makefile for the bms webserver 1 # Makefile for the bms webserver
2 # Copyright (c) 2018-2019 by M. Broek. 2 # Copyright (c) 2018-2019 by M. Broek.
3 3
4 include ../Makefile.global 4 include ../Makefile.global
5 5
6 SRC = cmd_fermenter.php cmd_co2meter.php \ 6 SRC = cmd_fermenter.php cmd_co2meter.php cmd_ispindel.php config.php.dist crontasks.php \
7 config.php.dist crontasks.php favicon.ico gen_about.php \ 7 export_equipments.php export_fermentables.php export_hops.php export_mashs.php \
8 export_miscs.php export_styles.php export_suppliers.php export_waters.php \
9 export_yeasts.php favicon.ico gen_about.php \
8 getbrewlog.php getco2meter.php getco2pressurelog.php getfermentablesources.php \ 10 getbrewlog.php getco2meter.php getco2pressurelog.php getfermentablesources.php \
9 getfermenter.php getfermentlog.php gethopsources.php getmiscsources.php getnode.php \ 11 getfermenter.php getfermentlog.php gethopsources.php getmiscsources.php getnode.php \
10 getwatersources.php getyeastsources.php import_ingredients.php index.php \ 12 getwatersources.php getyeastsources.php getispindel.php getispindellog.php \
13 import_ingredients.php index.php \
11 inv_equipments.php inv_fermentables.php inv_hops.php inv_instock.php \ 14 inv_equipments.php inv_fermentables.php inv_hops.php inv_instock.php \
12 inv_miscs.php inv_suppliers.php inv_waters.php inv_yeasts.php \ 15 inv_miscs.php inv_suppliers.php inv_waters.php inv_yeasts.php inv_yeastlab.php \
13 log_brew.php log_co2pressure.php log_fermentation.php \ 16 log_brew.php log_co2pressure.php log_fermentation.php log_ispindel.php \
14 mon_brewer.php mon_co2meter.php mon_fermenter.php mon_node.php \ 17 mon_brewer.php mon_co2meter.php mon_fermenter.php mon_ispindel.php mon_node.php \
15 prod_archive_code.php prod_archive_date.php prod_archive_name.php prod_beerxml.php \ 18 prod_archive_code.php prod_archive_date.php prod_archive_name.php prod_beerxml.php \
16 prod_checklist.php prod_divide.php prod_duplicate.php prod_edit.php prod_export.php prod_forum.php \ 19 prod_checklist.php prod_divide.php prod_duplicate.php prod_edit.php prod_export.php prod_forum.php \
17 prod_impbrew.php prod_inprod.php prod_new.php prod_print.php prod_torecipe.php \ 20 prod_impbrew.php prod_inprod.php prod_new.php prod_print.php prod_torecipe.php \
18 prod_r_efficiency.php prod_r_yeast.php prod_r_totals.php \ 21 prod_r_efficiency.php prod_r_yeast.php prod_r_totals.php \
19 profile_fermentation.php profile_mash.php profile_setup.php profile_styles.php \ 22 profile_fermentation.php profile_mash.php profile_setup.php profile_styles.php \
25 SUB = version.php.in images/* css/* jqwidgets/* jqwidgets/styles/* \ 28 SUB = version.php.in images/* css/* jqwidgets/* jqwidgets/styles/* \
26 jqwidgets/styles/images/* jqwidgets/globalization/* js/* \ 29 jqwidgets/styles/images/* jqwidgets/globalization/* js/* \
27 includes/* fpdf/* import/* 30 includes/* fpdf/* import/*
28 OTHER = Makefile 31 OTHER = Makefile
29 CSS_FILES = $(filter-out %-min.css,$(wildcard css/*.css css/**/*.css )) 32 CSS_FILES = $(filter-out %-min.css,$(wildcard css/*.css css/**/*.css ))
30 JS_FILES = $(filter-out %-min.js,$(wildcard js/*.js js/**/*.js ))
31 YUI_COMPRESSOR = yui-compressor 33 YUI_COMPRESSOR = yui-compressor
32 YUI_COMPRESSOR_FLAGS = --charset utf-8 --verbose 34 YUI_COMPRESSOR_FLAGS = --charset utf-8 --verbose
33 35
34 CSS_MINIFIED = $(CSS_FILES:.css=-min.css) 36 CSS_MINIFIED = $(CSS_FILES:.css=-min.css)
35 JS_MINIFIED = $(JS_FILES:.js=-min.js)
36 37
37 38
38 39
39 ############################################################################# 40 #############################################################################
40 41
41 .c.o: 42 .c.o:
42 ${CC} ${CFLAGS} ${INCLUDES} ${DEFINES} -c $< 43 ${CC} ${CFLAGS} ${INCLUDES} ${DEFINES} -c $<
43 44
44 all: minify-css minify-js 45 all: minify-css
45 46
46 clean: 47 clean:
47 rm -f version.php ${CSS_MINIFIED} ${JS_MINIFIED} 48 rm -f version.php ${CSS_MINIFIED}
48 49
49 minify-css: $(CSS_FILES) $(CSS_MINIFIED) 50 minify-css: $(CSS_FILES) $(CSS_MINIFIED)
50 minify-js: $(JS_FILES) $(JS_MINIFIED)
51 51
52 %-min.css: %.css 52 %-min.css: %.css
53 @echo '==> Minifying $<' 53 @echo '==> Minifying $<'
54 $(YUI_COMPRESSOR) $(YUI_COMPRESSOR_FLAGS) --type css $< >$@ 54 $(YUI_COMPRESSOR) $(YUI_COMPRESSOR_FLAGS) --type css $< >$@
55 @echo 55 @echo
56 56
57 %-min.js: %.js
58 @echo '==> Minifying $<'
59 $(YUI_COMPRESSOR) $(YUI_COMPRESSOR_FLAGS) --type js $< >$@
60 @echo
61
62
63 install: 57 install:
64 ${INSTALL} -d -g 314 -o 314 ${PREFIX} ${WWWDIR} ${WWWDIR}/css ${WWWDIR}/fpdf \ 58 ${INSTALL} -d -g 314 -o 314 ${PREFIX} ${WWWDIR} ${WWWDIR}/css ${WWWDIR}/fpdf \
65 ${WWWDIR}/fpdf/font \ 59 ${WWWDIR}/fpdf/font ${WWWDIR}/ispindel \
66 ${WWWDIR}/jqwidgets ${WWWDIR}/js ${WWWDIR}/images/ ${WWWDIR}/includes/ 60 ${WWWDIR}/jqwidgets ${WWWDIR}/js ${WWWDIR}/images/ ${WWWDIR}/includes/
67 ${INSTALL} -d -g 314 -o 314 -m 0777 ${WWWDIR}/run 61 ${INSTALL} -d -g 314 -o 314 -m 0777 ${WWWDIR}/run
68 ${INSTALL} -d -g 314 -o 314 ${WWWDIR}/log 62 ${INSTALL} -d -g 314 -o 314 ${WWWDIR}/log
69 ${INSTALL} -d -g 314 -o 314 ${WWWDIR}/log/brews 63 ${INSTALL} -d -g 314 -o 314 ${WWWDIR}/log/brews
70 ${INSTALL} -d -g 314 -o 314 ${WWWDIR}/log/fermentation 64 ${INSTALL} -d -g 314 -o 314 ${WWWDIR}/log/fermentation
65 ${INSTALL} -d -g 314 -o 314 ${WWWDIR}/log/co2pressure
66 ${INSTALL} -d -g 314 -o 314 ${WWWDIR}/log/ispindel
71 ${INSTALL} -g 314 -o 314 -m 0644 ${SRC} ${WWWDIR}/ 67 ${INSTALL} -g 314 -o 314 -m 0644 ${SRC} ${WWWDIR}/
72 ${INSTALL} -g 314 -o 314 -m 0644 version.php ${WWWDIR}/ 68 ${INSTALL} -g 314 -o 314 -m 0644 version.php ${WWWDIR}/
73 ${INSTALL} -g 314 -o 314 -m 0644 css/* ${WWWDIR}/css/ 69 ${INSTALL} -g 314 -o 314 -m 0644 css/* ${WWWDIR}/css/
74 ${INSTALL} -g 314 -o 314 -m 0644 images/* ${WWWDIR}/images/ 70 ${INSTALL} -g 314 -o 314 -m 0644 images/* ${WWWDIR}/images/
75 ${INSTALL} -g 314 -o 314 -m 0644 includes/* ${WWWDIR}/includes/ 71 ${INSTALL} -g 314 -o 314 -m 0644 includes/* ${WWWDIR}/includes/
72 ${INSTALL} -g 314 -o 314 -m 0644 ispindel/* ${WWWDIR}/ispindel/
76 cp -r jqwidgets/* ${WWWDIR}/jqwidgets/ 73 cp -r jqwidgets/* ${WWWDIR}/jqwidgets/
77 chown -R 314:314 ${WWWDIR}/jqwidgets 74 chown -R 314:314 ${WWWDIR}/jqwidgets
78 cp -r -p fpdf/* ${WWWDIR}/fpdf/ 75 cp -r -p fpdf/* ${WWWDIR}/fpdf/
79 chown -R 314:314 ${WWWDIR}/fpdf 76 chown -R 314:314 ${WWWDIR}/fpdf
80 ${INSTALL} -g 314 -o 314 -m 0644 js/* ${WWWDIR}/js/ 77 ${INSTALL} -g 314 -o 314 -m 0644 js/* ${WWWDIR}/js/

mercurial