# Makefile for gtool4/gtview

include ../Config.mk

TARGET=gtview
INCLUDE_GT=-I../src

all: $(TARGET)

install: $(TARGET)
	install -d $(DEST_BIN)
	install $(TARGET) $(DEST_BIN)

OBJS=$(TARGET).o ../src/libgtool4.a

$(TARGET): $(OBJS)
	$(FC) -o $(TARGET) $(SYSFFLAGS) $(OBJS) $(LIBS) $(SYSLDFLAGS) $(SYSLDLIBS)

$(TARGET).o: ../src/gtool.o work.pcl

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

../src/libgtool4.a:
	cd ../src; $(MAKE)

gtool.nc: gtool.cdl
	-ncgen -b gtool.cdl

clean:
	-rm -f *.o $(MODS) $(TARGET)
	-rm -rf gtview.plg Makefile.bak Debug/* work.pc* *.nc
