summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-04-10 13:01:12 +0200
committernsensfel <SpamShield0@noot-noot.org>2018-04-10 13:01:12 +0200
commit1001c3f6cfefd880c1721f2b80c1795197d05365 (patch)
tree8696137b5684547b80129d308bc854a7e74fa0b0 /src
parentd7032b408c5f66a3cb62c44cf0953abe48c39ef9 (diff)
Changing how the server services are organized...
Diffstat (limited to 'src')
-rw-r--r--src/battlemap/Makefile72
-rw-r--r--src/battlemap/src/battle/battle_turn.erl (renamed from src/battle/battle_turn.erl)0
-rw-r--r--src/battlemap/src/battle/movement.erl (renamed from src/battle/movement.erl)0
-rw-r--r--src/battlemap/src/battle/roll.erl (renamed from src/battle/roll.erl)0
-rw-r--r--src/battlemap/src/handler.erl (renamed from src/handler.erl)0
-rw-r--r--src/battlemap/src/io/security.erl (renamed from src/io/security.erl)0
-rw-r--r--src/battlemap/src/io/timed_cache.erl (renamed from src/io/timed_cache.erl)0
-rw-r--r--src/battlemap/src/io/timed_caches_manager.erl (renamed from src/io/timed_caches_manager.erl)0
-rw-r--r--src/battlemap/src/query/character_turn.erl (renamed from src/query/character_turn.erl)0
-rw-r--r--src/battlemap/src/query/load_state.erl (renamed from src/query/load_state.erl)0
-rw-r--r--src/battlemap/src/reply/add_char.erl (renamed from src/reply/add_char.erl)0
-rw-r--r--src/battlemap/src/reply/set_map.erl (renamed from src/reply/set_map.erl)0
-rw-r--r--src/battlemap/src/reply/set_timeline.erl (renamed from src/reply/set_timeline.erl)0
-rw-r--r--src/battlemap/src/reply/turn_results.erl (renamed from src/reply/turn_results.erl)0
-rw-r--r--src/battlemap/src/shim/database_shim.erl (renamed from src/shim/database_shim.erl)0
-rw-r--r--src/battlemap/src/struct/attack.erl (renamed from src/struct/attack.erl)0
-rw-r--r--src/battlemap/src/struct/attributes.erl (renamed from src/struct/attributes.erl)0
-rw-r--r--src/battlemap/src/struct/battle.erl (renamed from src/struct/battle.erl)0
-rw-r--r--src/battlemap/src/struct/battle_action.erl (renamed from src/struct/battle_action.erl)0
-rw-r--r--src/battlemap/src/struct/battlemap.erl (renamed from src/struct/battlemap.erl)0
-rw-r--r--src/battlemap/src/struct/character.erl (renamed from src/struct/character.erl)0
-rw-r--r--src/battlemap/src/struct/character_instance.erl (renamed from src/struct/character_instance.erl)0
-rw-r--r--src/battlemap/src/struct/direction.erl (renamed from src/struct/direction.erl)0
-rw-r--r--src/battlemap/src/struct/location.erl (renamed from src/struct/location.erl)0
-rw-r--r--src/battlemap/src/struct/player.erl (renamed from src/struct/player.erl)0
-rw-r--r--src/battlemap/src/struct/player_turn.erl (renamed from src/struct/player_turn.erl)0
-rw-r--r--src/battlemap/src/struct/statistics.erl (renamed from src/struct/statistics.erl)0
-rw-r--r--src/battlemap/src/struct/tile.erl (renamed from src/struct/tile.erl)0
-rw-r--r--src/battlemap/src/struct/turn_result.erl (renamed from src/struct/turn_result.erl)0
-rw-r--r--src/battlemap/src/struct/weapon.erl (renamed from src/struct/weapon.erl)0
30 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) $<
diff --git a/src/battle/battle_turn.erl b/src/battlemap/src/battle/battle_turn.erl
index 638e8f9..638e8f9 100644
--- a/src/battle/battle_turn.erl
+++ b/src/battlemap/src/battle/battle_turn.erl
diff --git a/src/battle/movement.erl b/src/battlemap/src/battle/movement.erl
index 588fad9..588fad9 100644
--- a/src/battle/movement.erl
+++ b/src/battlemap/src/battle/movement.erl
diff --git a/src/battle/roll.erl b/src/battlemap/src/battle/roll.erl
index 074054b..074054b 100644
--- a/src/battle/roll.erl
+++ b/src/battlemap/src/battle/roll.erl
diff --git a/src/handler.erl b/src/battlemap/src/handler.erl
index 0ecc8be..0ecc8be 100644
--- a/src/handler.erl
+++ b/src/battlemap/src/handler.erl
diff --git a/src/io/security.erl b/src/battlemap/src/io/security.erl
index 60f6661..60f6661 100644
--- a/src/io/security.erl
+++ b/src/battlemap/src/io/security.erl
diff --git a/src/io/timed_cache.erl b/src/battlemap/src/io/timed_cache.erl
index 52b98d6..52b98d6 100644
--- a/src/io/timed_cache.erl
+++ b/src/battlemap/src/io/timed_cache.erl
diff --git a/src/io/timed_caches_manager.erl b/src/battlemap/src/io/timed_caches_manager.erl
index 5901964..5901964 100644
--- a/src/io/timed_caches_manager.erl
+++ b/src/battlemap/src/io/timed_caches_manager.erl
diff --git a/src/query/character_turn.erl b/src/battlemap/src/query/character_turn.erl
index 85c5db8..85c5db8 100644
--- a/src/query/character_turn.erl
+++ b/src/battlemap/src/query/character_turn.erl
diff --git a/src/query/load_state.erl b/src/battlemap/src/query/load_state.erl
index a03a20f..a03a20f 100644
--- a/src/query/load_state.erl
+++ b/src/battlemap/src/query/load_state.erl
diff --git a/src/reply/add_char.erl b/src/battlemap/src/reply/add_char.erl
index b3ef128..b3ef128 100644
--- a/src/reply/add_char.erl
+++ b/src/battlemap/src/reply/add_char.erl
diff --git a/src/reply/set_map.erl b/src/battlemap/src/reply/set_map.erl
index 6a7cd39..6a7cd39 100644
--- a/src/reply/set_map.erl
+++ b/src/battlemap/src/reply/set_map.erl
diff --git a/src/reply/set_timeline.erl b/src/battlemap/src/reply/set_timeline.erl
index bfe621a..bfe621a 100644
--- a/src/reply/set_timeline.erl
+++ b/src/battlemap/src/reply/set_timeline.erl
diff --git a/src/reply/turn_results.erl b/src/battlemap/src/reply/turn_results.erl
index 0f3ff25..0f3ff25 100644
--- a/src/reply/turn_results.erl
+++ b/src/battlemap/src/reply/turn_results.erl
diff --git a/src/shim/database_shim.erl b/src/battlemap/src/shim/database_shim.erl
index a26087d..a26087d 100644
--- a/src/shim/database_shim.erl
+++ b/src/battlemap/src/shim/database_shim.erl
diff --git a/src/struct/attack.erl b/src/battlemap/src/struct/attack.erl
index 71bc2bb..71bc2bb 100644
--- a/src/struct/attack.erl
+++ b/src/battlemap/src/struct/attack.erl
diff --git a/src/struct/attributes.erl b/src/battlemap/src/struct/attributes.erl
index 6728831..6728831 100644
--- a/src/struct/attributes.erl
+++ b/src/battlemap/src/struct/attributes.erl
diff --git a/src/struct/battle.erl b/src/battlemap/src/struct/battle.erl
index 5ac12e4..5ac12e4 100644
--- a/src/struct/battle.erl
+++ b/src/battlemap/src/struct/battle.erl
diff --git a/src/struct/battle_action.erl b/src/battlemap/src/struct/battle_action.erl
index 8aaaef9..8aaaef9 100644
--- a/src/struct/battle_action.erl
+++ b/src/battlemap/src/struct/battle_action.erl
diff --git a/src/struct/battlemap.erl b/src/battlemap/src/struct/battlemap.erl
index 59e0639..59e0639 100644
--- a/src/struct/battlemap.erl
+++ b/src/battlemap/src/struct/battlemap.erl
diff --git a/src/struct/character.erl b/src/battlemap/src/struct/character.erl
index 8e1099e..8e1099e 100644
--- a/src/struct/character.erl
+++ b/src/battlemap/src/struct/character.erl
diff --git a/src/struct/character_instance.erl b/src/battlemap/src/struct/character_instance.erl
index 9b64f9a..9b64f9a 100644
--- a/src/struct/character_instance.erl
+++ b/src/battlemap/src/struct/character_instance.erl
diff --git a/src/struct/direction.erl b/src/battlemap/src/struct/direction.erl
index 84ae272..84ae272 100644
--- a/src/struct/direction.erl
+++ b/src/battlemap/src/struct/direction.erl
diff --git a/src/struct/location.erl b/src/battlemap/src/struct/location.erl
index b8e2bf3..b8e2bf3 100644
--- a/src/struct/location.erl
+++ b/src/battlemap/src/struct/location.erl
diff --git a/src/struct/player.erl b/src/battlemap/src/struct/player.erl
index c4aefd1..c4aefd1 100644
--- a/src/struct/player.erl
+++ b/src/battlemap/src/struct/player.erl
diff --git a/src/struct/player_turn.erl b/src/battlemap/src/struct/player_turn.erl
index 7795f35..7795f35 100644
--- a/src/struct/player_turn.erl
+++ b/src/battlemap/src/struct/player_turn.erl
diff --git a/src/struct/statistics.erl b/src/battlemap/src/struct/statistics.erl
index 6e29ea4..6e29ea4 100644
--- a/src/struct/statistics.erl
+++ b/src/battlemap/src/struct/statistics.erl
diff --git a/src/struct/tile.erl b/src/battlemap/src/struct/tile.erl
index e86da56..e86da56 100644
--- a/src/struct/tile.erl
+++ b/src/battlemap/src/struct/tile.erl
diff --git a/src/struct/turn_result.erl b/src/battlemap/src/struct/turn_result.erl
index 5f796ca..5f796ca 100644
--- a/src/struct/turn_result.erl
+++ b/src/battlemap/src/struct/turn_result.erl
diff --git a/src/struct/weapon.erl b/src/battlemap/src/struct/weapon.erl
index 80cb925..80cb925 100644
--- a/src/struct/weapon.erl
+++ b/src/battlemap/src/struct/weapon.erl