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
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 $@
-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