diff --git a/README.md b/README.md index d7651d7..fa92ce7 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,13 @@ For binary FR. See [here](https://gist.github.com/Zeturic/db1611cc7b17c3140f9b9af32e1b596b) for the prequisites and help in installing them. -#### Cloning the repo and building the tools +#### Cloning the repo Open your terminal to whatever folder you want to download this repo into. Then, do the following to download the repo: ```shell $ git clone https://github.com/Zeturic/bpre-trade-stuff.git $ cd bpre-trade-stuff -$ ./build_tools.sh ``` #### Adding your ROM diff --git a/build_tools.sh b/build_tools.sh deleted file mode 100644 index 2c5c9fa..0000000 --- a/build_tools.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -make -C tools/preproc $BUILD_TOOLS_TARGET diff --git a/makefile b/makefile index c6a478a..e77f31a 100644 --- a/makefile +++ b/makefile @@ -14,9 +14,9 @@ SRC_FILES ?= $(wildcard src/*.c) OBJ_FILES ?= $(SRC_FILES:src/%.c=build/src/%.o) MAIN_ASM_INCLUDES ?= $(wildcard *.s) -HEADER_DIRS ?= -I include -I gflib +CPPFLAGS ?= -I include -I gflib -CFLAGS = -O2 -mlong-calls -Wall -Wextra -mthumb -mno-thumb-interwork -fno-inline -fno-builtin -std=gnu11 -mabi=apcs-gnu -mcpu=arm7tdmi -march=armv4t -mtune=arm7tdmi -x c -c -MMD $(HEADER_DIRS) $(EXTRA_CFLAGS) +CFLAGS = -O2 -mlong-calls -Wall -Wextra -mthumb -mno-thumb-interwork -fno-inline -fno-builtin -std=gnu11 -mabi=apcs-gnu -mcpu=arm7tdmi -march=armv4t -mtune=arm7tdmi -x c -c -MMD $(CPPFLAGS) $(EXTRA_CFLAGS) LD = $(PREFIX)ld LDFLAGS = --relocatable -T rom.ld $(EXTRA_LDFLAGS) @@ -24,7 +24,7 @@ LDFLAGS = --relocatable -T rom.ld $(EXTRA_LDFLAGS) SIZE = $(PREFIX)size SIZEFLAGS = -d -B -PREPROC ?= tools/preproc/preproc +PRET_PREPROC ?= pret-preproc ARMIPS ?= armips ARMIPS_FLAGS = -sym test.sym $(EXTRA_ARMIPS_FLAGS) @@ -37,18 +37,13 @@ FREESIAFLAGS = --rom rom.gba --start-at $(START_AT) .DEFAULT_GOAL = all -.PHONY: all spotless clean clean-tools md5 +.PHONY: all clean md5 all: test.gba -spotless: clean clean-tools - clean: rm -rf build test.gba test.sym $(CLEANABLE_FILES) -clean-tools: - +BUILD_TOOLS_TARGET=clean ./build_tools.sh - md5: test.gba @md5sum test.gba @@ -62,7 +57,7 @@ build/linked.alloc: rom.gba build/linked.sz build/src/%.o: src/%.c charmap.txt @mkdir -p build/src - (echo '#line 1 "$<"' && $(PREPROC) "$<" charmap.txt) | $(CC) $(CFLAGS) -MF "$(@:%.o=%.d)" -MT "$@" -o "$@" - + (echo '#line 1 "$<"' && $(PRET_PREPROC) "$<" charmap.txt) | $(CC) $(CFLAGS) -MF "$(@:%.o=%.d)" -MT "$@" -o "$@" - build/linked.o: $(OBJ_FILES) rom.ld @mkdir -p build