X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=cmd%2Fweb%2FMakefile;h=52e2289a9adc4b27b5738a653adca28a6725e34d;hb=78e3e81ddf01f41102f3f4e32c5a3955cf5fb04f;hp=85bba5bdfa3c48ed3625469c8e69bf4863c7ed3f;hpb=87b6d05e5b289f3e9d1554fe455296ba09655c3a;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FFront.git diff --git a/cmd/web/Makefile b/cmd/web/Makefile index 85bba5b..52e2289 100644 --- a/cmd/web/Makefile +++ b/cmd/web/Makefile @@ -4,24 +4,23 @@ export PATH := $(PATH):./node_modules/.bin SRC_DIR=js BUILD_DIR=build/js -JSX_SRC= header_footer.jsx main.jsx signup.jsx signin.jsx otp.jsx poloniex.jsx password_reset.jsx change_password.jsx +JSX_SRC= header_footer.jsx main.jsx signup.jsx signin.jsx otp.jsx poloniex.jsx password_reset.jsx change_password.jsx account.jsx JS_SRC= cookies.js app.js api.js -STATIC_FILES= index.html style.css +STATIC_FILES= index.html style.css fontello.css +STATIC_FILES+=$(addprefix fonts/, fontello.eot fontello.svg fontello.ttf fontello.woff fontello.woff2) 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)) $(ICONS) +static: $(STATIC_BUILD_DIR) $(STATIC_BUILD_DIR)/fonts js $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) $(ICONS) js: build/static/main.js @@ -34,6 +33,9 @@ $(STATIC_BUILD_DIR): mkdir -p $@/icons/black mkdir -p $@/icons/color +$(STATIC_BUILD_DIR)/fonts: + mkdir -p $@ + $(BUILD_DIR)/%.js: $(SRC_DIR)/%.jsx eslint --fix $< cp $< $@ @@ -59,3 +61,38 @@ release: $(STATIC_BUILD_DIR) build/webapp.tar.gz clean: rm -rf build rm -rf node_modules + + +FONT_DIR = ./static/fontello +FONTELLO_HOST ?= http://fontello.com + +fontopen: + @if test ! `which curl` ; then \ + echo 'Install curl first.' >&2 ; \ + exit 128 ; \ + fi + curl --silent --show-error --fail --output .fontello \ + --form "config=@fontello_config.json" \ + ${FONTELLO_HOST} + x-www-browser ${FONTELLO_HOST}/`cat .fontello` + + +fontsave: + @if test ! `which unzip` ; then \ + echo 'Install unzip first.' >&2 ; \ + exit 128 ; \ + fi + @if test ! -e .fontello ; then \ + echo 'Run `make fontopen` first.' >&2 ; \ + exit 128 ; \ + fi + rm -rf .fontello.src .fontello.zip + curl --silent --show-error --fail --output .fontello.zip \ + ${FONTELLO_HOST}/`cat .fontello`/get + unzip .fontello.zip -d .fontello.src + rm -rf ${FONT_DIR} + mv `find ./.fontello.src -maxdepth 1 -name 'fontello-*'` ${FONT_DIR} + rm -rf .fontello.src .fontello.zip + cp ${FONT_DIR}/font/* static/fonts/ + cp ${FONT_DIR}/css/fontello-codes.css static/fontello.css + rm -rf ${FONT_DIR} \ No newline at end of file