# General Purpose Makefile 

# Put the program name (executable file) here
CC=g++-2.1

# find my other headers
INCLUDE= -I../note
# -O optimization -g debugging info
CFLAGS =   $(INCLUDE) -O # -g
LIBS = -L../lib -lmuslib


all : thresh beat


#primary object files
OBJ= beat_b.o

BLIB = ../lib/libmuslib.a

blib $(BLIB): $(OBJ)
	ar rv $(BLIB) $(OBJ)
	ranlib $(BLIB)

# Meta Rule for compiling .C extensions
# I have selected as C++ extension the .C one.
.cc.o :
	$(CC) $(CFLAGS) -c $*.cc

.C.o :
	$(CC) $(CFLAGS) -c $*.C


# stuff for the thresh competence

thresh.o : thresh.cc thresh.h 
	$(CC) $(CFLAGS) -c thresh.cc

thresh : thresh.o                # doesn't notice change in nlib!
	$(CC) -o $@ $(CFLAGS) $@.o $(LIBS)


# stuff for the beat competence

beat.o : beat.cc beat.h thresh.h
	$(CC) $(CFLAGS) -c beat.cc

beat_b.o : beat_b.cc beat.h 
	$(CC) $(CFLAGS) -c beat_b.cc

beat : beat.o $(BLIB)            # doesn't notice change in nlib or clib!
	$(CC) -o $@ $(CFLAGS) $@.o $(LIBS)
