# Next one is always good, but is not the default.  See Gnu make document.
.DELETE_ON_ERROR:
# Don't have right dependencies for brennermd.  Declare it phony so we
# regenerate it every time.
.PHONY: brennermd
# The code uses implicit declarations throughout, so -Wimplicit is no
# good.
# The compiler generates spurious notes about "unused variable
# 'cont'", so -Wunused is no good.
# -Wsurprising complains about -a*b, so that's no good.
# We need -fno-automatic, at least for kend in caguts.f.
# We mark mainFixed.f as non-writable because I keep accidentally
# editing it when I'm fixing bugs.
# -fbounds-check is good when debugging.
# Invoke perl explicitly to run fixinclude without any hint about what
# path to use.  This is most likely to work on a foreign system.
brennermd: main.f
	rm -f mainFixed.f
	perl fixinclude main.f . ../.. ../../Include ../Bond_Order ../Tight_Binding ../Lennard_Jones > mainFixed.f
	chmod ugo-w mainFixed.f
	@#For production:
	g77 -O2 -W -fno-automatic $(shell pwd)/mainFixed.f -o brennermd
	@#For debugging:
	@#g77 -g -fdebug-kludge -fbounds-check -W -fno-automatic $(shell pwd)/mainFixed.f -o brennermd

.PHONY: clean
clean:
	-rm brennermd 
	-rm -f mainFixed.f
