Skip to content

Commit ec73c00

Browse files
committed
sync
1 parent fa5ee17 commit ec73c00

2 files changed

Lines changed: 51 additions & 4 deletions

File tree

Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,16 @@ C_O_FILES := $(foreach file,$(C_FILES:.c=.o),$(BUILD_DIR)/$(file))
9191

9292
O_FILES := $(C_O_FILES) $(S_O_FILES) $(B_O_FILES)
9393

94+
DEP_FILES := $(C_O_FILES:.o=.d)
95+
9496
CRC := $(TOOLS_DIR)/n64crc
9597

9698
OPT_FLAGS = -O2
9799
LOOP_UNROLL =
98100

99101
MIPSISET = -mips2 -32
100102

101-
INCLUDE_CFLAGS = -I. -Iinclude -Isrc -I$(TOOLS_DIR)/ultralib/include
103+
INCLUDE_CFLAGS = -I. -Iinclude -Isrc -I$(TOOLS_DIR)/ultralib/include/compiler/ido -I$(TOOLS_DIR)/ultralib/include
102104

103105
ASFLAGS = -EB -mtune=vr4300 -march=vr4300 -mabi=32 -I include
104106
OBJCOPYFLAGS = -O binary
@@ -118,7 +120,7 @@ CFLAGS += $(DEFINES)
118120
CFLAGS += -woff 624,649,838,712,516,513,596,564,594,709,807
119121
CFLAGS += $(INCLUDE_CFLAGS)
120122

121-
CHECK_WARNINGS := -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wunused-function -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces -Wno-int-conversion
123+
CHECK_WARNINGS := -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wunused-function -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces -Wno-int-conversion -Wno-multichar
122124
CC_CHECK := $(GCC_HOST) -fsyntax-only -fno-builtin -fsigned-char -std=gnu90 -m32 $(CHECK_WARNINGS) $(INCLUDE_CFLAGS) $(DEFINES)
123125

124126
LD_FLAGS := -T $(LD_SCRIPT)
@@ -200,7 +202,7 @@ $(ROM_ELF): $(LD_SCRIPT) $(BUILD_DIR)/$(LIBULTRA) $(O_FILES) $(LANG_RNC_O_FILES)
200202
ifndef PERMUTER
201203
$(GLOBAL_ASM_O_FILES): $(BUILD_DIR)/%.o: %.c
202204
@printf "[$(YELLOW) syntax $(NO_COL)] $<\n"
203-
$(V)$(CC_CHECK) $<
205+
$(V)$(CC_CHECK) -MMD -MP -MT $@ -MF $(BUILD_DIR)/$*.d $<
204206
@printf "[$(GREEN) ido5.3 $(NO_COL)] $<\n"
205207
$(V)$(ASM_PROCESSOR) $(OPT_FLAGS) $< > $(BUILD_DIR)/$<
206208
$(V)$(CC) -c $(CFLAGS) $(OPT_FLAGS) $(LOOP_UNROLL) $(MIPSISET) -o $@ $(BUILD_DIR)/$<
@@ -211,7 +213,7 @@ endif
211213
# non asm-processor recipe
212214
$(BUILD_DIR)/%.o: %.c
213215
@printf "[$(YELLOW) syntax $(NO_COL)] $<\n"
214-
$(V)$(CC_CHECK) $<
216+
$(V)$(CC_CHECK) -MMD -MP -MT $@ -MF $(BUILD_DIR)/$*.d $<
215217
@printf "[$(GREEN) ido5.3 $(NO_COL)] $<\n"
216218
$(V)$(CC) -c $(CFLAGS) $(OPT_FLAGS) $(LOOP_UNROLL) $(MIPSISET) -o $@ $<
217219

@@ -245,6 +247,9 @@ $(SPLAT):
245247
@which git >/dev/null
246248
git submodule update --init --recursive
247249

250+
# include compiler generated dependency files
251+
-include $(DEP_FILES)
252+
248253
### Settings
249254
.SECONDARY:
250255
.PHONY: all clean default dirs expected verify no_verify

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,45 @@ The purpose of this project is to produce a reconstruction of the high-level sou
77
> [!IMPORTANT]
88
> This repository does not contain any game assets, assembly code, or other copyrighted materials.
99
> You must provide your own legally-obtained copy of the game in order to extract the assets necessary to build this repository.
10+
11+
## Development
12+
13+
### Git
14+
This repository uses Git submodules. Make sure to either clone the repository with the `--recurse-submodules` flag or to run `git submodule update --init --recursive` after the initial clone.
15+
16+
When pulling updates, you can update all submodules with `git submodule update --recursive`.
17+
18+
> Note: If you intend on developing inside of the Windows Subsystem for Linux (WSL), consider placing the repository on the WSL Linux partition. Builds are considerably slower when done on the Windows partition through WSL.
19+
20+
### Prerequisites
21+
22+
#### System packages
23+
24+
##### Linux / Windows Subsystem for Linux
25+
The following packages should be all you need to compile this project:
26+
- binutils-mips-linux-gnu
27+
- gcc
28+
- git
29+
- python3
30+
- python3-pip
31+
32+
#### Python3 packages / venv
33+
34+
```bash
35+
python3 -m venv .venv
36+
source ./.venv/bin/activate
37+
python3 -m pip install -r requirements.txt
38+
```
39+
40+
### Setup
41+
1. Place an unmodified Superman 64 ROM into the root of the repository as `baserom.us.z64` (SHA1SUM: `c271db752610c9581e1ba1e9125ea8ecdb56f74f`).
42+
2. Set up dependencies
43+
- `make dependencies`
44+
3. Init project
45+
- `make init`
46+
47+
### Rebuilding
48+
1. If any symbols or the splat config were changed, re-extract the ROM and rebuild the linker script:
49+
- `make extract`
50+
2. Rebuild the ROM:
51+
- `make -j`

0 commit comments

Comments
 (0)