我在“Nsight Eclipse Edition”中创建了一个项目。当我从 Nsight 编辑器运行调试时,它运行良好,即,如果只修改了选定的几个文件,Nsight 执行 - “项目配置调试的增量构建”。但是,如果当我使用命令“make”从 ../Debug 文件夹的命令行运行相同的项目时——它总是返回相同的输出
~/cuda-workspace/MyProject/Debug$ make make: `src/core_system/math/Gimplex/simplex.o' 是最新的。
--and 如果我从文件夹中删除文件 simplex.o 并再次执行“make”,则 Nsight 仅构建 simplex.cu 文件,尽管 MyProject 中还有其他修改过的文件。
我目前低效的解决方案是我先“make clean”然后“make”。有谁能够帮我?我应该怎么做才能转换我的 makefile 以从命令行获取增量构建?---下面附加我的makefile和.mk文件
my file-- "makefile" ################################################################################
# Automatically-generated file. Do not edit!
################################################################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include src/core_system/symbolic_states/subdir.mk
-include src/core_system/math/subdir.mk
-include src/core_system/math/Gimplex/subdir.mk
-include src/application/subdir.mk
--- missing include code -----
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(CU_DEPS)),)
-include $(CU_DEPS)
endif
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ifneq ($(strip $(CC_DEPS)),)
-include $(CC_DEPS)
endif
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif
ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif
ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif
endif
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
# All Target
all: MyProject
# Tool invocations
MyProject: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: NVCC Linker'
/usr/local/cuda-6.5/bin/nvcc --cudart static -L/usr/local/lib --relocatable-device-code=false -gencode arch=compute_11,code=compute_11 -gencode arch=compute_12,code=compute_12 -gencode arch=compute_11,code=sm_11 -gencode arch=compute_12,code=sm_12 -link -o "MyProject" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(CU_DEPS)$(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) MyProject
-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets
my file-- "sources.mk"
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
O_SRCS :=
CPP_SRCS :=
C_UPPER_SRCS :=
C_SRCS :=
S_UPPER_SRCS :=
OBJ_SRCS :=
CU_SRCS :=
ASM_SRCS :=
CXX_SRCS :=
C++_SRCS :=
CC_SRCS :=
CU_DEPS :=
OBJS :=
C++_DEPS :=
C_DEPS :=
CC_DEPS :=
CPP_DEPS :=
EXECUTABLES :=
CXX_DEPS :=
C_UPPER_DEPS :=
# Every subdirectory with source files must be described here
SUBDIRS := \
src/core_system/symbolic_states \
src/core_system/math \
src/core_system/math/Gimplex \
--some more missing lines ----
Appending for sample two subdir.mk file from different folder
1) my file --"Debug/src/core_system/symbolic_states/subdir.mk"
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
CPP_SRCS += \
../src/core_system/symbolic_states/symbolic_states.cpp
OBJS += \
./src/core_system/symbolic_states/symbolic_states.o
CPP_DEPS += \
./src/core_system/symbolic_states/symbolic_states.d
# Each subdirectory must supply rules for building sources it contributes
src/core_system/symbolic_states/%.o: ../src/core_system/symbolic_states/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: NVCC Compiler'
/usr/local/cuda-6.5/bin/nvcc -I"/home/amit/cuda-workspace/MyProject/src" -I/usr/local/include -G -g -O3 -Xcompiler -fopenmp -gencode arch=compute_11,code=sm_11 -gencode arch=compute_12,code=sm_12 -odir "src/core_system/symbolic_states" -M -o "$(@:%.o=%.d)" "$<"
/usr/local/cuda-6.5/bin/nvcc -I"/home/amit/cuda-workspace/MyProject/src" -I/usr/local/include -G -g -O3 -Xcompiler -fopenmp --compile -x c++ -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
2) my file --"Debug/src/core_system/math/Gimplex/subdir.mk"
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
CU_SRCS += \
../src/core_system/math/Gimplex/simplex.cu
CU_DEPS += \
./src/core_system/math/Gimplex/simplex.d
OBJS += \
./src/core_system/math/Gimplex/simplex.o
# Each subdirectory must supply rules for building sources it contributes
src/core_system/math/Gimplex/%.o: ../src/core_system/math/Gimplex/%.cu
@echo 'Building file: $<'
@echo 'Invoking: NVCC Compiler'
/usr/local/cuda-6.5/bin/nvcc -I"/home/amit/cuda-workspace/MyProject/src" -I/opt/gurobi600/linux64/include -I/usr/local/include -G -g -O3 -Xcompiler -fopenmp -gencode arch=compute_11,code=sm_11 -gencode arch=compute_12,code=sm_12 -odir "src/core_system/math/Gimplex" -M -o "$(@:%.o=%.d)" "$<"
/usr/local/cuda-6.5/bin/nvcc -I"/home/amit/cuda-workspace/MyProject/src" -I/opt/gurobi600/linux64/include -I/usr/local/include -G -g -O3 -Xcompiler -fopenmp --compile --relocatable-device-code=false -gencode arch=compute_11,code=compute_11 -gencode arch=compute_12,code=compute_12 -gencode arch=compute_11,code=sm_11 -gencode arch=compute_12,code=sm_12 -x cu -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '