File: Makefile.sdl2

package info (click to toggle)
genesisplusgx 1.7.4%2Bgit20221128-2
  • links: PTS, VCS
  • area: non-free
  • in suites: sid, trixie
  • size: 16,716 kB
  • sloc: ansic: 111,869; makefile: 235; xml: 12; sh: 2
file content (227 lines) | stat: -rw-r--r-- 7,244 bytes parent folder | download | duplicates (2)
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227

# Makefile for genplus SDL2
#
# (c) 1999, 2000, 2001, 2002, 2003  Charles MacDonald
# modified by Eke-Eke <eke_eke31@yahoo.fr>
#
# Defines :
# -DLSB_FIRST : for little endian systems.
# -DLOGERROR  : enable message logging
# -DLOGVDP    : enable VDP debug messages
# -DLOGSOUND  : enable AUDIO debug messages
# -DLOG_SCD   : enable SCD debug messages
# -DLOG_CDD   : enable CDD debug messages
# -DLOG_CDC   : enable CDC debug messages
# -DLOG_PCM   : enable PCM debug messages
# -DLOGSOUND  : enable AUDIO debug messages
# -D8BPP_RENDERING  - configure for 8-bit pixels (RGB332)
# -D15BPP_RENDERING - configure for 15-bit pixels (RGB555)
# -D16BPP_RENDERING - configure for 16-bit pixels (RGB565)
# -D32BPP_RENDERING - configure for 32-bit pixels (RGB888)
# -DUSE_LIBCHDR      : enable CHD file support
# -DUSE_LIBTREMOR    : enable OGG file support for CD emulation using provided TREMOR library
# -DUSE_LIBVORBIS    : enable OGG file support for CD emulation using external VORBIS library
# -DISABLE_MANY_OGG_OPEN_FILES : only have one OGG file opened at once to save RAM
# -DMAXROMSIZE       : defines maximal size of ROM buffer (also shared with CD hardware)
# -DHAVE_YM3438_CORE : enable (configurable) support for Nuked cycle-accurate YM2612/YM3438 core
# -DHAVE_OPLL_CORE   : enable (configurable) support for Nuked cycle-accurate YM2413 core
# -DHOOK_CPU         : enable CPU hooks
# -DENABLE_SUB_68K_ADDRESS_ERROR_EXCEPTIONS : enable address error exceptions emulation for SUB-CPU

NAME	  = gen_sdl2

CC        = gcc
CFLAGS    = `sdl2-config --cflags` -march=native -O6 -fomit-frame-pointer -Wall -Wno-strict-aliasing -std=c99 -pedantic-errors
#-g -ggdb -pg
#-fomit-frame-pointer
#LDFLAGS   = -pg
DEFINES   = -DLSB_FIRST -DUSE_16BPP_RENDERING -DUSE_LIBTREMOR -DUSE_LIBCHDR -DMAXROMSIZE=33554432 -DHAVE_YM3438_CORE -DHAVE_OPLL_CORE -DENABLE_SUB_68K_ADDRESS_ERROR_EXCEPTIONS

ifneq ($(OS),Windows_NT)
DEFINES += -DHAVE_ALLOCA_H
endif

SRCDIR    = ../core
INCLUDES  = -I$(SRCDIR) -I$(SRCDIR)/z80 -I$(SRCDIR)/m68k -I$(SRCDIR)/sound -I$(SRCDIR)/input_hw -I$(SRCDIR)/cart_hw -I$(SRCDIR)/cart_hw/svp -I$(SRCDIR)/cd_hw -I$(SRCDIR)/ntsc -I$(SRCDIR)/tremor -I$(SRCDIR)/../sdl -I$(SRCDIR)/../sdl/sdl2
LIBS	  = `sdl2-config --libs` -lz -lm

CHDLIBDIR = $(SRCDIR)/cd_hw/libchdr

OBJDIR = ./build_sdl2

OBJECTS	=       $(OBJDIR)/z80.o	

OBJECTS	+=     	$(OBJDIR)/m68kcpu.o \
		$(OBJDIR)/s68kcpu.o

