diff Makefile @ 1818:243f3a7247f9

Include ROM DB in library binary for libretro target
author Mike Pavone <pavone@retrodev.com>
date Sun, 31 Mar 2019 12:37:28 -0700
parents a02b4ed940b6
children 8500bd987dda
line wrap: on
line diff
--- a/Makefile	Sun Mar 31 12:07:20 2019 -0700
+++ b/Makefile	Sun Mar 31 12:37:28 2019 -0700
@@ -1,3 +1,6 @@
+#disable built-in rules
+.SUFFIXES :
+
 ifndef OS
 OS:=$(shell uname -s)
 endif
@@ -203,7 +206,7 @@
 
 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 \
 	i2c.o nor.o sega_mapper.o multi_game.o megawifi.o $(NET) serialize.o $(TERMINAL) $(CONFIGOBJS) gst.o \
-	$(M68KOBJS) $(TRANSOBJS) $(AUDIOOBJS) saves.o jcart.o
+	$(M68KOBJS) $(TRANSOBJS) $(AUDIOOBJS) saves.o jcart.o rom.db.o
 	
 ifdef NONUKLEAR
 CFLAGS+= -DDISABLE_NUKLEAR
@@ -325,6 +328,9 @@
 %.c : %.cpu cpu_dsl.py
 	./cpu_dsl.py -d goto $< > $@
 
+%.db.c : %.db
+	sed $< -e 's/"/\\"/g' -e 's/^\(.*\)$$/"\1\\n"/' -e'1s/^\(.*\)$$/const char $(shell echo $< | tr '.' '_')_data[] = \1/' -e '$$s/^\(.*\)$$/\1;/' > $@
+
 %.o : %.S
 	$(CC) -c -o $@ $<