#  Main body of the installation makefile for the GALAHAD BUILDSPEC package

#  Nick Gould, for GALAHAD productions
#  This version: 2024-01-13

#  include standard GALAHAD makefile definitions

include $(GALAHAD)/src/makedefs/definitions

#  compilation agenda

all: buildspec

#  buildspec package

buildspec_silent: $(OBJ)/buildspec
buildspec: $(OBJ)/buildspec
	@printf ' %-21s\n' "GALAHAD: buildspec package ($(PRECIS) $(SUCC)"

$(OBJ)/buildspec: ../buildspec/buildspec.F90
	@printf ' %-9s %-15s\t\t' "Compiling" "buildspec  "
	$(CP) ../buildspec/buildspec.F90 $(OBJ)/buildspec.F90
	cd $(OBJ) ; $(FORTRAN) -o buildspec $(RUNFFLAGS) buildspec.F90 \
          -lgalahad -L$(OBJ) $(DPREC) -I $(GALAHAD)/include
	rm $(OBJ)/*.F90
	@printf '[ OK ]\n'

#  book keeping

clean:
	@printf ' %-14s\t\t' \
          "Removing buildspec files"
	$(RM) $(OBJ)/buildspec
	@printf '[ OK ]\n'

cleanall:
	@printf ' %-14s\t\t' \
          "Removing all $(PRECIS) precision object and module files"
	$(RM) -r $(OBJ)/* $(MOD)/*
	@printf '[ OK ]\n'
