-#Mihrtec Standard Makefile
-#Author: ksg
-
-#Project Info
-APPNAME := the_march
-MODULES := core
-CFLAGS := -Wall
-
-#Additional deps and flags for the final executable file
-APP_FLAGS :=
-APP_RULES :=
-
-#Extra cleanup rules
-CLEAN_RULES :=
-SCRUB_RULES :=
-
-
-ifdef EMSCRIPTEN_TOOLS
-#Emscripten build environment
-APP_RULES += move
-HTML := index.html js/the_march.config.js js/auth.js
-EXPORTS := '_em_main', 'auth_encrypt'
-CC := emcc
-EMFLAGS := -I../extern/include
-EMFLAGS += -s USE_SDL=2 -s USE_SDL_TTF=2 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='["png"]'
-APP_FLAGS += --separate-asm -s ALLOW_MEMORY_GROWTH=1 -s FORCE_FILESYSTEM=1 --pre-js html/js/pre.js
-APP_FLAGS += -s EXPORTED_FUNCTIONS="[$(EXPORTS)]"
-EXEPATH := ../dist/bin/jasm/js
-EXE := $(APPNAME).js
-OBJFILE :=bc
-EMFLAGS += -I/usr/include/google -I../extern/include
-BYPRODUCT := $(APPNAME).asm.js $(APPNAME).js.mem
-APP_FLAGS += $(EMFLAGS) ../extern/lib/libwolfssl.so
-else
-#Native Build Environment
-CC := gcc
-CFLAGS +=
-#LIBS := -lprotobuf-c
-LIBS += SDL2_ttf SDL2_image SDL2main SDL2
-EXEPATH := ../dist/bin/$(shell uname -m)
-#windows mingw build rules
-ifeq ($(OS), Windows_NT)
-LIBS := -lmingw32 -mwindows $(LIBS)
-EXE := $(APPNAME).exe
-else
-EXE := $(APPNAME)
-endif
-OBJFILE :=o
-endif
-
-#-I each of the module directories, include directory, and define APPNAME.
-CFLAGS += $(patsubst %,-I%, $(MODULES))
-CFLAGS += -Iinclude -I.
-CFLAGS += -DAPPNAME=$(APPNAME)
-
-#auto include all .c files
-SRC += $(patsubst %,%/*.c,$(MODULES))
-SRC := $(wildcard $(SRC))
+##################################################
+#Desc: Mihrtec Standard Makefile
+#Author: Mihrtec LLC
+#Date: 2016
+##################################################
+#Application Information
+##################################################
+#Executable name, also passed as -DAPPNAME to compiler
+APPNAME := the_march
+#Directory in which we expect to find main()
+APPSRC := core
+#Compiler flags for the final executable
+APPFLAGS :=
+#Object files statically linked for the executable
+APPOBJ :=
+#Dependencies which must be built before the executable
+APPDEPS :=
+##################################################
+#Emscripten Info
+##################################################
+#Functions to export for JS Module
+EXPORT_FUNCS := em_main auth_encrypt
+#Flags to always run on emcc/em++
+EMFLAGS :=
+
+#Import the build system setup
+include .make/build.mk