diff options
Diffstat (limited to 'cmd/web/Makefile')
-rw-r--r-- | cmd/web/Makefile | 19 |
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 | |||
6 | BUILD_DIR=build/js | 6 | BUILD_DIR=build/js |
7 | JSX_SRC= main.jsx signup.jsx signin.jsx otp.jsx poloniex.jsx | 7 | JSX_SRC= main.jsx signup.jsx signin.jsx otp.jsx poloniex.jsx |
8 | JS_SRC= cookies.js app.js api.js | 8 | JS_SRC= cookies.js app.js api.js |
9 | STATIC_FILES= index.html style.css cryptocoins.css cryptocoins.ttf cryptocoins.woff cryptocoins.woff2 | ||
9 | JSX_OBJS=$(addprefix $(BUILD_DIR)/,$(JSX_SRC:.jsx=.js)) | 10 | JSX_OBJS=$(addprefix $(BUILD_DIR)/,$(JSX_SRC:.jsx=.js)) |
10 | JS_OBJS=$(addprefix $(BUILD_DIR)/,$(JS_SRC)) | 11 | JS_OBJS=$(addprefix $(BUILD_DIR)/,$(JS_SRC)) |
11 | STATIC_BUILD_DIR=build/static | 12 | STATIC_BUILD_DIR=build/static |
@@ -16,18 +17,18 @@ install: | |||
16 | yarn --version | 17 | yarn --version |
17 | yarn install | 18 | yarn install |
18 | 19 | ||
19 | static: js $(STATIC_BUILD_DIR)/index.html $(STATIC_BUILD_DIR)/style.css | 20 | static: $(STATIC_BUILD_DIR) js $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) |
20 | 21 | ||
21 | js: build/static/main.js | 22 | js: 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 | ||
45 | build/webapp.tar.gz: $(STATIC_BUILD_DIR)/main.js $(STATIC_BUILD_DIR)/index.html $(STATIC_BUILD_DIR)/style.css | 46 | build/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 | ||
48 | release: build/webapp.tar.gz | 49 | release: $(STATIC_BUILD_DIR) build/webapp.tar.gz |
49 | 50 | ||
50 | clean: | 51 | clean: |
51 | rm -rf build | 52 | rm -rf build |
52 | rm -rf node_modules \ No newline at end of file | 53 | rm -rf node_modules |