You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
982 B
36 lines
982 B
ROOT=$(shell pwd)
|
|
ASSETS_DIR=backend/resources/public/compiled
|
|
|
|
TARGET_CSS_DIR=$(ASSETS_DIR)/css
|
|
TARGET_CSS_FILE=$(TARGET_CSS_DIR)/style.css
|
|
|
|
TARGET_JS_DIR=$(ASSETS_DIR)/js
|
|
TARGET_JS_FILE=$(TARGET_JS_DIR)/app.js
|
|
|
|
SOURCE_ELM_FILES=$(wildcard frontend/src/*.elm)
|
|
SOURCE_SASS_FILE=frontend/assets/sass/style.scss
|
|
|
|
.PHONY: compile
|
|
compile: $(TARGET_JS_FILE) $(TARGET_CSS_FILE)
|
|
|
|
$(TARGET_JS_FILE): $(SOURCE_ELM_FILES)
|
|
mkdir -p $(TARGET_JS_DIR)
|
|
cd frontend && elm make src/Main.elm --output $(ROOT)/$(APP_JS) --optimize
|
|
|
|
$(TARGET_CSS_FILE): $(SOURCE_SASS_FILE)
|
|
mkdir -p $(TARGET_CSS_DIR)
|
|
sassc --style compressed $(SOURCE_SASS_FILE) > $(TARGET_CSS_FILE)
|
|
|
|
.PHONY: compile-debug
|
|
compile-debug:
|
|
cd frontend && elm make src/Main.elm --output $(ROOT)/$(APP_JS) --debug
|
|
sassc $(SOURCE_SASS_FILE) > $(TARGET_CSS_FILE)
|
|
|
|
.PHONY: elm-live
|
|
elm-live:
|
|
cd frontend && elm-live src/Main.elm --pushstate -- --debug
|
|
|
|
.PHONE: sass-live
|
|
sass-live:
|
|
while sleep 1; do make -s $(TARGET_CSS_FILE); done
|