diff Makefile @ 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 ceda140f42fb
children
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 $@ $^