# 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 : chord

#primary object files
OBJ= chord_net.o cfiles.o chord_util.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

#($OBJ) : $*.C

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

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

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

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


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