OBJECTS	+=     	$(OBJDIR)/genesis.o	 \
		$(OBJDIR)/vdp_ctrl.o	 \
		$(OBJDIR)/vdp_render.o   \
		$(OBJDIR)/system.o       \
		$(OBJDIR)/io_ctrl.o	 \
		$(OBJDIR)/mem68k.o	 \
		$(OBJDIR)/memz80.o	 \
		$(OBJDIR)/membnk.o	 \
		$(OBJDIR)/state.o        \
		$(OBJDIR)/loadrom.o	

OBJECTS	+=      $(OBJDIR)/input.o	  \
		$(OBJDIR)/gamepad.o	  \
		$(OBJDIR)/lightgun.o	  \
		$(OBJDIR)/mouse.o	  \
		$(OBJDIR)/activator.o	  \
		$(OBJDIR)/xe_1ap.o	  \
		$(OBJDIR)/teamplayer.o    \
		$(OBJDIR)/paddle.o	  \
		$(OBJDIR)/sportspad.o     \
		$(OBJDIR)/terebi_oekaki.o \
		$(OBJDIR)/graphic_board.o

OBJECTS	+=      $(OBJDIR)/sound.o	\
		$(OBJDIR)/psg.o         \
		$(OBJDIR)/ym2413.o      \
		$(OBJDIR)/opll.o        \
		$(OBJDIR)/ym3438.o      \
		$(OBJDIR)/ym2612.o    

OBJECTS	+=	$(OBJDIR)/blip_buf.o 

OBJECTS	+=	$(OBJDIR)/eq.o 

OBJECTS	+=      $(OBJDIR)/sram.o        \
		$(OBJDIR)/svp.o	        \
		$(OBJDIR)/ssp16.o       \
		$(OBJDIR)/ggenie.o      \
		$(OBJDIR)/areplay.o	\
		$(OBJDIR)/eeprom_93c.o  \
		$(OBJDIR)/eeprom_i2c.o  \
		$(OBJDIR)/eeprom_spi.o  \
		$(OBJDIR)/md_cart.o	\
		$(OBJDIR)/sms_cart.o	\
		$(OBJDIR)/megasd.o
		
OBJECTS	+=      $(OBJDIR)/scd.o	\
		$(OBJDIR)/cdd.o	\
		$(OBJDIR)/cdc.o	\
		$(OBJDIR)/gfx.o	\
		$(OBJDIR)/pcm.o	\
		$(OBJDIR)/cd_cart.o

OBJECTS	+=	$(OBJDIR)/sms_ntsc.o	\
		$(OBJDIR)/md_ntsc.o

OBJECTS	+=	$(OBJDIR)/main.o	\
		$(OBJDIR)/config.o	\
		$(OBJDIR)/error.o	\
		$(OBJDIR)/unzip.o       \
		$(OBJDIR)/fileio.o	

OBJECTS	+=	$(OBJDIR)/bitwise.o	 \
		$(OBJDIR)/block.o      \
		$(OBJDIR)/codebook.o   \
		$(OBJDIR)/floor0.o     \
		$(OBJDIR)/floor1.o     \
		$(OBJDIR)/framing.o    \
		$(OBJDIR)/info.o       \
		$(OBJDIR)/mapping0.o   \
		$(OBJDIR)/mdct.o       \
		$(OBJDIR)/registry.o   \
		$(OBJDIR)/res012.o     \
		$(OBJDIR)/sharedbook.o \
		$(OBJDIR)/synthesis.o  \
		$(OBJDIR)/vorbisfile.o \
		$(OBJDIR)/window.o

OBJECTS	+=	$(OBJDIR)/bitstream.o		\
		$(OBJDIR)/chd.o			\
		$(OBJDIR)/flac.o		\
		$(OBJDIR)/huffman.o		\
		$(OBJDIR)/bitmath.o		\
		$(OBJDIR)/bitreader.o		\
		$(OBJDIR)/cpu.o			\
 		$(OBJDIR)/crc.o			\
		$(OBJDIR)/fixed.o		\
		$(OBJDIR)/float.o		\
		$(OBJDIR)/format.o		\
		$(OBJDIR)/lpc.o			\
		$(OBJDIR)/md5.o			\
		$(OBJDIR)/memory.o		\
		$(OBJDIR)/stream_decoder.o	\
		$(OBJDIR)/LzFind.o		\
		$(OBJDIR)/LzmaDec.o		\
		$(OBJDIR)/LzmaEnc.o		\

