diff --git a/makefiles/Makefile b/makefiles/Makefile index 26c1d33a84..41a119d3a5 100644 --- a/makefiles/Makefile +++ b/makefiles/Makefile @@ -69,19 +69,20 @@ LIBCUSMM_DIR := $(shell find $(SRCDIR) -type d -name "libcusmm") ALL_PREPRETTY_DIRS = $(shell find $(SRCDIR) -type d -name preprettify) ALL_PKG_FILES = $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "PACKAGE") -OBJ_SRC_FILES = $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "*.F") -OBJ_SRC_FILES += $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "*.c") -OBJ_SRC_FILES += $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "*.cpp") -OBJ_SRC_FILES += $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "*.cxx") -OBJ_SRC_FILES += $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "*.cc") +OBJ_SRC_FILES = $(shell cd $(SRCDIR); find ! -path "*/preprettify/*" -name "*.F") +OBJ_SRC_FILES += $(shell cd $(SRCDIR); find ! -path "*/preprettify/*" -name "*.c") +OBJ_SRC_FILES += $(shell cd $(SRCDIR); find ! -path "*/preprettify/*" -name "*.cpp") +OBJ_SRC_FILES += $(shell cd $(SRCDIR); find ! -path "*/preprettify/*" -name "*.cxx") +OBJ_SRC_FILES += $(shell cd $(SRCDIR); find ! -path "*/preprettify/*" -name "*.cc") + ifneq ($(NVCC),) -OBJ_SRC_FILES += $(shell find $(SRCDIR) ! -path "*/preprettify/*" ! -name "libcusmm.cu" -name "*.cu") +OBJ_SRC_FILES += $(shell cd $(SRCDIR); find ! -path "*/preprettify/*" ! -name "libcusmm.cu" -name "*.cu") OBJ_SRC_FILES += $(LIBCUSMM_DIR)/libcusmm.cu endif # Include also source files which won't compile into an object file -ALL_SRC_FILES = $(OBJ_SRC_FILES) +ALL_SRC_FILES = $(strip $(subst $(NULL) .,$(NULL) $(SRCDIR),$(NULL) $(OBJ_SRC_FILES))) ALL_SRC_FILES += $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "*.f90") ALL_SRC_FILES += $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "*.h") ALL_SRC_FILES += $(shell find $(SRCDIR) ! -path "*/preprettify/*" -name "*.hpp") @@ -355,7 +356,7 @@ ifeq ($(LD_SHARED),) @$(TOOLSRC)/build_utils/check_archives.py $(firstword $(AR)) $(SRCDIR) $(LIBDIR) endif @echo "Resolving dependencies for $(ONEVERSION) ... " - @$(TOOLSRC)/build_utils/makedep.py $(OBJDIR)/all.dep $(MODDEPS) $(MAKEDEPMODE) $(ARCHIVE_EXT) $(OBJ_SRC_FILES) + @$(TOOLSRC)/build_utils/makedep.py $(OBJDIR)/all.dep $(MODDEPS) $(MAKEDEPMODE) $(ARCHIVE_EXT) $(SRCDIR) $(OBJ_SRC_FILES) # on stage 4, load the rules generated by makedep.py ifeq ($(INCLUDE_DEPS), true) diff --git a/tools/build_utils/makedep.py b/tools/build_utils/makedep.py index 67f7609c32..040f04281c 100755 --- a/tools/build_utils/makedep.py +++ b/tools/build_utils/makedep.py @@ -25,7 +25,13 @@ def main(): mod_format = sys.argv[2] mode = sys.argv[3] archive_ext = sys.argv[4] - src_files = sys.argv[5:] + src_dir = sys.argv[5] + src_files_tmp = sys.argv[6:] + src_files = [] + for fn_part in src_files_tmp: + fn_part = fn_part[1:] + fn = src_dir + fn_part + src_files.append(fn) if(mod_format not in ('lower', 'upper', 'no')): error('Module filename format must be eighter of "lower", "upper", or "no".') if(mode not in ('normal', 'hackdep', 'mod_compiler')):