X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=cmd%2Fweb%2FMakefile;h=c6bc2bd0b9376ffcc45734bda9a3989be4db0511;hb=6b3f0ad04550060fd25b87b68c3f9bc1602f3226;hp=c0ec4cd4ac17e9d6e66516871a9d645a29393e51;hpb=b2e9bce00231489ef507927eceb9207285cd2fe4;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FFront.git diff --git a/cmd/web/Makefile b/cmd/web/Makefile index c0ec4cd..c6bc2bd 100644 --- a/cmd/web/Makefile +++ b/cmd/web/Makefile @@ -6,18 +6,22 @@ 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 +STATIC_FILES= index.html style.css JSX_OBJS=$(addprefix $(BUILD_DIR)/,$(JSX_SRC:.jsx=.js)) JS_OBJS=$(addprefix $(BUILD_DIR)/,$(JS_SRC)) +ICONS=$(addprefix $(STATIC_BUILD_DIR)/icons/black/, $(notdir $(wildcard static/icons/black/*.svg))) +ICONS+=$(addprefix $(STATIC_BUILD_DIR)/icons/color/, $(notdir $(wildcard static/icons/color/*.svg))) STATIC_BUILD_DIR=build/static +$(info $(ICONS)) + install: node --version npm --version yarn --version yarn install -static: $(STATIC_BUILD_DIR) js $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) +static: $(STATIC_BUILD_DIR) js $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) $(ICONS) js: build/static/main.js @@ -27,6 +31,8 @@ $(STATIC_BUILD_DIR)/%: static/% $(STATIC_BUILD_DIR): mkdir -p $(BUILD_DIR) mkdir -p $@ + mkdir -p $@/icons/black + mkdir -p $@/icons/color $(BUILD_DIR)/%.js: $(SRC_DIR)/%.jsx eslint --fix $< @@ -36,14 +42,17 @@ $(BUILD_DIR)/%.js: $(SRC_DIR)/%.js eslint $< cp $< $@ +$(STATIC_BUILD_DIR)/icons/black/%.svg: static/icons/black/%.svg + cp $< $@ + build/static/main.js: $(JSX_OBJS) $(JS_OBJS) env/$(ENV).env browserify -t [ babelify --presets [ env react ] --plugins [ transform-class-properties ] ] \ -t [ localenvify --envfile env/$(ENV).env ] \ -t [ debowerify ] \ $(BUILD_DIR)/main.js -o $@ -build/webapp.tar.gz: $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) build/static/main.js - tar czf $@ --directory=$(dir $<) $(notdir $^) +build/webapp.tar.gz: $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) build/static/main.js $(ICONS) + tar czf $@ --directory=$(dir $<) $(subst $(STATIC_BUILD_DIR)/,,$^) release: $(STATIC_BUILD_DIR) build/webapp.tar.gz