3 export PATH := $(PATH):./node_modules/.bin
7 JSX_SRC= main.jsx signup.jsx signin.jsx otp.jsx poloniex.jsx
8 JS_SRC= cookies.js app.js api.js
9 STATIC_FILES= index.html style.css
10 JSX_OBJS=$(addprefix $(BUILD_DIR)/,$(JSX_SRC:.jsx=.js))
11 JS_OBJS=$(addprefix $(BUILD_DIR)/,$(JS_SRC))
12 ICONS=$(addprefix $(STATIC_BUILD_DIR)/icons/black/, $(notdir $(wildcard static/icons/black/*.svg)))
13 ICONS+=$(addprefix $(STATIC_BUILD_DIR)/icons/color/, $(notdir $(wildcard static/icons/color/*.svg)))
14 STATIC_BUILD_DIR=build/static
24 static: $(STATIC_BUILD_DIR) js $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) $(ICONS)
26 js: build/static/main.js
28 $(STATIC_BUILD_DIR)/%: static/%
34 mkdir -p $@/icons/black
35 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