Better makefile

This commit is contained in:
Thomas Forgione 2020-10-04 22:00:36 +02:00
parent e409d04461
commit 65c8e5935b
1 changed files with 10 additions and 9 deletions

View File

@ -14,22 +14,23 @@ BUILD_DIR=js
all: dev all: dev
dev: src/** dev: js/main.js
@mkdir -p $(BUILD_DIR)
release: js/main.min.js
js/main.js: src/**
$(ELM) make src/Main.elm --output $(BUILD_DIR)/main.js $(ELM) make src/Main.elm --output $(BUILD_DIR)/main.js
release: src/** js/main.min.js: js/main.tmp.js
@mkdir -p $(BUILD_DIR)
@$(ELM) make src/Main.elm --optimize --output $(BUILD_DIR)/main.tmp.js
@$(UGLIFYJS) $(BUILD_DIR)/main.tmp.js --compress 'pure_funcs="F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9",pure_getters,keep_fargs=false,unsafe_comps,unsafe' | uglifyjs --mangle > $(BUILD_DIR)/main.min.js @$(UGLIFYJS) $(BUILD_DIR)/main.tmp.js --compress 'pure_funcs="F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9",pure_getters,keep_fargs=false,unsafe_comps,unsafe' | uglifyjs --mangle > $(BUILD_DIR)/main.min.js
js/main.tmp.js: src/**
@$(ELM) make src/Main.elm --optimize --output $(BUILD_DIR)/main.tmp.js
watch: watch:
@mkdir -p $(BUILD_DIR)
@$(ELMLIVE) src/Main.elm -p 7000 -d . -- --output $(BUILD_DIR)/main.js @$(ELMLIVE) src/Main.elm -p 7000 -d . -- --output $(BUILD_DIR)/main.js
clean: clean:
@/bin/echo -e "\033[32;1m Cleaning\033[0m client" @rm -rf $(BUILD_DIR)/{main.js,main.min.js}
@rm -rf $(BUILD_DIR)
@/bin/echo -e "\033[32;1m Cleaned\033[0m client"