我有一个Eclipse托管的make c ++项目,其中源代码在几个子目录中,其中一个目录名为" test"。 Eclipse会自动为每个子目录(Debug / test / subdir.mk)创建makefile,并且该部分可以很好地工作。
但是,如果我在项目属性中更改编译器(比如icpc而不是gcc),则主makefile(Debug / makefile)会更改为使用新编译器,但不会更改subdir.mk。 subdir.mk仍然有gcc,而Debug / makefile有icpc作为编译器命令。我尝试为每个子目录设置属性,但我仍然遇到同样的问题。
我正在使用Eclipse Mars
有没有办法改变这个?
这是Debug / makefile ################################################## ############################## #自动生成的文件。不要编辑! ################################################## ##############################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include test/subdir.mk
-include subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(CC_DEPS)),)
-include $(CC_DEPS)
endif
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif
ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
endif
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
# All Target
all: TestProject
# Tool invocations
TestProject: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: GCC C++ Linker'
icpc -L<LinkerStuff> -lrt -openmp -inline-forceinline -o "TestProject" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(CC_DEPS)$(C++_DEPS)$(EXECUTABLES)$(C_UPPER_DEPS)$(CXX_DEPS)$(OBJS)$(CPP_DEPS)$(C_DEPS) TestProject
-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets
这是Debug / test / subdir.mk
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
CPP_SRCS += \
../test/TestProject.cpp
OBJS += \
./test/TestProject.o
CPP_DEPS += \
./test/TestProject.d
# Each subdirectory must supply rules for building sources it contributes
test/TestProject.o: ../test/TestProject.cpp
@echo 'Building file: $<'
@echo 'Invoking: GCC C++ Compiler'
icc-I<includes stuff> -O3 -g3 -Wall -c -fmessage-length=0 -openmp -MMD -MP -MF"$(@:%.o=%.d)" -MT"test/TestProject.d" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '