8 PKG_VERSION := $( $(GREP) -Po '(?<="version": ")[^"]*' )
9 TMPDIR := $(shell mktemp -d)
13 all: builddirs npm_dependencies swig htmlmin min-css min-js copy-img submodules
16 $(NODE) node_modules/swig/bin/swig.js render -j dist.json templates/faq.swig > $(CURDIR)/build/faq.html
17 $(NODE) node_modules/swig/bin/swig.js render -j dist.json templates/index.swig > $(CURDIR)/build/index.html
18 $(NODE) node_modules/swig/bin/swig.js render -j dist.json templates/tools.swig > $(CURDIR)/build/tools.html
21 $(NODE) node_modules/htmlmin/bin/htmlmin $(CURDIR)/build/index.html -o $(CURDIR)/build/index.html
22 $(NODE) node_modules/htmlmin/bin/htmlmin $(CURDIR)/build/faq.html -o $(CURDIR)/build/faq.html
23 $(NODE) node_modules/htmlmin/bin/htmlmin $(CURDIR)/build/tools.html -o $(CURDIR)/build/tools.html
26 mkdir -p $(DESTDIR)/ $(DESTDIR)/img
27 ifneq (,$(findstring php,$(MODULES)))
28 mkdir -p $(DESTDIR)/classes $(DESTDIR)/includes
30 ifneq (,$(findstring moe,$(MODULES)))
31 mkdir -p $(DESTDIR)/moe/{css,fonts,includes,js,login,panel/css/font,panel/css/images,register,templates}
35 $(NODE) $(CURDIR)/node_modules/.bin/cleancss --skip-rebase --O1 specialComments:0 $(CURDIR)/static/css/uguu.css --output $(CURDIR)/build/uguu.min.css
38 echo "// @source https://github.com/nokonoko/uguu/tree/master/static/js" > $(CURDIR)/build/uguu.min.js
39 echo "// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat" >> $(CURDIR)/build/uguu.min.js
40 $(NODE) $(CURDIR)/node_modules/.bin/uglifyjs --screw-ie8 ./static/js/app.js >> $(CURDIR)/build/uguu.min.js
41 echo "// @license-end" >> $(CURDIR)/build/uguu.min.js
44 cp -v $(CURDIR)/static/img/*.png $(CURDIR)/build/img/
47 ifneq ($(wildcard $(CURDIR)/static/php/.),)
48 cp -rv $(CURDIR)/static/php/* $(CURDIR)/build/
50 $(error The php submodule was not found)
54 ifneq ($(wildcard $(CURDIR)/moe/.),)
55 cp -rv $(CURDIR)/moe $(CURDIR)/build/
57 $(error The moe submodule was not found)
61 cp -rv $(CURDIR)/build/* $(DESTDIR)/
64 DESTDIR=$(TMPDIR)/uguu-$(PKGVERSION)
67 $(TAR) cJf uguu-$(PKG_VERSION).tar.xz $(DESTDIR)
71 rm -rvf $(CURDIR)/node_modules
72 rm -rvf $(CURDIR)/build
81 mkdir -p $(CURDIR)/build $(CURDIR)/build/img
82 ifneq (,$(findstring php,$(MODULES)))
83 mkdir -p $(CURDIR)/build/classes $(CURDIR)/build/includes
85 ifneq (,$(findstring moe,$(MODULES)))
86 mkdir -p $(CURDIR)/build/moe/{css,fonts,includes,js,login,panel/css/font,panel/css/images,register,templates}
90 $(info The following modules will be enabled: $(MODULES))
91 ifneq (,$(findstring php,$(MODULES)))
94 ifneq (,$(findstring moe,$(MODULES)))