PROGRAM  = $(BINDIR)/$(BENCHMARK).$(CLASS).x

# Class "U" is used internally by the setparams program to mean
# "unknown". This means that if you don't specify CLASS=
# on the command line, you'll get an error. It would be nice
# to be able to avoid this, but we'd have to get information
# from the setparams back to the make program, which isn't easy. 
CLASS=U

default:: ${PROGRAM}

# This makes sure the configuration utility setparams 
# is up to date. 
# Note that this must be run every time, which is why the
# target does not exist and is not created. 
# If you create a file called "config" you will break things. 
config:
	@cd ../sys; ${MAKE} all
	../sys/setparams ${BENCHMARK} ${CLASS}

# Normally setparams updates npbparams.h only if the settings (CLASS)
# have changed. However, we also want to update if the compile options
# may have changed (set in ../config/make.def).
npbparams.h: ../config/make.def
	@ echo make.def modified. Rebuilding npbparams.h just in case
	rm -f npbparams.h
	../sys/setparams ${BENCHMARK} ${CLASS}

# So that "make benchmark-name" works
${BENCHMARK}:  default
${BENCHMARKU}: default
