From 69f2911e04ffb1b19eef1fafb8c040af271f656e Mon Sep 17 00:00:00 2001 From: Tor Aamodt Date: Thu, 15 Jul 2010 18:09:46 -0800 Subject: creating branch for adding support for CUDA 3.x and Fermi [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6829] --- benchmarks/CUDA/CP/common/mk/rules.mk | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 benchmarks/CUDA/CP/common/mk/rules.mk (limited to 'benchmarks/CUDA/CP/common/mk/rules.mk') diff --git a/benchmarks/CUDA/CP/common/mk/rules.mk b/benchmarks/CUDA/CP/common/mk/rules.mk new file mode 100644 index 0000000..0e6304d --- /dev/null +++ b/benchmarks/CUDA/CP/common/mk/rules.mk @@ -0,0 +1,48 @@ +# (c) 2007 The Board of Trustees of the University of Illinois. + +# Rules common to all makefiles + +######################################## +# Environment variable check +######################################## + +# The second-last directory in the $(BUILDDIR) path +# must have the name "build". This reduces the risk of terrible +# accidents if paths are not set up correctly. +ifeq ("$(notdir $(BUILDDIR))", "") +$(error $$BUILDDIR is not set correctly) +endif + +ifneq ("$(notdir $(patsubst %/,%,$(dir $(BUILDDIR))))", "build") +$(error $$BUILDDIR is not set correctly) +endif + +######################################## +# Derived variables +######################################## + +OBJS = $(call INBUILDDIR,$(SRCDIR_OBJS)) + +######################################## +# Rules +######################################## + +clean : + rm -f $(BUILDDIR)/* + if [ -d $(BUILDDIR) ]; then rmdir $(BUILDDIR); fi + +ifeq ("$(LINK_MODE)","C") +$(BIN) : $(OBJS) + $(CC) $(LDFLAGS) $^ -o $@ $(LIBS) +endif + +$(BUILDDIR) : + mkdir $(BUILDDIR) + +$(BUILDDIR)/%.o : $(SRCDIR)/%.c + mkdir -p $(BUILDDIR) + $(CC) $(CFLAGS) -c $< -o $@ + +$(BUILDDIR)/%.o : $(SRCDIR)/%.cc + mkdir -p $(BUILDDIR) + $(CXX) $(CXXFLAGS) -c $< -o $@ -- cgit v1.3