| summaryrefslogtreecommitdiff | 
diff options
| author | nsensfel <SpamShield0@noot-noot.org> | 2018-04-10 13:01:12 +0200 | 
|---|---|---|
| committer | nsensfel <SpamShield0@noot-noot.org> | 2018-04-10 13:01:12 +0200 | 
| commit | 1001c3f6cfefd880c1721f2b80c1795197d05365 (patch) | |
| tree | 8696137b5684547b80129d308bc854a7e74fa0b0 /src/battlemap/Makefile | |
| parent | d7032b408c5f66a3cb62c44cf0953abe48c39ef9 (diff) | |
Changing how the server services are organized...
Diffstat (limited to 'src/battlemap/Makefile')
| -rw-r--r-- | src/battlemap/Makefile | 72 | 
1 files changed, 72 insertions, 0 deletions
| diff --git a/src/battlemap/Makefile b/src/battlemap/Makefile new file mode 100644 index 0000000..c5bb150 --- /dev/null +++ b/src/battlemap/Makefile @@ -0,0 +1,72 @@ +## Directories +SRC_DIR ?= src +BIN_DIR ?= ebin +CONF_DIR ?= conf +INCLUDE_DIR ?= include +UNUSED_WWW_DIR ?= www + +YAWS_CONF ?= $(CONF_DIR)/yaws.conf +YAWS_API_HEADER ?= /my/src/yaws/include/yaws_api.hrl + +DIALYZER_PLT_FILE ?= tacticians-server.plt + +## Binaries +YAWS ?= yaws +ERLC ?= erlc +ERLC_OPTS ?= +DIALYZER ?= dialyzer + +################################################################################ +REQUIRED_HEADERS = $(INCLUDE_DIR)/yaws_api.hrl + +SRC_FILES = $(wildcard $(SRC_DIR)/*.erl) +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 + +debug: $(DIALYZER_PLT_FILE) +	$(MAKE) build_debug +	$(DIALYZER) --check_plt --plt $(DIALYZER_PLT_FILE) +	$(DIALYZER) --get_warnings $(SRC_DIR)/*.erl $(SRC_DIR)/*/*.erl \ +		--src --plt $(DIALYZER_PLT_FILE) + +build_debug: +	$(MAKE) clean +	$(MAKE) ERLC_OPTS=+debug_info + +build: $(BIN_DIR) $(REQUIRED_HEADERS) $(BIN_FILES) + +run: all $(UNUSED_WWW_DIR) +	$(YAWS) --conf $(YAWS_CONF) + +clean: +	rm -rf $(BIN_DIR)/* + +$(DIALYZER_PLT_FILE): +	$(DIALYZER) --build_plt --apps erts kernel stdlib jiffy --output_plt $@ +	$(MAKE) build_debug +	$(DIALYZER) --add_to_plt --plt $@ -r $(BIN_DIR) + +$(INCLUDE_DIR)/yaws_api.hrl: $(YAWS_API_HEADER) $(INCLUDE_DIR) +	cp $< $@ + +$(BIN_DIR): +	mkdir -p $@ + +$(UNUSED_WWW_DIR): +	mkdir -p $@ + +$(INCLUDE_DIR): +	mkdir -p $@ + +.SECONDEXPANSION: +$(BIN_FILES): $(BIN_DIR)/%.beam : $(SRC_DIR)/%.erl $$(wildcard $$(SRC_DIR)/%/.) +	$(ERLC) $(ERLC_OPTS) -o $(BIN_DIR) $< | 


