]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front.git/blobdiff - cmd/web/Makefile
Poloniex connection.
[perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front.git] / cmd / web / Makefile
index 1d980854639fc27a19a258315940ce693671d6fb..2ebb734d0397af420959fb6f064c72f5a42dd6dc 100644 (file)
@@ -6,6 +6,7 @@ SRC_DIR=js
 BUILD_DIR=build/js
 JSX_SRC= main.jsx signup.jsx signin.jsx otp.jsx poloniex.jsx
 JS_SRC= cookies.js app.js api.js
+STATIC_FILES= index.html style.css cryptocoins.css cryptocoins.ttf cryptocoins.woff cryptocoins.woff2
 JSX_OBJS=$(addprefix $(BUILD_DIR)/,$(JSX_SRC:.jsx=.js))
 JS_OBJS=$(addprefix $(BUILD_DIR)/,$(JS_SRC))
 STATIC_BUILD_DIR=build/static
@@ -16,18 +17,18 @@ install:
        yarn --version
        yarn install
 
-static: js $(STATIC_BUILD_DIR)/index.html $(STATIC_BUILD_DIR)/style.css
+static: $(STATIC_BUILD_DIR) js $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES))
 
 js: build/static/main.js
 
-$(STATIC_BUILD_DIR)/index.html: static/index.html
-       cp static/index.html $@
+$(STATIC_BUILD_DIR)/%: static/%
+       cp $< $@
 
-$(STATIC_BUILD_DIR)/style.css: static/style.css
-       cp static/style.css $@
+$(STATIC_BUILD_DIR):
+       mkdir -p $(BUILD_DIR)
+       mkdir -p $@
 
 $(BUILD_DIR)/%.js: $(SRC_DIR)/%.jsx
-       mkdir -p $(@D)
        jscs --fix $<
        babel $< -o $@
        jshint $@
@@ -42,11 +43,11 @@ build/static/main.js: $(JSX_OBJS) $(JS_OBJS) env/$(ENV).env
                                                 -t [ debowerify ]  \
                                                 $(BUILD_DIR)/main.js -o $@
 
-build/webapp.tar.gz: $(STATIC_BUILD_DIR)/main.js $(STATIC_BUILD_DIR)/index.html $(STATIC_BUILD_DIR)/style.css
+build/webapp.tar.gz: $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) build/static/main.js
        tar czf $@ --directory=$(dir $<) $(notdir $^)
 
-release: build/webapp.tar.gz
+release: $(STATIC_BUILD_DIR) build/webapp.tar.gz
 
 clean:
        rm -rf build
-       rm -rf node_modules
\ No newline at end of file
+       rm -rf node_modules