forked from Ninoh-FOX/ohboy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.opendingux
123 lines (95 loc) · 3.44 KB
/
Makefile.opendingux
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# OhBoy makefile
# Dingoo Open Dingux SDK - clach04
#
# NOTE! Requires DINGUX_SDK environment variable to be set to Open Dingux
# location (typically this is "/opt/opendingux-toolchain").
# make -f Makefile.opendingux clean
# make -f Makefile.opendingux
# make -f Makefile.opendingux clean all
TARGET = ohboy.a320
EXE_PREFIX = mipsel-linux-
CC = ${EXE_PREFIX}gcc
STRIP = ${EXE_PREFIX}strip
LD = $(CC)
CFLAGS = -O3 `${DINGUX_SDK}/usr/bin/sdl-config --cflags` -I${DINGUX_SDK}/usr/include/
LDFLAGS = -s
CFLAGS += -DDINGOO_BUILD -DDINGOO_OPENDINGUX
GNUBOY = ./gnuboy
OBJS = $(GNUBOY)/lcd.o $(GNUBOY)/refresh.o $(GNUBOY)/lcdc.o $(GNUBOY)/palette.o $(GNUBOY)/cpu.o $(GNUBOY)/mem.o \
$(GNUBOY)/rtc.o $(GNUBOY)/hw.o $(GNUBOY)/sound.o \
$(GNUBOY)/events.o $(GNUBOY)/keytable.o \
$(GNUBOY)/loader.o $(GNUBOY)/save.o $(GNUBOY)/debug.o $(GNUBOY)/emu.o \
$(GNUBOY)/main.o \
$(GNUBOY)/rccmds.o $(GNUBOY)/rckeys.o $(GNUBOY)/rcvars.o $(GNUBOY)/rcfile.o $(GNUBOY)/exports.o \
$(GNUBOY)/split.o $(GNUBOY)/path.o $(GNUBOY)/inflate.o \
$(GNUBOY)/sys/sdl/SFont.o \
gui_sdl.o keymap.o \
main.o menu.o \
./ubytegui/dialog.o ./ubytegui/font.o ./ubytegui/gui.o ./ubytegui/pixmap.o \
# $(GNUBOY)/sys/dingoo/main.oo
## NOTE inc paths are from TinyCore SDL-dev
DEFS = -DIS_LITTLE_ENDIAN -DALT_PATH_SEP
INCS = -I$(GNUBOY) -I$(GNUBOY)/sys/sdl
LIBS = -lc `${DINGUX_SDK}/usr/bin/sdl-config --libs`
# Use SDL_image - for use with SFont (rather than FREETYPE_TTF)
# NOTE can still use SFont without SDL_image
USE_SDL_IMAGE = True
ifdef USE_SDL_IMAGE
LIBS += -lSDL_image
DEFS += -DOHBOY_USE_SDL_IMAGE
endif
## Requirements for (optional) .zip support
## Disable with GNUBOY_USE_MINIZIP defined
OBJS += $(GNUBOY)/unzip/unzip.o $(GNUBOY)/unzip/ioapi.o
LIBS += -lz
############
# Simple disable sound support
# not as cleanly implemented as in core gnuboy as it
# still includes unused pcm/sound code... But it works :-)
#GNUBOY_DISABLE_SDL_SOUND = True
ifdef GNUBOY_DISABLE_SDL_SOUND
OBJS += $(GNUBOY)/sys/dummy/nosound.o
DEFS += -DGNUBOY_DISABLE_SDL_SOUND
endif
############
# USE_FREETYPE_TTF enables the use of Freetype2library (not SDL_ttf) and uses a ttf file at runtime
# quality of results on screen is excellent, if not set SFont is used.
# SFont can have excellent results but the bitmap font supplied at the moment is not pretty.
#USE_FREETYPE_TTF = True
ifdef USE_FREETYPE_TTF
INCS += -I/usr/include/freetype2/ -I/usr/include/freetype2/freetype
LIBS += -lfreetype
DEFS += -DUBYTE_USE_FREETYPE
endif
# USE_LIBPNG if set will use libpng AND attempt to load png file from "etc".
# if not set will use attempt to load bmp file "etc".
#USE_LIBPNG = True
ifdef USE_LIBPNG
DEFS += -DUBYTE_USE_LIBPNG
LIBS += -lpng
endif
#DEBUG_BUILD = true
ifdef DEBUG_BUILD
CFLAGS += -g
DO_STRIP =
else
DO_STRIP = ${STRIP} ${TARGET}
endif
DEFS += -DGNUBOY_NO_SCREENSHOT
MYCC = $(CC) $(CFLAGS) $(INCS) $(DEFS)
all: ohboy_ver.h $(TARGET)
# FIXME need better dependency handling
menu.o: ohboy_ver.h
ohboy_ver.h:
sh gen_ohboyver.sh > ohboy_ver.h
$(TARGET): $(OBJS)
$(LD) $(LDFLAGS) $(OBJS) -o $@ $(LIBS)
${DO_STRIP}
clean:
rm -f ohboy ohboy.exe *.o ubytegui/*.o $(GNUBOY)/*.o $(GNUBOY)/unzip/*.o $(GNUBOY)/sys/*/*.o $(APP_NAME).elf $(APP_NAME).bin $(APP_NAME).app $(APP_NAME).sim $(TARGET)
#$(GNUBOY)/sys/dingoo/main.o:
# $(MYCC) -Dmain=gnuboy_main -c $(GNUBOY)/sys/dingoo/main.c -o $@
$(GNUBOY)/main.o:
$(MYCC) -Dmain=gnuboy_main -c $(GNUBOY)/main.c -o $@
.c.o:
$(MYCC) -c $< -o $@