# Change the following variable if you installed channelflow elsewhere
CHANNELDIR = /usr/local

# Define default C flags for optimized and debugging compilation
CFLAGS = -Wall -O2 -DNDEBUG
DCFLAGS = -Wall -g -O2 

# Define subdirectories of CHANNELDIR
INCLUDEDIR = -I$(CHANNELDIR)/include 
LIBS = -L$(CHANNELDIR)/lib -lchflow -lfftw3 -lm
DLIBS = -L$(CHANNELDIR)/lib -lchflowdebug -lfftw3 -lm 


# Make optimized executables from objects and libraries
%.x: %.o $(CHANNELDIR)/lib/libchflow.a
	g++ -o $@ $< $(OBJECTS) $(LIBS)

# Make optimized objects from source
%.o : %.cpp
	g++ $(CFLAGS) $(INCLUDEDIR) -c $< 


# Make debugging executables from objects and libraries
%.dx: %.do $(CHANNELDIR)/lib/libchflowdebug.a
	g++ -g -o $@ $< $(OBJECTS) $(DLIBS)

# Make debugging objects from source
%.do : %.cpp
	g++ $(DCFLAGS) $(INCLUDEDIR) -o $@ -c $< 

clean :
	rm *.o *.x *.do *.dx *.asc *.bf *.ff *~ 

