# Makefile    (GNU gold/Intel icpc/Intel ifort test case)

ifdef GOLD
USE_GOLD = 1
LD_PATH = /mnt/nobackup/bs/gold/bin
else
USE_GOLD = 0
LD_PATH = /usr/bin
endif

FC  = ifort -O0
CXX = icpc  -O0
LD =  icpc  -O0 -v -Qlocation,ld,$(LD_PATH)

.PHONY: versions check clean
versions:
	$(CXX) --version
	$(FC) --version
	$(LD) --version
	$(LD_PATH)/ld --version

check: test.bin
	./test.bin

test.bin: test.o TestClass.o fibo_cycle.o
	$(LD) -o $@ $^

test.o: CPPFLAGS = -DUSE_GOLD=$(USE_GOLD)
test.o: test.C TestClass.h Makefile

TestClass.o: TestClass.C TestClass.h fortran_subs.h
fibo_cycle.o: fibo_cycle.F

clean: 
	rm -fr *.o test.bin

# End of Makefile -----------------------------------------
