summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2017-11-28 17:14:02 +0100
committernsensfel <SpamShield0@noot-noot.org>2017-11-28 17:14:02 +0100
commitf539b7072c357339328d9bfd54f1f1ed51828586 (patch)
treeb6205dd79c78090831e812aceac177d2a9f35d28 /Makefile
parent80358376b9300a0d73cb8b62dfa9fdd65240ca66 (diff)
Trying to tidy up this mess.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 11 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index c6ee40e..c04a7bc 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ SRC_DIR ?= src
BIN_DIR ?= ebin
CONF_DIR ?= conf
-YAWS_CONF = $(CONF_DIR)/yaws.conf
+YAWS_CONF ?= $(CONF_DIR)/yaws.conf
## Binaries
YAWS ?= yaws
@@ -11,9 +11,18 @@ ERLC ?= erlc
################################################################################
SRC_FILES = $(wildcard $(SRC_DIR)/*.erl)
-MODULES = $(patsubst $(SRC_DIR)/%.erl,%,$(SRC_FILES))
+MODULES = $(patsubst %.erl,%,$(SRC_FILES))
+SUB_DIRS = $(filter-out $(MODULES),$(sort $(dir $(wildcard $(SRC_DIR)/*/))))
BIN_FILES = $(patsubst $(SRC_DIR)/%.erl,$(BIN_DIR)/%.beam,$(SRC_FILES))
+
+export
################################################################################
+all:
+ for subdir in $(SUB_DIRS) ; do \
+ echo "Building dir $$subdir" ; \
+ $(MAKE) build SRC_DIR=$$subdir || exit 1;\
+ done
+
build: $(BIN_DIR) $(BIN_FILES)
run: $(BIN_FILES)