summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorProjectRevoTPP <projectrevotpp@hotmail.com>2020-04-17 13:38:38 -0400
committerProjectRevoTPP <projectrevotpp@hotmail.com>2020-04-17 13:38:38 -0400
commitec1f149fc83c2e6554f414279bd224fb3b479ada (patch)
tree0f151326e96db42a65fd2fc7742bea95e73a65d9 /Makefile
parentf88f463f88c68a80f46affd304297c78da4cb904 (diff)
add metrowerk assembler patcher and automate it during the build.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 21 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index fac3e52f..06087477 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,12 @@
default: all
+ifeq ($(OS),Windows_NT)
+EXE := .exe
+else
+EXE :=
+endif
+
################ Target Executable and Sources ###############
BUILD_DIR := build
@@ -24,6 +30,14 @@ S_FILES := $(foreach dir,$(ASM_DIRS),$(wildcard $(dir)/*.s))
# Object files
O_FILES := $(foreach file,$(C_FILES),$(BUILD_DIR)/$(file:.c=.o)) \
$(foreach file,$(S_FILES),$(BUILD_DIR)/$(file:.s=.o)) \
+
+################### Universal Dependencies ###################
+
+# Make tools if out of date
+DUMMY != make -s -C tools >&2 || echo FAIL
+ifeq ($(DUMMY),FAIL)
+ $(error Failed to build tools)
+endif
##################### Compiler Options #######################
@@ -57,10 +71,17 @@ CFLAGS = -O4,p -proc v5te -thumb -fp soft -lang c -Cpp_exceptions off -interwork
# DS TOOLS
TOOLS_DIR = tools
SHA1SUM = sha1sum
+MWASMARM_PATCHER = tools/mwasmarm_patcher/mwasmarm_patcher$(EXE)
+
+DUMMY != $(MWASMARM_PATCHER) $(MWASMARM) || echo FAIL
+ifeq ($(DUMMY),FAIL)
+ $(error MWASMARM patcher returned an error)
+endif
######################### Targets ###########################
all: $(ROM)
+ $(info Test)
@$(SHA1SUM) -c $(TARGET).sha1
clean: