-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (34 loc) · 1.3 KB
/
Makefile
File metadata and controls
51 lines (34 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# ML2 Makefile
# Currently this only builds the core
include mk/games.mk
VPATH = src/core/ $(GAMEDIR) $(GRDIR) $(MODDIR)
BINDIR := bin/$(GAME)/$(VERSION)
OBJDIR := obj/$(GAME)/$(VERSION)
# runtime
RUNTIME_OBJECTS = \
$(OBJDIR)/cxx_new_delete.o \
$(OBJDIR)/cxx_runtime.o \
$(OBJDIR)/sio.o
OBJS = $(RUNTIME_OBJECTS) \
$(OBJDIR)/main.o $(OBJDIR)/mod.o \
$(GAME_$(GAME)_$(VERSION)_OBJECTS)
include mk/ee.mk
CXXFLAGS += $(GAMEDEFS)
all: $(BINDIR)/ $(OBJDIR)/ $(OBJDIR)/vthook_generated.hpp $(BINDIR)/$(GAME_$(GAME)_$(VERSION)_PNACH)
clean:
rm -rf $(BINDIR)/ $(OBJDIR)/
$(OBJDIR)/vthook_generated.hpp: tools/vthook_template.jinja2 tools/generate_vthook.py
tools/generate_vthook.py $@
$(BINDIR)/$(GAME_$(GAME)_$(VERSION)_PNACH): $(BINDIR)/core.bin $(GAME_$(GAME)_$(VERSION)_PRODUCTS)
tools/pnach_utils/output_pnach.py $(GRDIR)/patch.json $@
$(BINDIR)/core.bin: $(BINDIR)/core.elf
$(OBJCOPY) -O binary $< $@
$(OBJDIR)/linktmp.ld: link/ml2core.ld $(GRDIR)/symbols.ld
cpp -P link/ml2core.ld -I$(GRDIR) -o $(OBJDIR)/linktmp.ld
# note that the linker script is preprocessed so that we can add game/region-specific definitions
$(BINDIR)/core.elf: $(OBJS) $(OBJDIR)/linktmp.ld
$(LD) -nostartfiles -T $(OBJDIR)/linktmp.ld $(EE_CRTBEGIN) $(OBJS) $(EE_CRTEND) -o $@
$(BINDIR)/:
mkdir -p $@
$(OBJDIR)/:
mkdir -p $@