watch includes

This commit is contained in:
Alex Bates 2020-10-28 21:34:04 +00:00
parent 5ddfce7824
commit 5c6c5c0fe4
No known key found for this signature in database
GPG Key ID: 5E11C2DB78877706
3 changed files with 9 additions and 10 deletions

View File

@ -6,6 +6,7 @@ BASEROM = baserom.z64
TARGET = papermario
COMPARE = 1
NON_MATCHING = 0
WATCH_INCLUDES = 1
-include settings.mk
@ -57,7 +58,7 @@ CPP := cpp
LD := $(CROSS)ld
OBJCOPY := $(CROSS)objcopy
CPPFLAGS := -Iinclude -Isrc -D _LANGUAGE_C -ffreestanding -DF3DEX_GBI_2 -D_MIPS_SZLONG=0 -Wundef -Wcomment
CPPFLAGS := -Iinclude -Isrc -D _LANGUAGE_C -ffreestanding -DF3DEX_GBI_2 -D_MIPS_SZLONG=0 -Wundef -Wcomment -MM -MP
ASFLAGS := -EB -Iinclude -march=vr4300 -mtune=vr4300
OLDASFLAGS := -EB -Iinclude -G 0
CFLAGS := -O2 -quiet -G 0 -mcpu=vr4300 -mfix4300 -mips3 -mgp32 -mfp32 -Wimplicit -Wuninitialized -Wshadow
@ -72,6 +73,10 @@ endif
include sources.mk
ifeq ($(WATCH_INCLUDES),1)
-include $(foreach $(obj), $(OBJECTS), $(BUILD_DIR)/$(obj).mk)
endif
### Targets ###
@ -126,12 +131,12 @@ $(BUILD_DIR)/%.Yay0.o: $(BUILD_DIR)/%.bin.Yay0
# Compile C files
$(BUILD_DIR)/%.c.o: %.c
@mkdir -p $(shell dirname $@)
$(CPP) $(CPPFLAGS) -o - $< | $(CC) $(CFLAGS) -o - - | $(OLD_AS) $(OLDASFLAGS) -o $@ -
$(CPP) $(CPPFLAGS) -MF $@.mk -MT $< -o - $< | $(CC) $(CFLAGS) -o - - | $(OLD_AS) $(OLDASFLAGS) -o $@ -
# Compile C files (with DSL macros)
$(foreach cfile, $(DSL_C_FILES), $(BUILD_DIR)/$(cfile).o): $(BUILD_DIR)/%.c.o: %.c
@mkdir -p $(shell dirname $@)
$(CPP) $(CPPFLAGS) -o - $< | tools/compile_dsl_macros.py | $(CC) $(CFLAGS) -o - - | $(OLD_AS) $(OLDASFLAGS) -o $@ -
$(CPP) $(CPPFLAGS) -MF $@.mk -MT $< -o - $< | tools/compile_dsl_macros.py | $(CC) $(CFLAGS) -o - - | $(OLD_AS) $(OLDASFLAGS) -o $@ -
# Assemble handwritten ASM
$(BUILD_DIR)/%.s.o: %.s

View File

@ -54,12 +54,6 @@ We provide [windows_terminal.bat](tools/windows_terminal.bat) to open a [Windows
### Rebuilding
Setting the `PM_HEADER_REBUILD` environment variable will cause `make` to rebuild all `.c` files whenever a `.h` file is modified.
```sh
$ PM_HEADER_REBUILD=1 make
```
If you use Visual Studio Code, you can use _Run Build Task_ (Ctrl+Shift+B) to run `make`. Any errors or warnings generated by the compiler will show up in the _Problems_ tab.
### Matching a function

View File

@ -5,4 +5,4 @@ def apply(config, args):
config['myimg'] = 'papermario.z64'
config['mapfile'] = 'build/papermario.map'
config['source_directories'] = ['.']
config['makeflags'] = ['COMPARE=0']
config['makeflags'] = ['COMPARE=0', 'WATCH_INCLUDES=0']