KERNEL_ARCHS = #KERNEL_ARCHS#

qcd-bench: qcd-bench.o $(KERNEL_ARCHS)
	#LD# #LDFLAGS# -o #EXECNAME# qcd-bench.o $(KERNEL_ARCHS) #LDLIBS#

kernel_A.a:
	cd kernel_A && gmake prep-#KA_PLATFORM# && gmake kernel

kernel_B.a:
	cd kernel_B && gmake kernel

kernel_C.a:
	cd kernel_C && make kernel

kernel_D.a:
	cd kernel_D && make kernel

kernel_E.a:
	cd kernel_E && gmake kernel

qcd-bench.o: qcd-bench.c
	#MPI_CC# #CFLAGS# -c -o qcd-bench.o qcd-bench.c

clean:
	cd kernel_A && gmake clobber
	cd kernel_B && make clean
	cd kernel_C && make clean
	cd kernel_D && make clean
	cd kernel_E && gmake clean
	#RM# -f qcd-bench.o qcd-bench
	#RM# -f $(KERNEL_ARCHS)

#nm -X64 *.a | grep ' T ' | cut -f 1 -d ' ' | sort > all.sort.dat 
#nm -X64 *.a | grep ' T ' | cut -f 1 -d ' ' | sort | sort -u > all.sort.unique.dat  
#diff all.sort.dat all.sort.unique.dat | grep '<' > doublicates.dat