# Makefile.countLoads # Will build an executables called lulesh2.0noopt and lulesh2.0opt using # llvm's opt program. # Specific to the -countLoads pass because linking in the countLoads.c file. .SUFFIXES: .cc .s LULESH_EXEC_NOOPT = lulesh2.0noopt LULESH_EXEC_OPT = lulesh2.0opt CLANG = clang -emit-llvm -O0 -DUSE_MPI=0 #LLVMOPT = opt -O3 LLVMOPT = opt -load LLVMPA1.so -countLoads SERCXX = g++ -DUSE_MPI=0 CXX = $(SERCXX) SOURCES2.0 = \ lulesh.cc \ lulesh-comm.cc \ lulesh-viz.cc \ lulesh-util.cc \ lulesh-init.cc ASSEMS2.0 = $(SOURCES2.0:.cc=.s) #Default build suggestions with OpenMP for g++ CXXFLAGS = -g -O3 -fopenmp -I. -Wall LDFLAGS = -g -O3 -fopenmp #For each source file create unoptimized and optimized llvm bitcode. %.bc: %.cc lulesh.h @echo "Building $<" $(CLANG) -c -o $*.bc $< %.s: %.bc lulesh.h @echo "Building $<" llc $*.bc all: $(LULESH_EXEC_NOOPT) $(LULESH_EXEC_OPT) $(LULESH_EXEC_NOOPT): $(ASSEMS2.0) @echo "Linking" $(CXX) $(ASSEMS2.0) $(LDFLAGS) -lm -o $@ $(LULESH_EXEC_OPT): $(ASSEMS2.0) $(CLANG) -c -o countLoads.bc countLoads.c llvm-link countLoads.bc lulesh.bc -S -o=lulesh.bc $(LLVMOPT) lulesh.bc -o lulesh.bc llc lulesh.bc @echo "Linking" $(CXX) $(ASSEMS2.0) $(LDFLAGS) -lm -o $@ clean: /bin/rm -f *.o *.s *.bc *~ $(OBJECTS) $(LULESH_EXEC_NOOPT) $(LULESH_EXEC_OPT) /bin/rm -rf *.dSYM