view 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 source

CC = gcc
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
# AUDIO_DRV = alsa_pcm_api.o
# CFLAGS += -DUSE_ALSA=1
# AUDIO_DRV = wave_out.o

all: pmdwin libpmdwin.so
%.o: %.c
	$(CC) $(CFLAGS) -c -o $@ $<

%.o: %.cpp
	$(CXX) $(CXXFLAGS) -c -o $@ $<

clean:
	$(RM) *.o fmgen/*.o libfmgen.a libpmdwin.a libpmdwin.so pmdwin

pmdwin: pmd_play.o libpmdwin.so
	$(CC) -L. -lpmdwin -o $@ pmd_play.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 $@ $^