forked from Herringway/ebsrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (50 loc) · 1.53 KB
/
Makefile
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
all: earthbound
.SUFFIXES:
%: %,v
%: RCS/%,v
%: RCS/%
%: s.%
%: SCCS/s.%
CA65FLAGS = -t none --cpu 65816 --bin-include-dir src --include-dir src
LD65FLAGS = -C snes.cfg
.PHONY: earthbound proto19950327 mother2 depsjp depsusa depsusaproto extract extractproto extractjp
JPSRCDIR = src/bankconfig/JP
USSRCDIR = src/bankconfig/US
USPROTOSRCDIR = src/bankconfig/US19950327
earthbound: depsusa earthbound.sfc
proto19950327: depsusaproto earthbound-1995-03-27.sfc
mother2: depsjp mother2.sfc
ifeq ($(MAKECMDGOALS),mother2)
CA65FLAGS += -D JPN
include $(wildcard $(JPSRCDIR)/*.dep)
else ifeq ($(MAKECMDGOALS),proto19950327)
CA65FLAGS += -D USA -D PROTOTYPE19950327
include $(wildcard $(USPROTOSRCDIR)/*.dep)
else
CA65FLAGS += -D USA
include $(wildcard $(USSRCDIR)/*.dep)
endif
JPSRCS = $(wildcard $(JPSRCDIR)/*.asm)
USSRCS = $(wildcard $(USSRCDIR)/*.asm)
USPROTOSRCS = $(wildcard $(USPROTOSRCDIR)/*.asm)
%.dep: %.asm
ca65 $(CA65FLAGS) --create-dep "$@" "$<"
mother2.sfc: $(patsubst %.asm, %.o, $(JPSRCS))
ld65 $(LD65FLAGS) -o "$@" $^
earthbound.sfc: $(patsubst %.asm, %.o, $(USSRCS))
ld65 $(LD65FLAGS) -o "$@" $^
earthbound-1995-03-27.sfc: $(patsubst %.asm, %.o, $(USPROTOSRCS))
ld65 $(LD65FLAGS) -o "$@" $^
depsjp: $(JPSRCS:.asm=.dep)
depsusa: $(USSRCS:.asm=.dep)
depsusaproto: $(USPROTOSRCS:.asm=.dep)
extract:
ebbinex "earthbound.yml" "donor.sfc"
extractproto:
ebbinex "earthbound-1995-03-27.yml" "donor-1995-03-27.sfc"
extractjp:
ebbinex "mother2.yml" "donorm2.sfc"
%.o: %.asm
ca65 $(CA65FLAGS) -o "$@" "$<"
%.bin: %.uncompressed
inhal -n $< $@