aboutsummaryrefslogtreecommitdiff
path: root/cmd/web/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/web/Makefile')
-rw-r--r--cmd/web/Makefile19
1 files changed, 10 insertions, 9 deletions
diff --git a/cmd/web/Makefile b/cmd/web/Makefile
index 1d98085..2ebb734 100644
--- a/cmd/web/Makefile
+++ b/cmd/web/Makefile
@@ -6,6 +6,7 @@ SRC_DIR=js
6BUILD_DIR=build/js 6BUILD_DIR=build/js
7JSX_SRC= main.jsx signup.jsx signin.jsx otp.jsx poloniex.jsx 7JSX_SRC= main.jsx signup.jsx signin.jsx otp.jsx poloniex.jsx
8JS_SRC= cookies.js app.js api.js 8JS_SRC= cookies.js app.js api.js
9STATIC_FILES= index.html style.css cryptocoins.css cryptocoins.ttf cryptocoins.woff cryptocoins.woff2
9JSX_OBJS=$(addprefix $(BUILD_DIR)/,$(JSX_SRC:.jsx=.js)) 10JSX_OBJS=$(addprefix $(BUILD_DIR)/,$(JSX_SRC:.jsx=.js))
10JS_OBJS=$(addprefix $(BUILD_DIR)/,$(JS_SRC)) 11JS_OBJS=$(addprefix $(BUILD_DIR)/,$(JS_SRC))
11STATIC_BUILD_DIR=build/static 12STATIC_BUILD_DIR=build/static
@@ -16,18 +17,18 @@ install:
16 yarn --version 17 yarn --version
17 yarn install 18 yarn install
18 19
19static: js $(STATIC_BUILD_DIR)/index.html $(STATIC_BUILD_DIR)/style.css 20static: $(STATIC_BUILD_DIR) js $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES))
20 21
21js: build/static/main.js 22js: build/static/main.js
22 23
23$(STATIC_BUILD_DIR)/index.html: static/index.html 24$(STATIC_BUILD_DIR)/%: static/%
24 cp static/index.html $@ 25 cp $< $@
25 26
26$(STATIC_BUILD_DIR)/style.css: static/style.css 27$(STATIC_BUILD_DIR):
27 cp static/style.css $@ 28 mkdir -p $(BUILD_DIR)
29 mkdir -p $@
28 30
29$(BUILD_DIR)/%.js: $(SRC_DIR)/%.jsx 31$(BUILD_DIR)/%.js: $(SRC_DIR)/%.jsx
30 mkdir -p $(@D)
31 jscs --fix $< 32 jscs --fix $<
32 babel $< -o $@ 33 babel $< -o $@
33 jshint $@ 34 jshint $@
@@ -42,11 +43,11 @@ build/static/main.js: $(JSX_OBJS) $(JS_OBJS) env/$(ENV).env
42 -t [ debowerify ] \ 43 -t [ debowerify ] \
43 $(BUILD_DIR)/main.js -o $@ 44 $(BUILD_DIR)/main.js -o $@
44 45
45build/webapp.tar.gz: $(STATIC_BUILD_DIR)/main.js $(STATIC_BUILD_DIR)/index.html $(STATIC_BUILD_DIR)/style.css 46build/webapp.tar.gz: $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) build/static/main.js
46 tar czf $@ --directory=$(dir $<) $(notdir $^) 47 tar czf $@ --directory=$(dir $<) $(notdir $^)
47 48
48release: build/webapp.tar.gz 49release: $(STATIC_BUILD_DIR) build/webapp.tar.gz
49 50
50clean: 51clean:
51 rm -rf build 52 rm -rf build
52 rm -rf node_modules \ No newline at end of file 53 rm -rf node_modules