3 export PATH := $(PATH):./node_modules/.bin
7 JSX_SRC= header_footer.jsx main.jsx signup.jsx signin.jsx otp.jsx poloniex.jsx password_reset.jsx change_password.jsx
8 JS_SRC= cookies.js app.js api.js
9 STATIC_FILES= index.html style.css fontello.css
10 STATIC_FILES+=$(addprefix fonts/, fontello.eot fontello.svg fontello.ttf fontello.woff fontello.woff2)
11 JSX_OBJS=$(addprefix $(BUILD_DIR)/,$(JSX_SRC:.jsx=.js))
12 JS_OBJS=$(addprefix $(BUILD_DIR)/,$(JS_SRC))
13 ICONS=$(addprefix $(STATIC_BUILD_DIR)/icons/black/, $(notdir $(wildcard static/icons/black/*.svg)))
14 ICONS+=$(addprefix $(STATIC_BUILD_DIR)/icons/color/, $(notdir $(wildcard static/icons/color/*.svg)))
15 STATIC_BUILD_DIR=build/static
23 static: $(STATIC_BUILD_DIR) js $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) $(ICONS)
25 js: build/static/main.js
27 $(STATIC_BUILD_DIR)/%: static/%
33 mkdir -p $@/icons/black
34 mkdir -p $@/icons/color
37 $(BUILD_DIR)/%.js: $(SRC_DIR)/%.jsx
41 $(BUILD_DIR)/%.js: $(SRC_DIR)/%.js
45 $(STATIC_BUILD_DIR)/icons/black/%.svg: static/icons/black/%.svg
48 build/static/main.js: $(JSX_OBJS) $(JS_OBJS) env/$(ENV).env
49 browserify -t [ babelify --presets [ env react ] --plugins [ transform-class-properties ] ] \
50 -t [ localenvify --envfile env/$(ENV).env ] \
52 $(BUILD_DIR)/main.js -o $@
54 build/webapp.tar.gz: $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) build/static/main.js $(ICONS)
55 tar czf $@ --directory=$(dir $<) $(subst $(STATIC_BUILD_DIR)/,,$^)
57 release: $(STATIC_BUILD_DIR) build/webapp.tar.gz
64 FONT_DIR = ./static/fontello
65 FONTELLO_HOST ?= http://fontello.com
68 @if test ! `which curl` ; then \
69 echo 'Install curl first.' >&2 ; \
72 curl --silent --show-error --fail --output .fontello \
73 --form "config=@fontello_config.json" \
75 x-www-browser ${FONTELLO_HOST}/`cat .fontello`
79 @if test ! `which unzip` ; then \
80 echo 'Install unzip first.' >&2 ; \
83 @if test ! -e .fontello ; then \
84 echo 'Run `make fontopen` first.' >&2 ; \
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
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