# Makefile for gt4frt

include ../Config.mk

TARGET=gt4

all: $(TARGET)frt $(TARGET)config

install: $(TARGET)frt
	test -d $(DEST_BIN) || install -d $(DEST_BIN)
	cp $(TARGET)frt $(DEST_BIN)
	cp $(TARGET)config $(DEST_BIN)

$(TARGET)frt: gt4frtgen.sh Makefile ../Config.mk
	@echo "Making shell script $(TARGET)frt"
	LIBNAME=gtool4 MODINSTDIR=$(DEST_INC) \
		LIBINSTDIR=$(DEST_LIB) \
		SYSLDFLAGS="$(SYSLDFLAGS)" \
		SYSLDLIBS="$(SYSLDLIBS)" \
		SYSFFLAGS="$(SYSFFLAGS)" \
		F90MODTYPE=$(F90MODTYPE) FC=$(FC) \
		sh ./gt4frtgen.sh $@
	chmod +x $(TARGET)frt

$(TARGET)config: gt4configgen.sh Makefile ../Config.mk
	@echo "Making shell script $(TARGET)config"
	LIBNAME=gtool4 MODINSTDIR=$(DEST_INC) \
		LIBINSTDIR=$(DEST_LIB) \
		SYSLDFLAGS="$(SYSLDFLAGS)" \
		SYSLDLIBS="$(SYSLDLIBS)" \
		SYSFFLAGS="$(SYSFFLAGS)" \
		F90MODTYPE=$(F90MODTYPE) FC=$(FC) \
		sh ./gt4configgen.sh $@
	chmod +x $(TARGET)config

clean:
	-rm -f *~ $(TARGET)frt $(TARGET)config

