RTLIBDIRS = WAVETABLE CLAR COMBIT FMINST SCULPT STEREO WSHAPE METAFLUTE \
MULTICOMB AM AMINST IIR DEL1 DELAY PANECHO STRUM

CMIXLIBDIRS = clar combit fir fminst iir move multicomb noise place sculpt \
strum wah wahwah wow wavetable wshape metaflute trans am aminst pvoc rotate \
mrotate convolve gravy sgran vwavetable del1 delay panecho lpc flange

LIBDIRS = $(RTLIBDIRS) $(CMIXLIBDIRS) 

CMDDIRS = MIX

DIRT = *.o *.so so_locations

all:
	@for DIR in $(LIBDIRS) MIX; \
	do \
	( cd $$DIR; echo "making in $$DIR..."; \
	$(MAKE) $(MFLAGS); echo "done in $$DIR" ); \
	done

install:
	@for DIR in $(LIBDIRS); \
	do \
	( cd $$DIR; echo "making install in $$DIR..."; \
	ln -s ../insts/$$DIR/lib$$DIR.so $(LIBDESTDIR); ) \
	done
	@for DIR in $(LIBDIRS); \
	do \
	( cd $$DIR; echo "making install in $$DIR..."; \
	rm -f $(DESTDIR)/$$DIR; \
	ln -s ../insts/$$DIR/$$DIR $(DESTDIR); ) \
	done

clean:
	cd CLAR; rm -f $(DIRT) CLAR  
	cd COMBIT; rm -f $(DIRT) COMBIT  
	cd FMINST; rm -f $(DIRT) FMINST  
	cd MIX; rm -f -f $(DIRT) MIX  
	cd SCULPT; rm -f $(DIRT) SCULPT  
	cd STEREO; rm -f $(DIRT) STEREO
	cd STRUM; rm -f $(DIRT) STRUM  
	cd WAVETABLE; rm -f $(DIRT) WAVETABLE  
	cd WSHAPE; rm -f $(DIRT) WSH  
	cd METAFLUTE; rm -f $(DIRT) METAFLUTE
	cd MULTICOMB; rm -f $(DIRT) MULTICOMB
	cd AM; rm -f $(DIRT) AM
	cd AMINST; rm -f $(DIRT) AMINST
	cd IIR; rm -f $(DIRT) IIR
	cd DELAY; rm -f $(DIRT) DELAY
	cd DEL1; rm -f $(DIRT) DEL1
	cd PANECHO; rm -f $(DIRT) PANECHO
	cd clar; rm -f $(DIRT) clar  
	cd combit; rm -f $(DIRT) combit  
	cd fir; rm -f $(DIRT) fir  
	cd fminst; rm -f $(DIRT) fminst  
	cd flange; rm -f $(DIRT) flange
	cd iir; rm -f -f $(DIRT) iir  
	cd move; rm -f $(DIRT) move  
	cd multicomb; rm -f $(DIRT) multicomb  
	cd noise; rm -f $(DIRT) noise  
	cd place; rm -f $(DIRT) place  
	cd sculpt; rm -f $(DIRT) sculpt  
	cd strum; rm -f $(DIRT) strum  
	cd wah; rm -f $(DIRT) wah  
	cd wahwah; rm -f $(DIRT) wahwah  
	cd wow; rm -f $(DIRT) wow  
	cd wavetable; rm -f $(DIRT) wavetable  
	cd wshape; rm -f $(DIRT) wsh  
	cd metaflute; rm -f $(DIRT) metaflute
	cd trans; rm -f $(DIRT) trans
	cd am; rm -f $(DIRT) am
	cd aminst; rm -f $(DIRT) aminst
	cd pvoc; rm -f $(DIRT) pvoc
	cd rotate; rm -f $(DIRT) rotate
	cd mrotate; rm -f $(DIRT) mrotate
	cd convolve; rm -f $(DIRT) convolve
	cd gravy; rm -f $(DIRT) gravy
	cd sgran; rm -f $(DIRT) sgran
	cd vwavetable; rm -f $(DIRT) vwavetable
	cd del1; rm -f $(DIRT) del1
	cd delay; rm -f $(DIRT) delay
	cd panecho; rm -f $(DIRT) panecho
	cd lpc; rm -f $(DIRT) *lpcplay restorelpc restoreplot lpcscan \
			lpcplot merge ptrack stabilize lpc pchplot

