-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile.dj2
92 lines (72 loc) · 1.78 KB
/
makefile.dj2
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
# Genesis Plus - Sega Mega Drive emulator
# (c) 1999, 2000, 2001, 2002, 2003 Charles MacDonald
# -DLSB_FIRST - Leave undefined for big-endian processors.
# -DDOS - Enable DOS/x86 specific code.
# -DDEBUG - Enable debugging code
# -DX86_ASM - Enable inline x86 assembly code in Z80 emulator
# -DALIGN_LONG - Align longword reads and writes to memory
CC = gcc
AS = nasm -f coff
LDFLAGS =
FLAGS = -I. -Icpu -Idos -Isound \
-Werror -Wall \
-O6 -mcpu=pentium -fomit-frame-pointer \
-DLSB_FIRST -DX86_ASM -DDOS
LIBS = -lalleg -laudio -lz obj/m68k.oa
OBJ = obj/z80.oa \
obj/genesis.o \
obj/vdp.o \
obj/render.o \
obj/system.o \
obj/unzip.o \
obj/fileio.o \
obj/loadrom.o \
obj/io.o \
obj/mem68k.o \
obj/memz80.o \
obj/membnk.o \
obj/memvdp.o
OBJ += obj/sound.o \
obj/fm.o \
obj/sn76496.o
OBJ += obj/dos.o \
obj/sealintf.o \
obj/config.o \
obj/error.o
EXE = gen.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 : asm/%.s
$(AS) $< -o $@
obj/%.o : sound/%.c sound/%.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=test \
mdsrc.zip *.*
#
# end of makefile
#