## soundio library and test file GNU makefile for linux.
##
## Programmer:    Craig Stuart Sapp <craig@ccrma.stanford.edu>
## Creation Date: Sun Jan 20 12:40:05 PST 2002
## Last Modified: Wed Jan 23 20:25:04 PST 2002
## Filename:      ...soundio/Makefile
##
## To run this makefile, type (without quotes) "make".
##


# Use LINUX  for linux computers
# Use VISUAL for Windows computers
# Use SUN    for Sun computers
OSTYPE = LINUX


INCDIR     = ./
LIBFILE    = libsoundio.a
LIBDIR     = ./
COMPILER   = g++
DEFINES    = $(addprefix -D,$(OSTYPE))
LIBFLAGS   = -Wall -c -g -O6 $(DEFINES) -I$(INCDIR)
PROGFLAGS  = -Wall -O6 $(DEFINES) -I$(INCDIR)


LIBFILES = FileIO.o Options.o Options_private.o SoundFileRead.o \
	   SoundFileWrite.o SoundHeader.o 

.PHONY: examples

#########################################################################

all:
	@echo "make library   = creates the soundio library file"
	@echo "make examples  = create test programs"
	@echo "make runtest   = write and then read a test soundfile"
	@echo "make clean     = remove object files"


library: $(LIBFILES)
	@echo Creating soundio library file for linux ...
	-rm -f $(LIBFILE)
	ar r $(LIBFILE) *.o 
	ranlib $(LIBFILE)

clean:
	rm -rf *.o

examples:
	(cd examples; make examples)

runtest: 

	(cd examples; make runtest)


# defining an explicit rule for object file dependencies
%.o : %.cpp
	$(COMPILER) $(LIBFLAGS) -o $(notdir $@) $<


