changeset 10:e3849cd10ad3 default tip

Build an intermediary fmgen.a archive.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 08 Sep 2014 17:44:53 +0200
parents 4e34698c666b
children
files Makefile fmgen.c pmdwin.h
diffstat 3 files changed, 10 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 CC = gcc
-CFLAGS += -Ifmgen -Wall -pipe -O2 -fno-math-errno -fno-omit-frame-pointer -fno-asynchronous-unwind-tables
-CXXFLAGS += -Ifmgen -Wall -Wno-write-strings -pipe -O2 -fno-math-errno -fno-exceptions -fno-rtti -fno-omit-frame-pointer -fno-asynchronous-unwind-tables
+CFLAGS += -Wall -pipe -O2 -fno-math-errno -fno-omit-frame-pointer -fno-asynchronous-unwind-tables
+CXXFLAGS += -Wall -Wno-write-strings -pipe -O2 -fno-math-errno -fno-exceptions -fno-rtti -fno-omit-frame-pointer -fno-asynchronous-unwind-tables
 
 # Uncomment exactly one of the following:
 AUDIO_DRV = oss_audio.o
@@ -10,16 +10,19 @@ AUDIO_DRV = oss_audio.o
 
 all: pmdwin libpmdwin.so
 %.o: %.c
-	$(CC) $(CFLAGS) -c $<
+	$(CC) $(CFLAGS) -c -o $@ $<
 
 %.o: %.cpp
-	$(CXX) $(CXXFLAGS) -c $<
+	$(CXX) $(CXXFLAGS) -c -o $@ $<
 
 clean:
-	$(RM) *.o pmdwin libpmdwin.so
+	$(RM) *.o fmgen/*.o libfmgen.a libpmdwin.a libpmdwin.so pmdwin
 
 pmdwin: pmd_play.o libpmdwin.so
 	$(CC) -L. -lpmdwin -o $@ pmd_play.o
 
-libpmdwin.so: pmdwin.o table.o lfg.o $(AUDIO_DRV) fmgen.o
+libfmgen.a: fmgen/e_expf.o fmgen/opna.o fmgen/psg.o fmgen/rhythmdata.o
+	$(AR) rc $@ $^
+
+libpmdwin.so: pmdwin.o table.o lfg.o $(AUDIO_DRV) libfmgen.a
 	$(CC) -shared -o $@ $^
deleted file mode 100644
--- a/fmgen.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "fmgen/e_expf.c"
-#include "fmgen/psg.c"
-#include "fmgen/rhythmdata.c"
-#include "fmgen/opna.c"
-
--- a/pmdwin.h
+++ b/pmdwin.h
@@ -10,7 +10,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <limits.h>
-#include "opna.h"
+#include "fmgen/opna.h"
 
 typedef unsigned char uchar;
 typedef unsigned short ushort;