-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
57 lines (39 loc) · 1.64 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
MAKE="make"
INSTALL="install"
TAR="tar"
GREP="grep"
NODE="node"
NPM="npm"
DESTDIR="./dist"
TMPDIR := $(shell mktemp -d)
all: npm_dependencies min-css min-js copy-all
min-css:
$(NODE) $(CURDIR)/node_modules/.bin/cleancss $(CURDIR)/static/css/moe.css --output $(DESTDIR)/css/moe.min.css
$(NODE) $(CURDIR)/node_modules/.bin/cleancss $(CURDIR)/static/css/signin.css --output $(DESTDIR)/css/signin.min.css
$(NODE) $(CURDIR)/node_modules/.bin/cleancss $(CURDIR)/static/css/bootstrap.css --output $(DESTDIR)/css/bootstrap.min.css
min-js:
mkdir -p $(CURDIR)/js
mkdir -p $(DESTDIR)/ $(DESTDIR)/js
$(CURDIR)/node_modules/.bin/uglifyjs ./static/js/moe.js >> $(CURDIR)/js/moe.min.js
$(CURDIR)/node_modules/.bin/uglifyjs ./static/js/bootstrap.js >> $(CURDIR)/js/bootstrap.min.js
cp $(CURDIR)/js/moe.min.js $(DESTDIR)/js/
cp $(CURDIR)/js/bootstrap.min.js $(DESTDIR)/js/
copy-all:
mkdir -p $(DESTDIR)/ $(DESTDIR)/img
mkdir -p $(DESTDIR)/ $(DESTDIR)/css
mkdir -p $(DESTDIR)/ $(DESTDIR)/includes
mkdir -p $(DESTDIR)/ $(DESTDIR)/dashboard
mkdir -p $(DESTDIR)/ $(DESTDIR)/dashboard/skel
cp $(CURDIR)/static/img/*.png $(DESTDIR)/img/
cp $(CURDIR)/static/dashboard/skel/*.php $(DESTDIR)/dashboard/skel/
cp $(CURDIR)/static/dashboard/index.php $(DESTDIR)/dashboard/
cp $(CURDIR)/static/php/core.php $(DESTDIR)/includes/
cp $(CURDIR)/static/php/database.inc.php $(DESTDIR)/includes/
cp $(CURDIR)/static/php/settings.inc.php $(DESTDIR)/includes/
cp $(CURDIR)/static/php/api.php $(DESTDIR)/
cp $(CURDIR)/static/index.php $(DESTDIR)/
cp $(CURDIR)/package.json $(DESTDIR)/
rm -rvf $(CURDIR)/node_modules
rm -rvf $(CURDIR)/js
npm_dependencies:
$(NPM) install