# Makefile for compiling ComParser on IRIX, OSX and Linux. # Version 1.42, Pieter Suurmond, july 1, 2004. # This file is intended to be human-readable and configurations # should be carried out manually. #------------------------------------------------------------------------------- #### UNCOMMENT ONLY 1 OF THE FOLLOWING 4 BLOCKS: #### 1: SGI IRIX Indy R5000 - GCC #THINGS = ../CMP pd/comparser~.pd_irix6 #CC = gcc #LIBS = -lm -laudio -lmd #CFLAGS = -O3 -Wall #CFLAGS_PD = -mabi=n32 -DPD -DUNIX -DIRIX -DN32 -O3 -funroll-loops \ # -fomit-frame-pointer -Wall -W -Wshadow -Wstrict-prototypes \ # -Wno-unused -Wno-parentheses -Wno-switch -mips4 #### #### 2: SGI IRIX Indy R5000 - MIPSpro #THINGS = ../CMP pd/comparser~.pd_irix6 #CC = cc #LIBS = -lm -laudio -lmd #CFLAGS = -O3 -fullwarn #CFLAGS_PD = -n32 -DPD -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \ # -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -O3 #### #### 3: Mac OSX - GCC #THINGS = pd/comparser~.pd_darwin #CC = gcc #LIBS = -lm #CFLAGS = -O3 -Wall #CFLAGS_PD = -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \ # -Wno-unused -Wno-parentheses -Wno-switch -DMACOSX #### #### 4: Linux/x86, optimised for Petium-4 - GCC THINGS = pd/comparser~.pd_linux CC = gcc LIBS = -lm CFLAGS = -O3 -Wall CFLAGS_PD = -DPD -O2 -funroll-loops -fomit-frame-pointer -Wall -W \ -Wshadow -Wstrict-prototypes -Werror -Wno-unused -Wno-parentheses -Wno-switch #### #------------------------------------------------------------------------------- # What to build: all: $(THINGS) #------------------------------------------------------------------------------- # Explicit rules to enforce some objects to be built in their subdirectories. # Generic (platform independant) objects. aiff/CMP_aiff_read.o: aiff/CMP_aiff_read.c aiff/CMP_aiff_read.h aiff/CMP_aiff.h $(CC) $(CFLAGS) -c aiff/CMP_aiff_read.c -o aiff/CMP_aiff_read.o aiff/CMP_aiff_write.o: aiff/CMP_aiff_write.c aiff/CMP_aiff_write.h aiff/CMP_aiff.h $(CC) $(CFLAGS) -c aiff/CMP_aiff_write.c -o aiff/CMP_aiff_write.o aiff/CMP_aiff_info.o: aiff/CMP_aiff_info.c aiff/CMP_aiff.h $(CC) $(CFLAGS) -c aiff/CMP_aiff_info.c -o aiff/CMP_aiff_info.o console/CMP_handy.o: console/CMP_handy.c console/CMP_console.h $(CC) $(CFLAGS) -c console/CMP_handy.c -o console/CMP_handy.o fft/CMP_fft.o: fft/CMP_fft.c fft/CMP_fft.h $(CC) $(CFLAGS) -c fft/CMP_fft.c -o fft/CMP_fft.o gt/gt.o: gt/gt.h $(CC) $(CFLAGS) -c gt/gt.c -o gt/gt.o # IRIX specific objects (platform dependant). This will need adaption on other # platforms, but only if you want to compile the commandline-ComParser, the PD- # external doesn't need these I/O-objects. portaudio/pa_common/pa_lib.o: $(CC) $(CFLAGS) -c portaudio/pa_common/pa_lib.c -o portaudio/pa_common/pa_lib.o portaudio/pa_sgi/pa_sgi.o: $(CC) $(CFLAGS) -c portaudio/pa_sgi/pa_sgi.c -o portaudio/pa_sgi/pa_sgi.o midi/CMP_midi.o: midi/CMP_midi.c midi/CMP_midi.h $(CC) $(CFLAGS) -c midi/CMP_midi.c -o midi/CMP_midi.o midi/sgi_libmd/sgi_midi.o: $(CC) $(CFLAGS) -Imidi -c midi/sgi_libmd/sgi_midi.c -o midi/sgi_libmd/sgi_midi.o console/sgi_poll/CMP_sgi_console.o: $(CC) $(CFLAGS) -c console/sgi_poll/CMP_sgi_console.c -o console/sgi_poll/CMP_sgi_console.o #------------------------------------------------------------------------------- # Explicit rules for some objects that need to include files from subdirectories. CMP.o: CMP.c CMP.h $(CC) $(CFLAGS) -Iconsole -Iportaudio/pa_common -Iaiff -Imidi -c CMP.c -o CMP.o CMP_avalanche.o: CMP_avalanche.c CMP_avalanche.h $(CC) $(CFLAGS) -Iaiff -Igt -c CMP_avalanche.c -o CMP_avalanche.o CMP_audiorecord.o: CMP_audiorecord.c CMP_audiorecord.h $(CC) $(CFLAGS) -Iaiff -Iportaudio/pa_common -c CMP_audiorecord.c -o CMP_audiorecord.o CMP_prep.o: CMP_prep.c CMP_prep.h $(CC) $(CFLAGS) -Ifft -c CMP_prep.c -o CMP_prep.o CMP_portaudio.o: CMP_portaudio.c CMP_portaudio.h CMP_prep.h $(CC) $(CFLAGS) -Iportaudio/pa_common -c CMP_portaudio.c -o CMP_portaudio.o #------------------------------------------------------------------------------- # Objects for the standalone ComParser. OBJS = CMP.o \ CMP_audiorecord.o \ CMP_avalanche.o \ CMP_network.o \ CMP_portaudio.o \ CMP_prep.o \ aiff/CMP_aiff_info.o \ aiff/CMP_aiff_read.o \ aiff/CMP_aiff_write.o \ console/CMP_handy.o \ console/sgi_poll/CMP_sgi_console.o \ fft/CMP_fft.o \ gt/gt.o \ midi/CMP_midi.o \ midi/sgi_libmd/sgi_midi.o \ portaudio/pa_common/pa_lib.o \ portaudio/pa_sgi/pa_sgi.o # The standalone executable is built in the parent directory. ../CMP: $(OBJS) $(CC) $(CFLAGS) $(OBJS) $(LIBS) -o ../CMP strip ../CMP #------------------------------------------------------------------------------- # How to build the Pure Data externals. # Objects needed for the PD external. OBJS_PD = pd/CMP_pd.o CMP_network.o CMP_avalanche.o CMP_prep.o \ aiff/CMP_aiff_read.o aiff/CMP_aiff_info.o fft/CMP_fft.o gt/gt.o # -I./ because it needs to include headers from parent directory. pd/CMP_pd.o: pd/CMP_pd.c CMP.h $(CC) $(CFLAGS_PD) -I./ -o pd/CMP_pd.o -c pd/CMP_pd.c ### IRIX pd/comparser~.pd_irix6: $(OBJS_PD) ld -n32 -IPA -shared -rdata_shared -o pd/comparser~.pd_irix6 $(OBJS_PD) ### Mac OSX pd/comparser~.pd_darwin: $(OBJS_PD) $(CC) -bundle -undefined suppress -flat_namespace -o pd/comparser~.pd_darwin $(OBJS_PD) ### Linux x86 pd/comparser~.pd_linux: $(OBJS_PD) ld -export_dynamic -shared -o pd/comparser~.pd_linux $(OBJS_PD) -lc -lm strip --strip-unneeded pd/comparser~.pd_linux #------------------------------------------------------------------------------- # Only keep the sources. clean: -rm ../CMP $(OBJS) core -rm pd/comparser~.pd_irix6 pd/comparser~.pd_darwin pd/comparser~.pd_linux -rm $(OBJS_PD) so_locations #------------------------------------------------------------------------------- # Remove AppleTalk Xinet files (on IRIX). cleanAT: find ./ -name .HSancillary -print -ok rm {} \; find ./ -name .HSResource -print -ok rm -R {} \;