aboutsummaryrefslogtreecommitdiff
path: root/cmd/web/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/web/Makefile')
-rw-r--r--cmd/web/Makefile41
1 files changed, 38 insertions, 3 deletions
diff --git a/cmd/web/Makefile b/cmd/web/Makefile
index 85bba5b..02ff826 100644
--- a/cmd/web/Makefile
+++ b/cmd/web/Makefile
@@ -6,15 +6,14 @@ SRC_DIR=js
6BUILD_DIR=build/js 6BUILD_DIR=build/js
7JSX_SRC= header_footer.jsx main.jsx signup.jsx signin.jsx otp.jsx poloniex.jsx password_reset.jsx change_password.jsx 7JSX_SRC= header_footer.jsx main.jsx signup.jsx signin.jsx otp.jsx poloniex.jsx password_reset.jsx change_password.jsx
8JS_SRC= cookies.js app.js api.js 8JS_SRC= cookies.js app.js api.js
9STATIC_FILES= index.html style.css 9STATIC_FILES= index.html style.css fontello.css
10STATIC_FILES+=$(addprefix fonts/, fontello.eot fontello.svg fontello.ttf fontello.woff fontello.woff2)
10JSX_OBJS=$(addprefix $(BUILD_DIR)/,$(JSX_SRC:.jsx=.js)) 11JSX_OBJS=$(addprefix $(BUILD_DIR)/,$(JSX_SRC:.jsx=.js))
11JS_OBJS=$(addprefix $(BUILD_DIR)/,$(JS_SRC)) 12JS_OBJS=$(addprefix $(BUILD_DIR)/,$(JS_SRC))
12ICONS=$(addprefix $(STATIC_BUILD_DIR)/icons/black/, $(notdir $(wildcard static/icons/black/*.svg))) 13ICONS=$(addprefix $(STATIC_BUILD_DIR)/icons/black/, $(notdir $(wildcard static/icons/black/*.svg)))
13ICONS+=$(addprefix $(STATIC_BUILD_DIR)/icons/color/, $(notdir $(wildcard static/icons/color/*.svg))) 14ICONS+=$(addprefix $(STATIC_BUILD_DIR)/icons/color/, $(notdir $(wildcard static/icons/color/*.svg)))
14STATIC_BUILD_DIR=build/static 15STATIC_BUILD_DIR=build/static
15 16
16$(info $(ICONS))
17
18install: 17install:
19 node --version 18 node --version
20 npm --version 19 npm --version
@@ -33,6 +32,7 @@ $(STATIC_BUILD_DIR):
33 mkdir -p $@ 32 mkdir -p $@
34 mkdir -p $@/icons/black 33 mkdir -p $@/icons/black
35 mkdir -p $@/icons/color 34 mkdir -p $@/icons/color
35 mkdir -p $@/fonts
36 36
37$(BUILD_DIR)/%.js: $(SRC_DIR)/%.jsx 37$(BUILD_DIR)/%.js: $(SRC_DIR)/%.jsx
38 eslint --fix $< 38 eslint --fix $<
@@ -59,3 +59,38 @@ release: $(STATIC_BUILD_DIR) build/webapp.tar.gz
59clean: 59clean:
60 rm -rf build 60 rm -rf build
61 rm -rf node_modules 61 rm -rf node_modules
62
63
64FONT_DIR = ./static/fontello
65FONTELLO_HOST ?= http://fontello.com
66
67fontopen:
68 @if test ! `which curl` ; then \
69 echo 'Install curl first.' >&2 ; \
70 exit 128 ; \
71 fi
72 curl --silent --show-error --fail --output .fontello \
73 --form "config=@fontello_config.json" \
74 ${FONTELLO_HOST}
75 x-www-browser ${FONTELLO_HOST}/`cat .fontello`
76
77
78fontsave:
79 @if test ! `which unzip` ; then \
80 echo 'Install unzip first.' >&2 ; \
81 exit 128 ; \
82 fi
83 @if test ! -e .fontello ; then \
84 echo 'Run `make fontopen` first.' >&2 ; \
85 exit 128 ; \
86 fi
87 rm -rf .fontello.src .fontello.zip
88 curl --silent --show-error --fail --output .fontello.zip \
89 ${FONTELLO_HOST}/`cat .fontello`/get
90 unzip .fontello.zip -d .fontello.src
91 rm -rf ${FONT_DIR}
92 mv `find ./.fontello.src -maxdepth 1 -name 'fontello-*'` ${FONT_DIR}
93 rm -rf .fontello.src .fontello.zip
94 cp ${FONT_DIR}/font/* static/fonts/
95 cp ${FONT_DIR}/css/fontello-codes.css static/fontello.css
96 rm -rf ${FONT_DIR} \ No newline at end of file