From 5d69aa95a9ea9ac326c34c4842b87e8123a77186 Mon Sep 17 00:00:00 2001 From: Tim Rogers Date: Tue, 25 Jun 2013 13:19:58 -0800 Subject: Changing the make flow so all the generated files, both object and code generated go in a directory independent of the source directory [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 16503] --- libopencl/Makefile | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'libopencl') diff --git a/libopencl/Makefile b/libopencl/Makefile index d597a0d..f849225 100644 --- a/libopencl/Makefile +++ b/libopencl/Makefile @@ -87,28 +87,27 @@ CCFLAGS += -DCUDART_VERSION=$(CUDART_VERSION) .PHONY: clean -OUTPUT_DIR=../$(SIM_OBJ_FILES_DIR)/libopencl +OUTPUT_DIR=$(SIM_OBJ_FILES_DIR)/libopencl OBJS = $(CXX_SRCS:%.cc=$(OUTPUT_DIR)/%.o) #--- Make rules --- -all: lib$(PROG).a nvopencl_wrapper +all: lib$(PROG).a $(OUTPUT_DIR)/nvopencl_wrapper lib$(PROG).a: $(OBJS) ar rcs $(OUTPUT_DIR)/lib$(PROG).a $(OBJS) -Makefile.makedepend: depend +$(OUTPUT_DIR)/Makefile.makedepend: depend depend: - touch Makefile.makedepend - makedepend -fMakefile.makedepend -p$(OUTPUT_DIR)/ $(CXX_SRCS) 2> /dev/null + touch $(OUTPUT_DIR)/Makefile.makedepend + makedepend -f$(OUTPUT_DIR)/Makefile.makedepend -p$(OUTPUT_DIR)/ $(CXX_SRCS) 2> /dev/null -nvopencl_wrapper: nvopencl_wrapper.cc +$(OUTPUT_DIR)/nvopencl_wrapper: nvopencl_wrapper.cc if [ ! -d bin ]; then mkdir bin; fi - g++ $(CCFLAGS) nvopencl_wrapper.cc -I./ -I$(NVOPENCL_INCDIR)/ -L $(NVOPENCL_LIBDIR) -lOpenCL -o bin/nvopencl_wrapper + g++ $(CCFLAGS) nvopencl_wrapper.cc -I./ -I$(NVOPENCL_INCDIR)/ -L $(NVOPENCL_LIBDIR) -lOpenCL -o $(OUTPUT_DIR)/bin/nvopencl_wrapper -OUTPUT_DIR=../$(SIM_OBJ_FILES_DIR)/libopencl $(OUTPUT_DIR)/%.o: %.cc $(CPP) $(CCFLAGS) -I./ -I$(CUDA_INSTALL_PATH)/include -c $< -o $@ @@ -118,7 +117,7 @@ clean: rm -f *.o rm -f lib$(PROG).a rm -f bin/nvopencl_wrapper - rm -f Makefile.makedepend Makefile.makedepend.bak + rm -f $(OUTPUT_DIR)/Makefile.makedepend $(OUTPUT_DIR)/Makefile.makedepend.bak -include Makefile.makedepend +include $(OUTPUT_DIR)/Makefile.makedepend -- cgit v1.3