]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front.git/blob - cmd/web/Makefile
Poloniex connection.
[perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front.git] / cmd / web / Makefile
1 SHELL=/bin/bash
2 ENV ?= dev
3 export PATH := $(PATH):./node_modules/.bin
4
5 SRC_DIR=js
6 BUILD_DIR=build/js
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 cryptocoins.css cryptocoins.ttf cryptocoins.woff cryptocoins.woff2
10 JSX_OBJS=$(addprefix $(BUILD_DIR)/,$(JSX_SRC:.jsx=.js))
11 JS_OBJS=$(addprefix $(BUILD_DIR)/,$(JS_SRC))
12 STATIC_BUILD_DIR=build/static
13
14 install:
15 node --version
16 npm --version
17 yarn --version
18 yarn install
19
20 static: $(STATIC_BUILD_DIR) js $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES))
21
22 js: build/static/main.js
23
24 $(STATIC_BUILD_DIR)/%: static/%
25 cp $< $@
26
27 $(STATIC_BUILD_DIR):
28 mkdir -p $(BUILD_DIR)
29 mkdir -p $@
30
31 $(BUILD_DIR)/%.js: $(SRC_DIR)/%.jsx
32 jscs --fix $<
33 babel $< -o $@
34 jshint $@
35
36 $(BUILD_DIR)/%.js: $(SRC_DIR)/%.js
37 jscs --fix $<
38 cp $< $@
39 jshint $@
40
41 build/static/main.js: $(JSX_OBJS) $(JS_OBJS) env/$(ENV).env
42 browserify -t [ localenvify --envfile env/$(ENV).env ] \
43 -t [ debowerify ] \
44 $(BUILD_DIR)/main.js -o $@
45
46 build/webapp.tar.gz: $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) build/static/main.js
47 tar czf $@ --directory=$(dir $<) $(notdir $^)
48
49 release: $(STATIC_BUILD_DIR) build/webapp.tar.gz
50
51 clean:
52 rm -rf build
53 rm -rf node_modules