# Makefile for gtool4/gtview

include ../Config.mk

INCLUDE_GT=-I../src
LIBGT4=../src/libgtool4.a

TARGET=diffusion histtest

all: $(TARGET)

histtest: work.pcl histtest.o $(LIBGT4)
	$(FC) $(SYSFFLAGS) -o histtest histtest.o $(LIBGT4) $(LIBS) \
		$(SYSLDFLAGS) $(SYSLDLIBS)

diffusion: work.pcl diffusion.o $(LIBGT4)
	$(FC) $(SYSFFLAGS) -o diffusion diffusion.o $(LIBGT4) $(LIBS) \
		$(SYSLDFLAGS) $(SYSLDLIBS)

histtest.o: ../src/gtool_history.o
diffusion.o: ../src/gtool_history.o

work.pcl: Makefile ../Config.mk
	sh ../chkpcl.sh $(SYSFFLAGS) $(INCLUDE_GT)

$(LIBGT4):
	cd ../src; $(MAKE)

clear:
	-rm -f *.ps *.log *.nc

clean: clear
	-rm -f *.o $(MODS) $(TARGET) xdifs.* work.pc*

../gtview/gtool.nc:
	cd ../gtview; $(MAKE) gtool.nc

test: all ../gtview/gtool.nc
	sh gtattr.sh
	sh gtunary.sh
	sh gtavg.sh
	sh gtbinary.sh
	sh gtview.sh
	sh diffusion.sh
	sh histtest.sh

test-f: all ../gtview/gtool.nc
	-sh gtattr.sh
	-sh gtunary.sh
	-sh gtavg.sh
	-sh gtbinary.sh
	-sh gtview.sh
	-sh histtest.sh
	-sh diffusion.sh
