inc=inc/ src=src/ obj=obj/ o=o DEBUG=-g -DDEBUG uname=$(strip $(shell uname -s)) ifeq ($(findstring MINGW32,$(uname)),MINGW32) WINDOWS=1 else WINDOWS=0 endif # # OpenAL location # Required component!! This library must be installed! # http://www.openal.org/ # DYNAMIC_OPENAL=1 ifeq ($(WINDOWS),0) openalinc=-I/usr/include/AL/ openallib= else openal=c:/sdks/OpenAL openalinc=-I$(openal)/Include/ openallib=-L$(openal)/libs/ endif # # OggVorbis support # Requires the Ogg and Vorbis headers and libraries be present. # http://www.vorbis.com/ # # Setting this to 1 enables the OggVorbis file reader module in the compiled # executable, and with DYNAMIC_VORBIS also set to 1, the vorbisfile DLL will # be loaded at run-time and not bound to the executable. # # The vorbis variable indicates the path to the vorbis SDK. # WITH_VORBIS=1 DYNAMIC_VORBIS=1 ifeq ($(WINDOWS),0) vorbisinc=#-I/usr/include/vorbis/ -I/usr/include/ogg/ vorbislib= else vorbis=c:/sdks/oggvorbis-win32sdk-1.0.1 vorbisinc=-I$(vorbis)/include/ vorbislib=-L$(vorbis)/lib/ endif # # FLAC support # Requires the FLAC headers and libraries be present. # http://flac.sourceforge.net/ # # See the vorbis entry for the meaning of these variables. # WITH_FLAC=0 DYNAMIC_FLAC=0 flac=c:/flac flacinc=$(flac)/include/ flaclib=$(flac)/bin/ # # libMAD MPEG audio support # Requires libMAD be available. # http://www.underbit.com/products/mad/ # # See the vorbis entry for the meaning of these variables. # WITH_MPEG=1 DYNAMIC_MPEG=1 ifeq ($(WINDOWS),0) libmadlib= libmadinc= else libmad=libmad-0.15.1b libmadlib=-L$(libmad)/.libs libmadinc=-I$(libmad) endif library=libjfaud.a libobjs=$(obj)main.$o $(obj)core.$o $(obj)fnhash.$o \ $(obj)alout.$o $(obj)cdaout.$o \ $(obj)buffer.$o $(obj)channel.$o $(obj)fx.$o \ $(obj)file.$o $(obj)file_midi.$o $(obj)file_voc.$o $(obj)file_vorbis.$o \ $(obj)file_wave.$o $(obj)file_mpeg.$o $(obj)file_kwv.$o \ $(obj)midiseq.$o ifeq ($(WINDOWS),0) libobjs+= $(obj)midiout_linux.$o else libobjs+= $(obj)midiout_win.$o endif CC=gcc CXX=g++ CFLAGS=$(DEBUG) -I$(src) -I$(inc) $(openalinc) #-Wall -W LIBS= ifeq ($(WINDOWS),1) LIBS+= -lwinmm else LIBS+= -ldl endif CFLAGS+= -DDYNAMIC_OPENAL=$(DYNAMIC_OPENAL) \ -DWITH_VORBIS=$(WITH_VORBIS) -DDYNAMIC_VORBIS=$(DYNAMIC_VORBIS) \ -DWITH_MPEG=$(WITH_MPEG) -DDYNAMIC_MPEG=$(DYNAMIC_MPEG) ifeq ($(DYNAMIC_OPENAL),0) LIBS+= $(openallib) ifeq ($(WINDOWS),1) LIBS+= OpenAL32.lib else LIBS+= -lopenal endif endif ifeq ($(WITH_VORBIS),1) ifeq ($(DYNAMIC_VORBIS),0) LIBS+= $(vorbislib) ifeq ($(WINDOWS),1) LIBS+= vorbisfile.lib else LIBS+= -lvorbisfile endif endif CFLAGS+= $(vorbisinc) endif ifeq ($(WITH_MPEG),1) ifeq ($(DYNAMIC_MPEG),0) LIBS+= $(libmadlib) ifeq ($(WINDOWS),1) LIBS+= -lmad else LIBS+= -lmad endif endif CFLAGS+= $(libmadinc) endif CXXFLAGS=$(CFLAGS) test.exe: $(obj)test.$o $(library) $(CXX) $(CFLAGS) -o $@ $^ $(LIBS) $(library): $(libobjs) ar rc $@ $^ $(obj)%.$o: $(src)%.c $(CC) $(CFLAGS) -c $< -o $@ 2>&1 $(obj)%.$o: $(src)%.cc $(CXX) $(CXXFLAGS) -c $< -o $@ clean: -rm -f $(libobjs) $(library) $(libobjs): $(inc)jfaud.h $(src)internal.h