add basic makefile

master
Josha von Gizycki 4 years ago
parent b625d49a25
commit 59a8d396aa

1
.gitignore vendored

@ -1,2 +1,3 @@
*~ *~
.cpcache .cpcache
/backend/resources/public/compiled/

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectTasksOptions" suppressed-tasks="Sass" />
</project>

@ -0,0 +1,35 @@
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

@ -0,0 +1,3 @@
html {
font-family: sans-serif;
}
Loading…
Cancel
Save