Mercurial > repos > blastem
comparison Makefile @ 1842:49f65d240299 mame_interp
Merge from default
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 14 Apr 2019 23:38:02 -0700 |
parents | 0c6d07f91346 37afb9cf58be |
children | 374a5ae694e8 |
comparison
equal
deleted
inserted
replaced
1787:0c6d07f91346 | 1842:49f65d240299 |
---|---|
1 #disable built-in rules | |
2 .SUFFIXES : | |
3 | |
1 ifndef OS | 4 ifndef OS |
2 OS:=$(shell uname -s) | 5 OS:=$(shell uname -s) |
3 endif | 6 endif |
4 FIXUP:=true | 7 FIXUP:=true |
5 | 8 |
9 BUNDLED_LIBZ:=zlib/adler32.o zlib/compress.o zlib/crc32.o zlib/deflate.o zlib/gzclose.o zlib/gzlib.o zlib/gzread.o\ | |
10 zlib/gzwrite.o zlib/infback.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o zlib/uncompr.o zlib/zutil.o | |
11 | |
6 ifeq ($(OS),Windows) | 12 ifeq ($(OS),Windows) |
7 ifndef SDL2_PREFIX | 13 |
8 SDL2_PREFIX:="sdl/i686-w64-mingw32" | |
9 endif | |
10 ifndef GLEW_PREFIX | |
11 GLEW_PREFIX:=glew | 14 GLEW_PREFIX:=glew |
12 endif | |
13 ifndef GLEW32S_LIB | |
14 GLEW32S_LIB:=$(GLEW_PREFIX)/lib/Release/Win32/glew32s.lib | |
15 endif | |
16 | |
17 MEM:=mem_win.o | 15 MEM:=mem_win.o |
18 TERMINAL:=terminal_win.o | 16 TERMINAL:=terminal_win.o |
19 FONT:=nuklear_ui/font_win.o | 17 FONT:=nuklear_ui/font_win.o |
20 NET:=net_win.o | 18 NET:=net_win.o |
21 EXE:=.exe | 19 EXE:=.exe |
20 SO:=dll | |
21 CPU:=i686 | |
22 ifeq ($(CPU),i686) | |
22 CC:=i686-w64-mingw32-gcc-win32 | 23 CC:=i686-w64-mingw32-gcc-win32 |
23 CFLAGS:=-std=gnu99 -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration -I"$(SDL2_PREFIX)/include/SDL2" -I"$(GLEW_PREFIX)/include" -DGLEW_STATIC | 24 WINDRES:=i686-w64-mingw32-windres |
24 LDFLAGS:= $(GLEW32S_LIB) -L"$(SDL2_PREFIX)/lib" -lm -lmingw32 -lSDL2main -lSDL2 -lws2_32 -lopengl32 -lglu32 -mwindows | 25 GLUDIR:=Win32 |
25 CPU:=i686 | 26 SDL2_PREFIX:="sdl/i686-w64-mingw32" |
27 else | |
28 CC:=x86_64-w64-mingw32-gcc-win32 | |
29 WINDRES:=x86_64-w64-mingw32-windres | |
30 SDL2_PREFIX:="sdl/x86_64-w64-mingw32" | |
31 GLUDIR:=x64 | |
32 endif | |
33 GLEW32S_LIB:=$(GLEW_PREFIX)/lib/Release/$(GLUDIR)/glew32s.lib | |
34 CFLAGS:=-std=gnu99 -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration | |
35 LDFLAGS:=-lm -lmingw32 -lws2_32 -mwindows | |
36 ifneq ($(MAKECMDGOALS),libblastem.dll) | |
37 CFLAGS+= -I"$(SDL2_PREFIX)/include/SDL2" -I"$(GLEW_PREFIX)/include" -DGLEW_STATIC | |
38 LDFLAGS+= $(GLEW32S_LIB) -L"$(SDL2_PREFIX)/lib" -lSDL2main -lSDL2 -lopengl32 -lglu32 | |
39 endif | |
40 LIBZOBJS=$(BUNDLED_LIBZ) | |
26 | 41 |
27 else | 42 else |
28 | 43 |
29 MEM:=mem.o | 44 MEM:=mem.o |
30 TERMINAL:=terminal.o | 45 TERMINAL:=terminal.o |
35 CFLAGS:=-std=gnu99 -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration -Wno-unused-value $(HAS_PROC) -DHAVE_UNISTD_H | 50 CFLAGS:=-std=gnu99 -Wreturn-type -Werror=return-type -Werror=implicit-function-declaration -Wno-unused-value $(HAS_PROC) -DHAVE_UNISTD_H |
36 | 51 |
37 ifeq ($(OS),Darwin) | 52 ifeq ($(OS),Darwin) |
38 LIBS=sdl2 glew | 53 LIBS=sdl2 glew |
39 FONT:=nuklear_ui/font_mac.o | 54 FONT:=nuklear_ui/font_mac.o |
40 else | 55 SO:=dylib |
56 else | |
57 SO:=so | |
41 | 58 |
42 ifdef USE_FBDEV | 59 ifdef USE_FBDEV |
43 LIBS=alsa | 60 LIBS=alsa |
44 ifndef NOGL | 61 ifndef NOGL |
45 LIBS+=glesv2 egl | 62 LIBS+=glesv2 egl |
62 | 79 |
63 ifdef HOST_ZLIB | 80 ifdef HOST_ZLIB |
64 LIBS+= zlib | 81 LIBS+= zlib |
65 LIBZOBJS= | 82 LIBZOBJS= |
66 else | 83 else |
67 LIBZOBJS=zlib/adler32.o zlib/compress.o zlib/crc32.o zlib/deflate.o zlib/gzclose.o zlib/gzlib.o zlib/gzread.o\ | 84 LIBZOBJS=$(BUNDLED_LIBZ) |
68 zlib/gzwrite.o zlib/infback.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o zlib/uncompr.o zlib/zutil.o | |
69 endif | 85 endif |
70 | 86 |
71 ifeq ($(OS),Darwin) | 87 ifeq ($(OS),Darwin) |
72 #This should really be based on whether or not the C compiler is clang rather than based on the OS | 88 #This should really be based on whether or not the C compiler is clang rather than based on the OS |
73 CFLAGS+= -Wno-logical-op-parentheses | 89 CFLAGS+= -Wno-logical-op-parentheses |
94 LDFLAGS+= $(shell pkg-config --libs gl) | 110 LDFLAGS+= $(shell pkg-config --libs gl) |
95 endif | 111 endif |
96 endif #Darwin | 112 endif #Darwin |
97 | 113 |
98 else | 114 else |
99 ifeq ($(MAKECMDGOALS),libblastem.so) | 115 ifeq ($(MAKECMDGOALS),libblastem.$(SO)) |
100 LDFLAGS:=-lm | 116 LDFLAGS:=-lm |
101 else | 117 else |
102 CFLAGS:=$(shell pkg-config --cflags-only-I $(LIBS)) $(CFLAGS) | 118 CFLAGS:=$(shell pkg-config --cflags-only-I $(LIBS)) $(CFLAGS) |
103 LDFLAGS:=-lm $(shell pkg-config --libs $(LIBS)) $(GLES_LIB) | 119 LDFLAGS:=-lm $(shell pkg-config --libs $(LIBS)) $(GLES_LIB) |
104 ifdef USE_FBDEV | 120 ifdef USE_FBDEV |
136 PROFFLAGS:= -Wl,--no-as-needed -lprofiler -Wl,--as-needed | 152 PROFFLAGS:= -Wl,--no-as-needed -lprofiler -Wl,--as-needed |
137 CFLAGS+= -g3 | 153 CFLAGS+= -g3 |
138 endif | 154 endif |
139 ifdef NOGL | 155 ifdef NOGL |
140 CFLAGS+= -DDISABLE_OPENGL | 156 CFLAGS+= -DDISABLE_OPENGL |
141 NONUKLEAR:=1 | |
142 endif | 157 endif |
143 | 158 |
144 ifdef M68030 | 159 ifdef M68030 |
145 CFLAGS+= -DM68030 | 160 CFLAGS+= -DM68030 |
146 endif | 161 endif |
202 #MAINOBJS=blastem.o system.o genesis.o debug.o gdb_remote.o vdp.o $(RENDEROBJS) io.o romdb.o hash.o menu.o xband.o | 217 #MAINOBJS=blastem.o system.o genesis.o debug.o gdb_remote.o vdp.o $(RENDEROBJS) io.o romdb.o hash.o menu.o xband.o |
203 MAINOBJS=blastem.o system.o genesis.o vdp.o $(RENDEROBJS) io.o romdb.o hash.o menu.o xband.o \ | 218 MAINOBJS=blastem.o system.o genesis.o vdp.o $(RENDEROBJS) io.o romdb.o hash.o menu.o xband.o \ |
204 realtec.o i2c.o nor.o sega_mapper.o multi_game.o megawifi.o $(NET) serialize.o $(TERMINAL) $(CONFIGOBJS) \ | 219 realtec.o i2c.o nor.o sega_mapper.o multi_game.o megawifi.o $(NET) serialize.o $(TERMINAL) $(CONFIGOBJS) \ |
205 $(M68KOBJS) $(TRANSOBJS) $(AUDIOOBJS) saves.o zip.o bindings.o jcart.o | 220 $(M68KOBJS) $(TRANSOBJS) $(AUDIOOBJS) saves.o zip.o bindings.o jcart.o |
206 | 221 |
207 LIBOBJS=libblastem.o system.o genesis.o debug.o gdb_remote.o vdp.o io.o romdb.o hash.o menu.o xband.o realtec.o \ | 222 LIBOBJS=libblastem.o system.o genesis.o debug.o gdb_remote.o vdp.o io.o romdb.o hash.o xband.o realtec.o \ |
208 i2c.o nor.o sega_mapper.o multi_game.o megawifi.o $(NET) serialize.o $(TERMINAL) $(CONFIGOBJS) gst.o \ | 223 i2c.o nor.o sega_mapper.o multi_game.o megawifi.o $(NET) serialize.o $(TERMINAL) $(CONFIGOBJS) gst.o \ |
209 $(M68KOBJS) $(TRANSOBJS) $(AUDIOOBJS) saves.o jcart.o | 224 $(M68KOBJS) $(TRANSOBJS) $(AUDIOOBJS) saves.o jcart.o rom.db.o |
210 | 225 |
211 ifdef NONUKLEAR | 226 ifdef NONUKLEAR |
212 CFLAGS+= -DDISABLE_NUKLEAR | 227 CFLAGS+= -DDISABLE_NUKLEAR |
213 else | 228 else |
214 MAINOBJS+= $(NUKLEAROBJS) | 229 MAINOBJS+= $(NUKLEAROBJS) |
248 ALL=dis$(EXE) zdis$(EXE) stateview$(EXE) vgmplay$(EXE) blastem$(EXE) | 263 ALL=dis$(EXE) zdis$(EXE) stateview$(EXE) vgmplay$(EXE) blastem$(EXE) |
249 ifneq ($(OS),Windows) | 264 ifneq ($(OS),Windows) |
250 ALL+= termhelper | 265 ALL+= termhelper |
251 endif | 266 endif |
252 | 267 |
253 ifeq ($(MAKECMDGOALS),libblastem.so) | 268 ifeq ($(MAKECMDGOALS),libblastem.$(SO)) |
254 CFLAGS+= -fpic -DIS_LIB | 269 CFLAGS+= -fpic -DIS_LIB |
255 endif | 270 endif |
256 | 271 |
257 all : $(ALL) | 272 all : $(ALL) |
258 | 273 |
259 libblastem.so : $(LIBOBJS) | 274 libblastem.$(SO) : $(LIBOBJS) |
260 $(CC) -shared -o $@ $^ $(LDFLAGS) | 275 $(CC) -shared -o $@ $^ $(LDFLAGS) |
261 | 276 |
262 blastem$(EXE) : $(MAINOBJS) | 277 blastem$(EXE) : $(MAINOBJS) |
263 $(CC) -o $@ $^ $(LDFLAGS) $(PROFFLAGS) | 278 $(CC) -o $@ $^ $(LDFLAGS) $(PROFFLAGS) |
264 $(FIXUP) ./$@ | 279 $(FIXUP) ./$@ |
265 | 280 |
266 blastjag$(EXE) : jaguar.o jag_video.o $(RENDEROBJS) serialize.o $(M68KOBJS) $(TRANSOBJS) $(CONFIGOBJS) | 281 blastjag$(EXE) : jaguar.o jag_video.o $(RENDEROBJS) serialize.o $(M68KOBJS) $(TRANSOBJS) $(CONFIGOBJS) |
267 $(CC) -o $@ $^ $(LDFLAGS) | 282 $(CC) -o $@ $^ $(LDFLAGS) |
268 | 283 |
284 termhelper : termhelper.o | |
285 $(CC) -o $@ $^ $(LDFLAGS) | |
286 | |
269 dis$(EXE) : dis.o 68kinst.o tern.o vos_program_module.o | 287 dis$(EXE) : dis.o 68kinst.o tern.o vos_program_module.o |
270 $(CC) -o $@ $^ $(OPT) | 288 $(CC) -o $@ $^ $(OPT) |
271 | 289 |
272 jagdis : jagdis.o jagcpu.o tern.o | 290 jagdis : jagdis.o jagcpu.o tern.o |
273 $(CC) -o $@ $^ | 291 $(CC) -o $@ $^ |
325 vos_prog_info : vos_prog_info.o vos_program_module.o | 343 vos_prog_info : vos_prog_info.o vos_program_module.o |
326 $(CC) -o vos_prog_info vos_prog_info.o vos_program_module.o | 344 $(CC) -o vos_prog_info vos_prog_info.o vos_program_module.o |
327 | 345 |
328 %.c : %.cpu cpu_dsl.py | 346 %.c : %.cpu cpu_dsl.py |
329 ./cpu_dsl.py -d goto $< > $@ | 347 ./cpu_dsl.py -d goto $< > $@ |
348 | |
349 %.db.c : %.db | |
350 sed $< -e 's/"/\\"/g' -e 's/^\(.*\)$$/"\1\\n"/' -e'1s/^\(.*\)$$/const char $(shell echo $< | tr '.' '_')_data[] = \1/' -e '$$s/^\(.*\)$$/\1;/' > $@ | |
330 | 351 |
331 %.o : %.S | 352 %.o : %.S |
332 $(CC) -c -o $@ $< | 353 $(CC) -c -o $@ $< |
333 | 354 |
334 %.o : %.c | 355 %.o : %.c |
347 vasmm68k_mot -Fbin -m68000 -no-opt -spaces -o $@ -L $@.list $< | 368 vasmm68k_mot -Fbin -m68000 -no-opt -spaces -o $@ -L $@.list $< |
348 | 369 |
349 %.bin : %.sz8 | 370 %.bin : %.sz8 |
350 vasmz80_mot -Fbin -spaces -o $@ $< | 371 vasmz80_mot -Fbin -spaces -o $@ $< |
351 res.o : blastem.rc | 372 res.o : blastem.rc |
352 i686-w64-mingw32-windres blastem.rc res.o | 373 $(WINDRES) blastem.rc res.o |
353 | 374 |
354 arrow.tiles : arrow.png | 375 arrow.tiles : arrow.png |
355 cursor.tiles : cursor.png | 376 cursor.tiles : cursor.png |
356 font_interlace_variable.tiles : font_interlace_variable.png | 377 font_interlace_variable.tiles : font_interlace_variable.png |
357 button.tiles : button.png | 378 button.tiles : button.png |