# MAKEFILE FOR ansi library.  (c) 2002 David MacKay

# add -O1 or -O2 to get more warnings enabled
# remove -O1 and -O2 to make kdbg debugger work nicely

CFLAGS = $(INCDIRS)  \
	-ansi -pedantic -g \
	-Wall -Wconversion\
	-Wformat  -Wshadow\
	-Wpointer-arith -Wcast-qual -Wwrite-strings\
	-D__USE_FIXED_PROTOTYPES__

LIBS = -l stdc++ -lm

#  -O2 -funroll-loops
#
# to profile    gprof opt2
# to not profile, remove -pg here and below. 
#
# to optimize add -O2 -funroll-loops

CXX = g++

.PHONY: clean
clean:
	rm *.o

test_function.o:	test_function.c test.h 

MakeWaves: MakeWaves.o utils.o
	$(CXX) $(CFLAGS) $(LIBS) MakeWaves.o utils.o  -o MakeWaves

%.o: %.cc
	$(CXX) -O2 $(CFLAGS)  $< -c -o $@
	$(CXX) $(CFLAGS)      $< -c -o $@

%: %.cc Makefile
	$(CXX) -O2 $(CFLAGS) $(LIBS) $< -o $@
	$(CXX) $(CFLAGS) $(LIBS) $< -o $@
