From 59a8d396aaff26b7f90b46d63a75ea9adb4eb5ef Mon Sep 17 00:00:00 2001 From: Josha von Gizycki Date: Fri, 9 Oct 2020 23:13:53 +0200 Subject: [PATCH] add basic makefile --- .gitignore | 1 + .idea/watcherTasks.xml | 4 ++++ Makefile | 35 +++++++++++++++++++++++++++++++++ frontend/assets/sass/style.scss | 3 +++ 4 files changed, 43 insertions(+) create mode 100644 .idea/watcherTasks.xml create mode 100644 Makefile create mode 100644 frontend/assets/sass/style.scss diff --git a/.gitignore b/.gitignore index e7307a2..b94e5b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *~ .cpcache +/backend/resources/public/compiled/ diff --git a/.idea/watcherTasks.xml b/.idea/watcherTasks.xml new file mode 100644 index 0000000..9d98b43 --- /dev/null +++ b/.idea/watcherTasks.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..497481f --- /dev/null +++ b/Makefile @@ -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 diff --git a/frontend/assets/sass/style.scss b/frontend/assets/sass/style.scss new file mode 100644 index 0000000..eb6d901 --- /dev/null +++ b/frontend/assets/sass/style.scss @@ -0,0 +1,3 @@ +html { + font-family: sans-serif; +}