mirror of
https://github.com/pmret/papermario.git
synced 2024-11-18 08:52:40 +01:00
watch includes
This commit is contained in:
parent
5ddfce7824
commit
5c6c5c0fe4
11
Makefile
11
Makefile
@ -6,6 +6,7 @@ BASEROM = baserom.z64
|
|||||||
TARGET = papermario
|
TARGET = papermario
|
||||||
COMPARE = 1
|
COMPARE = 1
|
||||||
NON_MATCHING = 0
|
NON_MATCHING = 0
|
||||||
|
WATCH_INCLUDES = 1
|
||||||
|
|
||||||
-include settings.mk
|
-include settings.mk
|
||||||
|
|
||||||
@ -57,7 +58,7 @@ CPP := cpp
|
|||||||
LD := $(CROSS)ld
|
LD := $(CROSS)ld
|
||||||
OBJCOPY := $(CROSS)objcopy
|
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
|
ASFLAGS := -EB -Iinclude -march=vr4300 -mtune=vr4300
|
||||||
OLDASFLAGS := -EB -Iinclude -G 0
|
OLDASFLAGS := -EB -Iinclude -G 0
|
||||||
CFLAGS := -O2 -quiet -G 0 -mcpu=vr4300 -mfix4300 -mips3 -mgp32 -mfp32 -Wimplicit -Wuninitialized -Wshadow
|
CFLAGS := -O2 -quiet -G 0 -mcpu=vr4300 -mfix4300 -mips3 -mgp32 -mfp32 -Wimplicit -Wuninitialized -Wshadow
|
||||||
@ -72,6 +73,10 @@ endif
|
|||||||
|
|
||||||
include sources.mk
|
include sources.mk
|
||||||
|
|
||||||
|
ifeq ($(WATCH_INCLUDES),1)
|
||||||
|
-include $(foreach $(obj), $(OBJECTS), $(BUILD_DIR)/$(obj).mk)
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
### Targets ###
|
### Targets ###
|
||||||
|
|
||||||
@ -126,12 +131,12 @@ $(BUILD_DIR)/%.Yay0.o: $(BUILD_DIR)/%.bin.Yay0
|
|||||||
# Compile C files
|
# Compile C files
|
||||||
$(BUILD_DIR)/%.c.o: %.c
|
$(BUILD_DIR)/%.c.o: %.c
|
||||||
@mkdir -p $(shell dirname $@)
|
@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)
|
# Compile C files (with DSL macros)
|
||||||
$(foreach cfile, $(DSL_C_FILES), $(BUILD_DIR)/$(cfile).o): $(BUILD_DIR)/%.c.o: %.c
|
$(foreach cfile, $(DSL_C_FILES), $(BUILD_DIR)/$(cfile).o): $(BUILD_DIR)/%.c.o: %.c
|
||||||
@mkdir -p $(shell dirname $@)
|
@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
|
# Assemble handwritten ASM
|
||||||
$(BUILD_DIR)/%.s.o: %.s
|
$(BUILD_DIR)/%.s.o: %.s
|
||||||
|
@ -54,12 +54,6 @@ We provide [windows_terminal.bat](tools/windows_terminal.bat) to open a [Windows
|
|||||||
|
|
||||||
### Rebuilding
|
### 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.
|
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
|
### Matching a function
|
||||||
|
@ -5,4 +5,4 @@ def apply(config, args):
|
|||||||
config['myimg'] = 'papermario.z64'
|
config['myimg'] = 'papermario.z64'
|
||||||
config['mapfile'] = 'build/papermario.map'
|
config['mapfile'] = 'build/papermario.map'
|
||||||
config['source_directories'] = ['.']
|
config['source_directories'] = ['.']
|
||||||
config['makeflags'] = ['COMPARE=0']
|
config['makeflags'] = ['COMPARE=0', 'WATCH_INCLUDES=0']
|
||||||
|
Loading…
Reference in New Issue
Block a user