-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.mingw
89 lines (69 loc) · 2.54 KB
/
Makefile.mingw
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
# Should be buildable with any gcc compiler under Windows
# MinGW, and the MinGW shipped with Dev-Cpp is known to work
# (when required libs like SDL, png, etc. are available)
#
# If mingw/cygwin is setup correctly, the linux makefile may be used.
#
# call C:\Dev-Cpp\setup_path.cmd
#
# make -B -f Makefile.mingw
# mingw32-make.exe -B -f Makefile.mingw
CC = gcc
LD = $(CC)
CFLAGS = -O3
LDFLAGS = -s
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 \
DEFS = -DIS_LITTLE_ENDIAN -DALT_PATH_SEP
INCS = -I$(GNUBOY) -I$(GNUBOY)/sys/sdl -I/usr/include/
LIBS = -lmingw32 -lSDLmain -lSDL
## Requirements for (optional) .zip support
## Disable with GNUBOY_USE_MINIZIP defined
OBJS += $(GNUBOY)/unzip/unzip.o $(GNUBOY)/unzip/ioapi.o
LIBS += -lz
# 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
# 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
# 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
DEFS += -DGNUBOY_NO_SCREENSHOT
MYCC = $(CC) $(CFLAGS) $(INCS) $(DEFS)
all: ohboy_ver.h ohboy
# FIXME need better dependency handling
menu.o: ohboy_ver.h
ohboy_ver.h:
call gen_ohboyver.bat > ohboy_ver.h
ohboy: $(OBJS)
$(LD) $(LDFLAGS) $(OBJS) -o $@ $(LIBS)
clean:
rm -f ohboy.exe *.o ubytegui/*.o $(GNUBOY)/*.o
$(GNUBOY)/main.o:
$(MYCC) -Dmain=gnuboy_main -c $(GNUBOY)/main.c -o $@
.c.o:
$(MYCC) -c $< -o $@