summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorProjectRevoTPP <projectrevotpp@hotmail.com>2020-04-19 01:37:04 -0400
committerProjectRevoTPP <projectrevotpp@hotmail.com>2020-04-19 01:37:04 -0400
commit3fdec1129fa78a5bbb1893a850e0245a6d082be9 (patch)
treea347f2fe57fbf91f4bc4561e19984365beb98943
parentf500ffd69377b5dca924dc159e2e2551775a3041 (diff)
cleanup dependencies and add WINE and devkitARM support to Makefile
-rw-r--r--INSTALL.md25
-rw-r--r--Makefile28
-rw-r--r--tools/mwasmarm_patcher/Makefile2
3 files changed, 46 insertions, 9 deletions
diff --git a/INSTALL.md b/INSTALL.md
index 76059419..083a0010 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -17,11 +17,32 @@ Building the ROM requires the following packages:
* make
* git
* build-essentials
-* binutils-arm-linux-gnueabi
+* binutils-arm-none-eabi
+* wine (to run the mwcc executables)
+
+NOTE: If you are using Arch/Manjaro or Void you will only need base-devel instead of build-essentials or make or git. You will still need wine.
+
+Also, if you are using WSL on Windows, please pass NOWINE=1 when compiling, and wine is not necessary for a WSL environment.
#### Windows
-TODO
+Before following the respective guides, please install devkitARM and ensure the DEVKITPRO and DEVKITARM variables are added to bashrc such that:
+
+Msys2:
+export DEVKITPRO=C:/devkitPro
+export DEVKITARM=${DEVKITPRO}/devkitARM
+
+Cygwin:
+export DEVKITPRO=/cygdrive/c/devkitPro
+export DEVKITARM=${DEVKITPRO}/devkitARM
+
+You will still require the following packages:
+
+* make
+* git
+* build-essentials
+
+Install them using either the Cygwin package manager or using pacman on Msys2.
### 4. Build ROM
diff --git a/Makefile b/Makefile
index 3a21944c..41cd85c0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,29 @@
# Makefile to build Pokemon Diamond image
+# Try to include devkitarm if installed
+TOOLCHAIN := $(DEVKITARM)
+
+ifneq (,$(wildcard $(TOOLCHAIN)/base_tools))
+include $(TOOLCHAIN)/base_tools
+endif
+
### Default target ###
default: all
+# If you are using WSL, it is recommended you build with NOWINE=1.
+NOWINE ?= 0
+
ifeq ($(OS),Windows_NT)
EXE := .exe
+WINE :=
else
-EXE :=
+EXE :=
+WINE := wine
+endif
+
+ifeq ($(NOWINE),1)
+WINE :=
endif
################ Target Executable and Sources ###############
@@ -43,7 +59,7 @@ endif
MWCCVERSION := 2.0/base
-CROSS := arm-linux-gnueabi-
+CROSS := arm-none-eabi-
MWCCARM := tools/mwccarm/$(MWCCVERSION)/mwccarm.exe
# Argh... due to EABI version shenanigans, we can't use GNU LD to link together
@@ -54,10 +70,10 @@ MWCCARM := tools/mwccarm/$(MWCCVERSION)/mwccarm.exe
MWLDARM := tools/mwccarm/$(MWCCVERSION)/mwldarm.exe
MWASMARM := tools/mwccarm/$(MWCCVERSION)/mwasmarm.exe
-AS := $(MWASMARM)
-CC := $(MWCCARM)
+AS := $(WINE)$(MWASMARM)
+CC := $(WINE)$(MWCCARM)
CPP := cpp -P
-LD := $(MWLDARM)
+LD := $(WINE)$(MWLDARM)
AR := $(CROSS)ar
OBJDUMP := $(CROSS)objdump
OBJCOPY := $(CROSS)objcopy
@@ -96,7 +112,7 @@ $(BUILD_DIR)/$(LD_SCRIPT): $(LD_SCRIPT)
$(CPP) $(VERSION_CFLAGS) -MMD -MP -MT $@ -MF $@.d -I include/ -I . -DBUILD_DIR=$(BUILD_DIR) -o $@ $<
$(ELF): $(O_FILES) $(BUILD_DIR)/$(LD_SCRIPT)
- $(LD) $(BUILD_DIR)/$(LD_SCRIPT) -o $(ELF) $(O_FILES) -nodead -w off -interworking
+ $(LD) $(BUILD_DIR)/$(LD_SCRIPT) -o $(ELF) $(O_FILES) -nodead -w off
$(ROM): $(ELF)
$(OBJCOPY) -O binary $< $@
diff --git a/tools/mwasmarm_patcher/Makefile b/tools/mwasmarm_patcher/Makefile
index 5cf20ee4..bc3082dc 100644
--- a/tools/mwasmarm_patcher/Makefile
+++ b/tools/mwasmarm_patcher/Makefile
@@ -4,4 +4,4 @@ CFLAGS := -O3
all: mwasmarm_patcher
mwasmarm_patcher: mwasmarm_patcher.c
- $(CC) $(CFLAGS) -o $@ $< -lssl -lcrypto
+ $(CC) $(CFLAGS) -o $@ $<