From 2f22e667fbea56884d74ed27777f2e9f3fc9fd53 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Thu, 27 Sep 2018 15:40:30 +0200 Subject: Starting to separate background and popup code. --- Makefile | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'Makefile') 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 $@ -- cgit v1.2.3-70-g09d2