Skip to content

Commit

Permalink
stop using scaninc
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeturic committed Sep 26, 2020
1 parent 2de4f9d commit f24fd99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion build_tools.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/sh

make -C tools/scaninc $BUILD_TOOLS_TARGET
make -C tools/preproc $BUILD_TOOLS_TARGET
11 changes: 3 additions & 8 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ MAIN_ASM_INCLUDES ?= $(wildcard *.s)

HEADER_DIRS ?= -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 $(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 $(HEADER_DIRS) $(EXTRA_CFLAGS)

LD = $(PREFIX)ld
LDFLAGS = --relocatable -T rom.ld $(EXTRA_LDFLAGS)
Expand All @@ -25,7 +25,6 @@ SIZE = $(PREFIX)size
SIZEFLAGS = -d -B

PREPROC ?= tools/preproc/preproc
SCANINC ?= tools/scaninc/scaninc

ARMIPS ?= armips
ARMIPS_FLAGS = -sym test.sym $(EXTRA_ARMIPS_FLAGS)
Expand Down Expand Up @@ -63,7 +62,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) -o "$@" -
(echo '#line 1 "$<"' && $(PREPROC) "$<" charmap.txt) | $(CC) $(CFLAGS) -MF "$(@:%.o=%.d)" -MT "$@" -o "$@" -

build/linked.o: $(OBJ_FILES) rom.ld
@mkdir -p build
Expand All @@ -72,8 +71,4 @@ build/linked.o: $(OBJ_FILES) rom.ld
test.gba: rom.gba main.asm build/linked.o build/linked.sz build/linked.alloc $(MAIN_ASM_INCLUDES)
$(ARMIPS) $(ARMIPS_FLAGS) main.asm -definelabel allocation $(shell cat build/linked.alloc) -equ allocation_size $(shell cat build/linked.sz)

build/dep/src/%.d: src/%.c
@mkdir -p build/dep/src
@$(SCANINC) $(HEADER_DIRS) $< | awk '{print "$(<:src/%.c=build/src/%.o) $@ : "$$0}' > "$@"

include $(SRC_FILES:src/%.c=build/dep/src/%.d)
-include $(SRC_FILES:src/%.c=build/src/%.d)

0 comments on commit f24fd99

Please sign in to comment.