summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 17 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 3b58a08..9c0bbc0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,15 @@
################################################################################
## CONFIG ######################################################################
################################################################################
-SRC_DIR ?= src
-WWW_DIR ?= www
-WWW_SCRIPT_DIR ?= $(WWW_DIR)/script
+MODULES ?= background popup
-ELM_CC ?= elm-make --warn
-
-MAIN_MODULE ?= $(SRC_DIR)/Main.elm
+SRC_DIR ?= ${CURDIR}/src
+WWW_DIR ?= ${CURDIR}/www
################################################################################
## MAKEFILE MAGIC ##############################################################
################################################################################
-SUB_MODULES = $(shell find $(SRC_DIR) -type f | grep "elm$$")
+MODULES_SRC = $(addprefix $(SRC_DIR)/,$(MODULES))
################################################################################
## SANITY CHECKS ###############################################################
@@ -21,16 +18,24 @@ SUB_MODULES = $(shell find $(SRC_DIR) -type f | grep "elm$$")
################################################################################
## TARGET RULES ################################################################
################################################################################
-build: $(WWW_SCRIPT_DIR)/main.js
+all: build
+
+build:
+ for module in $(MODULES_SRC) ; do \
+ $(MAKE) -C $$module build ; \
+ done
clean:
- rm -f $(WWW_SCRIPT_DIR)/main.js
+ for module in $(MODULES_SRC) ; do \
+ $(MAKE) -C $$module clean ; \
+ done
reset:
- rm -rf elm-stuff
+ $(MAKE) clean
+ for module in $(MODULES_SRC) ; do \
+ $(MAKE) -C $$module reset; \
+ done
################################################################################
## INTERNAL RULES ##############################################################
################################################################################
-$(WWW_SCRIPT_DIR)/main.js: $(MAIN_MODULE) $(SUB_MODULES)
- $(ELM_CC) $(MAIN_MODULE) --output $@