-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathMakefile
64 lines (46 loc) · 1.48 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
#######################################
# Base dir of your m68k gcc toolchain #
#######################################
BASEDIR = $(NEODEV)
AS = as
OBJC = objcopy
LD = gcc
#######################################
# Path to libraries and include files #
#######################################
INCDIR = src/
TMPDIR = $(BASEDIR)/tmp
###################################
# Output: {cart, cd} *lower case* #
###################################
OUTPUT = cart
############################
# Settings for cart output #
############################
ROMSIZE = 0x100000
PADBYTE = 0xff
##############################
# Object Files and Libraries #
##############################
OBJS = $(TMPDIR)/main.o $(TMPDIR)/math.o $(TMPDIR)/Palette.o $(TMPDIR)/Sound.o $(TMPDIR)/FixLay.o \
$(TMPDIR)/Sprites.o $(TMPDIR)/Object.o $(TMPDIR)/Title.o $(TMPDIR)/Backgroud.o \
$(TMPDIR)/Help.o $(TMPDIR)/Action.o $(TMPDIR)/20_effect.o
#####################
# Compilation Flags #
#####################
ASFLAGS = -m68000 --register-prefix-optional
LDFLAGS = -Wl,-Tneocart.x
CCFLAGS = -m68000 -O3 -Wall -fomit-frame-pointer -ffast-math -fno-builtin -nostartfiles -nodefaultlibs
##############
# Make rules #
##############
out.bin : test.o
$(OBJC) --gap-fill=$(PADBYTE) --pad-to=$(ROMSIZE) -R .data -O binary $< $@
test.o : $(OBJS)
$(LD) $(CCFLAGS) $(LDFLAGS) $(OBJS) -o $@
$(TMPDIR)/%.o: src/%.s
$(AS) -I$(INCDIR) $(ASFLAGS) $< -o $@
$(TMPDIR)/%.o: src/CH/%.s
$(AS) -I$(INCDIR) $(ASFLAGS) $< -o $@
clean:
rm -f $(TMPDIR)/*.*