-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
104 lines (81 loc) · 1.96 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# SMS Plus - Sega Master System / Game Gear emulator
# (c) 1998-2004 Charles MacDonald
# -DLSB_FIRST - Leave undefined for big-endian processors.
# -DALIGN_DWORD - Align 32-bit memory transfers
# -DDOS - Set when compiling the DOS version
CC = gcc
AS = nasm -f coff -O1
LDFLAGS =
FLAGS = -I. -Icpu -Idos -Isound -Iunzip \
-Werror -Wall \
-DLSB_FIRST -DX86_ASM -DDOS \
-O6 -mcpu=athlon -fomit-frame-pointer -ffast-math
LIBS = -lalleg -laudio -lz -lm
OBJ = obj/z80.oa \
obj/sms.o \
obj/pio.o \
obj/memz80.o \
obj/render.o \
obj/vdp.o \
obj/system.o \
obj/error.o
OBJ += obj/fileio.o \
obj/state.o \
obj/loadrom.o
OBJ += obj/ioapi.o \
obj/unzip.o
OBJ += obj/sound.o \
obj/sn76489.o \
obj/emu2413.o \
obj/ym2413.o \
obj/fmintf.o \
obj/stream.o
OBJ += obj/main.o \
obj/sealintf.o \
obj/config.o \
obj/expand.o \
obj/blur.o \
obj/blit.o \
obj/ui.o \
obj/video.o \
obj/input.o
EXE = sp.exe
all : $(EXE)
$(EXE) : $(OBJ)
$(CC) -o $(EXE) $(OBJ) $(LIBS) $(LDFLAGS)
obj/%.oa : cpu/%.c cpu/%.h
$(CC) -c $< -o $@ $(FLAGS)
obj/%.o : %.c %.h
$(CC) -c $< -o $@ $(FLAGS)
obj/%.o : dos/%.s
$(AS) $< -o $@
obj/%.o : sound/%.c sound/%.h
$(CC) -c $< -o $@ $(FLAGS)
obj/%.o : unzip/%.c unzip/%.h
$(CC) -c $< -o $@ $(FLAGS)
obj/%.o : cpu/%.c cpu/%.h
$(CC) -c $< -o $@ $(FLAGS)
obj/%.o : dos/%.c dos/%.h
$(CC) -c $< -o $@ $(FLAGS)
pack :
strip $(EXE)
upx -1 $(EXE)
clean :
rm -f obj/*.o
rm -f *.bak
rm -f *.exe
rm -f *.log
rm -f *.wav
rm -f *.zip
cleancpu :
rm -f obj/z80.oa
makedir :
mkdir obj
archive:
pk -dir -add -max \
-excl=rom -excl=src -excl=test -excl=zip \
-excl=obj -excl=doc -excl=bak -excl=out \
mdsrc.zip *.*
#
# end of makefile
#