ifeq ($(OS),Windows_NT)
OBJECTS	+=	$(OBJDIR)/icon.o
endif

all: $(NAME)

$(NAME): $(OBJDIR) $(OBJECTS)
		$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@

$(OBJDIR) :
		@[ -d $@ ] || mkdir -p $@
		
$(OBJDIR)/%.o : $(SRCDIR)/%.c $(SRCDIR)/%.h
		$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $< -o $@
	        	        
$(OBJDIR)/%.o :	$(SRCDIR)/sound/%.c $(SRCDIR)/sound/%.h	        
		$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $< -o $@

$(OBJDIR)/%.o :	$(SRCDIR)/input_hw/%.c $(SRCDIR)/input_hw/%.h	        
		$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $< -o $@

$(OBJDIR)/%.o :	$(SRCDIR)/cart_hw/%.c $(SRCDIR)/cart_hw/%.h	        
		$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $< -o $@

$(OBJDIR)/%.o :	$(SRCDIR)/cart_hw/svp/%.c      
		$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $< -o $@

$(OBJDIR)/%.o :	$(SRCDIR)/cart_hw/svp/%.c $(SRCDIR)/cart_hw/svp/%.h	        
		$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $< -o $@

$(OBJDIR)/%.o :	$(SRCDIR)/cd_hw/%.c $(SRCDIR)/cd_hw/%.h	        
		$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $< -o $@

$(OBJDIR)/%.o :	$(SRCDIR)/z80/%.c $(SRCDIR)/z80/%.h	        
		$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $< -o $@

$(OBJDIR)/%.o :	$(SRCDIR)/m68k/%.c       
		$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $< -o $@

$(OBJDIR)/%.o :	$(SRCDIR)/ntsc/%.c $(SRCDIR)/ntsc/%.h	        
		$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $< -o $@

$(OBJDIR)/%.o :	$(SRCDIR)/tremor/%.c $(SRCDIR)/tremor/%.h	        
		$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $< -o $@

$(OBJDIR)/%.o :	$(SRCDIR)/tremor/%.c 	        
		$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $< -o $@

$(OBJDIR)/%.o :	$(CHDLIBDIR)/src/%.c 	        
		$(CC) -c $(FLAGS) $(INCLUDES) -I$(CHDLIBDIR)/src -I$(CHDLIBDIR)/deps/libFLAC/include -I$(CHDLIBDIR)/deps/lzma -I$(CHDLIBDIR)/deps/zlib $< -o $@

$(OBJDIR)/%.o :	$(CHDLIBDIR)/deps/libFLAC/%.c 	        
		$(CC) -c $(FLAGS) -I$(CHDLIBDIR)/deps/libFLAC/include -DPACKAGE_VERSION=\"1.3.2\" -DFLAC_API_EXPORTS -DFLAC__HAS_OGG=0 -DHAVE_LROUND -DHAVE_STDINT_H -DHAVE_SYS_PARAM_H $< -o $@

$(OBJDIR)/%.o :	$(CHDLIBDIR)/deps/lzma/%.c 	        
		$(CC) -c $(FLAGS) -I$(CHDLIBDIR)/deps/lzma -D_7ZIP_ST $< -o $@

$(OBJDIR)/%.o :	$(SRCDIR)/../sdl/%.c $(SRCDIR)/../sdl/%.h	        
		$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $< -o $@

$(OBJDIR)/%.o :	$(SRCDIR)/../sdl/sdl2/%.c $(SRCDIR)/../sdl/sdl2/%.h	        
		$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $< -o $@

ifeq ($(OS),Windows_NT)
$(OBJDIR)/icon.o :	
		windres $(SRCDIR)/../sdl/icon.rc $@
endif

pack	:
		strip $(NAME)
		upx -9 $(NAME)	        

clean:
	rm -f $(OBJECTS) $(NAME)