# General Purpose Makefile 

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

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

all:  change

#primary object files
OBJ= change_o.o

CLIB = ../lib/libmuslib.a

clib $(CLIB): $(OBJ)
	ar rv $(CLIB) $(OBJ)
	ranlib $(CLIB)

# 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 chord change competence

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

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

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