changeset 419:d1bf9734ce94

Cleanup makefile and link math library
author Mike Pavone <pavone@retrodev.com>
date Mon, 24 Jun 2013 21:30:38 -0700
parents dbf4e1c86f3c
children 9fb111b5641f
files Makefile
diffstat 1 files changed, 17 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Sun Jun 23 22:27:12 2013 -0700
+++ b/Makefile	Mon Jun 24 21:30:38 2013 -0700
@@ -5,10 +5,15 @@
 CFLAGS=-O2 -std=gnu99 `pkg-config --cflags-only-I $(LIBS)` -Wreturn-type -Werror=return-type
 endif
 
+TRANSOBJS=gen_x86.o x86_backend.o mem.o
+M68KOBJS=68kinst.o m68k_to_x86.o runtime.o
+Z80OBJS=z80inst.o z80_to_x86.o zruntime.o
+AUDIOOBJS=ym2612.o psg.o wave.o
+
 all : dis trans stateview blastem
 
-blastem : blastem.o 68kinst.o gen_x86.o m68k_to_x86.o z80inst.o z80_to_x86.o x86_backend.o runtime.o zruntime.o mem.o vdp.o ym2612.o psg.o render_sdl.o wave.o
-	$(CC) -ggdb -o blastem blastem.o 68kinst.o gen_x86.o m68k_to_x86.o z80inst.o z80_to_x86.o x86_backend.o runtime.o zruntime.o mem.o vdp.o ym2612.o psg.o render_sdl.o wave.o `pkg-config --libs $(LIBS)`
+blastem : blastem.o vdp.o render_sdl.o io.o $(M68KOBJS) $(Z80OBJS) $(TRANSOBJS) $(AUDIOOBJS)
+	$(CC) -ggdb -o blastem  blastem.o vdp.o render_sdl.o io.o $(M68KOBJS) $(Z80OBJS) $(TRANSOBJS) $(AUDIOOBJS) -lm `pkg-config --libs $(LIBS)`
 
 dis : dis.o 68kinst.o
 	$(CC) -o dis dis.o 68kinst.o
@@ -16,17 +21,17 @@
 zdis : zdis.o z80inst.o
 	$(CC) -o zdis zdis.o z80inst.o
 	
-libemu68k.a : 68kinst.o gen_x86.o m68k_to_x86.o x86_backend.o runtime.o mem.o
-	ar rcs libemu68k.a 68kinst.o gen_x86.o m68k_to_x86.o x86_backend.o runtime.o mem.o
+libemu68k.a : $(M68KOBJS) $(TRANSOBJS)
+	ar rcs libemu68k.a $(M68KOBJS) $(TRANSOBJS)
 	
-trans : trans.o 68kinst.o gen_x86.o m68k_to_x86.o x86_backend.o runtime.o mem.o
-	$(CC) -o trans trans.o 68kinst.o gen_x86.o m68k_to_x86.o x86_backend.o runtime.o mem.o
+trans : trans.o $(M68KOBJS) $(TRANSOBJS)
+	$(CC) -o trans trans.o $(M68KOBJS) $(TRANSOBJS)
 
-transz80 : transz80.o z80inst.o gen_x86.o z80_to_x86.o x86_backend.o zruntime.o mem.o
-	$(CC) -o transz80 transz80.o z80inst.o gen_x86.o z80_to_x86.o x86_backend.o zruntime.o mem.o
+transz80 : transz80.o $(Z80OBJS) $(TRANSOBJS)
+	$(CC) -o transz80 $(Z80OBJS) $(TRANSOBJS)
 
-ztestrun : ztestrun.o z80inst.o gen_x86.o z80_to_x86.o x86_backend.o zruntime.o mem.o
-	$(CC) -o ztestrun ztestrun.o z80inst.o gen_x86.o z80_to_x86.o x86_backend.o zruntime.o mem.o
+ztestrun : ztestrun.o $(Z80OBJS) $(TRANSOBJS)
+	$(CC) -o ztestrun $(Z80OBJS) $(TRANSOBJS)
 
 ztestgen : ztestgen.o z80inst.o
 	$(CC) -o ztestgen ztestgen.o z80inst.o
@@ -34,8 +39,8 @@
 stateview : stateview.o vdp.o render_sdl.o
 	$(CC) -o stateview stateview.o vdp.o render_sdl.o `pkg-config --libs $(LIBS)`
 
-vgmplay : vgmplay.o ym2612.o psg.o render_sdl.o wave.o
-	$(CC) -o vgmplay vgmplay.o ym2612.o psg.o render_sdl.o wave.o `pkg-config --libs $(LIBS)`
+vgmplay : vgmplay.o render_sdl.o $(AUDIOOBJS)
+	$(CC) -o vgmplay vgmplay.o render_sdl.o $(AUDIOOBJS) `pkg-config --libs $(LIBS)`
 
 test_x86 : test_x86.o gen_x86.o
 	$(CC) -o test_x86 test_x86.o gen_x86.o