-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.bitbox
105 lines (67 loc) · 2.37 KB
/
Makefile.bitbox
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
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
CC = gcc
LD = $(CC)
AS = $(CC)
CFLAGS = -ansi -pedantic -Wall -Wno-implicit -Wno-long-long -O3 -g -fstrength-reduce -fexpensive-optimizations -fforce-addr -fdata-sections -ffunction-sections -fomit-frame-pointer
# NOTE if get; undefined reference to 'vid_screenshot'
# screen shot support is not in the port/backend.
# Add -DGNUBOY_NO_SCREENSHOT define below.
# SDL port includes screen shot support already.
CFLAGS += -DGNUBOY_NO_SCREENSHOT
# smaller noise rom in sound.c
CFLAGS += -DNO_NOISE15
# also used in Rules
CFLAGS += -DNO_PALETTE
CFLAGS += -DBITBOY_NOCGB
# gcc 4.x configure tends to default to '-ansi -pedantic'
# avoid warnings related to strdup()
CFLAGS += -D_XOPEN_SOURCE=500 -std=c99
LDFLAGS = $(CFLAGS) -Wl,--gc-sections
ASFLAGS = $(CFLAGS)
TARGETS = bitboy
ASM_OBJS =
SYS_DEFS = -DHAVE_CONFIG_H -DIS_LITTLE_ENDIAN -DIS_LINUX
#SYS_OBJS = sys/nix/nix.o $(ASM_OBJS)
SYS_INCS = -I/usr/local/include -I./sys/nix -I../lib
CFLAGS += -DGNUBOY_NO_MINIZIP
CFLAGS += -DGNUBOY_DISABLE_DEBUG_DISASSEMBLE
SDL_OBJS = sys/bitbox/bitbox.o
SDL_LIBS = -L/usr/lib/x86_64-linux-gnu -lSDL
SDL_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1
#-D_REENTRANT
all: $(TARGETS)
include Version
OBJS = refresh.o lcdc.o cpu.o mem.o rtc.o hw.o sound.o \
events.o \
loader.o save.o debug.o \
rccmds.o rckeys.o rcvars.o rcfile.o exports.o \
split.o path.o \
bitbox_lcd.o bitbox_emu.c ../lib/emulator.o \
roms.o menu.o tilemaps.c
ROMS = roms/tibet.gb roms/mario.gb roms/motocross.gb roms/megaman1.gb roms/qix.gb roms/drmario.gb roms/xenon2.gb
INCS = -I.
MYCC = $(CC) $(CFLAGS) $(INCS) $(SYS_INCS) $(SYS_DEFS)
MYAS = $(AS) $(ASFLAGS) $(INCS) $(SYS_INCS) $(SYS_DEFS)
#main.o: Version
roms.c: $(ROMS) mk_rom.py
./mk_rom.py $(ROMS) > roms.c
tilemaps.c: *.tmx mk_tilemaps.py
./mk_tilemaps.py tilemaps $<
.c.o:
$(MYCC) -c $< -o $@
.s.o:
$(MYAS) -c $< -o $@
bitboy: $(OBJS) $(SYS_OBJS) $(SDL_OBJS)
$(LD) $(LDFLAGS) $(OBJS) $(SYS_OBJS) $(SDL_OBJS) -o $@ $(SDL_LIBS)
# sys/sdl/sdl.o: sys/sdl/sdl.c
# $(MYCC) $(SDL_CFLAGS) -c $< -o $@
# sys/sdl/keymap.o: sys/sdl/keymap.c
# $(MYCC) $(SDL_CFLAGS) -c $< -o $@
# sys/sdl/SFont.o: sys/sdl/SFont.c
# $(MYCC) $(SDL_CFLAGS) -c $< -o $@
clean:
rm -f *gnuboy gmon.out *.o unzip/*.o sys/*.o sys/*/*.o asm/*/*.o roms.c
distclean: clean
rm -f config.* sys/nix/config.h Makefile