Skip to content

Commit

Permalink
use pret-preproc from PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeturic committed Sep 28, 2020
1 parent 007c16a commit 2bdf876
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions build_tools.sh

This file was deleted.

15 changes: 5 additions & 10 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ 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)

SIZE = $(PREFIX)size
SIZEFLAGS = -d -B

PREPROC ?= tools/preproc/preproc
PRET_PREPROC ?= pret-preproc

ARMIPS ?= armips
ARMIPS_FLAGS = -sym test.sym $(EXTRA_ARMIPS_FLAGS)
Expand All @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 2bdf876

Please sign in to comment.