ソースコードがいくつかのサブディレクトリにあるEclipse管理のmake c ++プロジェクトがあり、これらのディレクトリの1つは「test」という名前です。Eclipse は、サブディレクトリ (Debug/test/subdir.mk) ごとに Makefile を自動的に作成し、その部分は美しく機能します。
ただし、プロジェクトのプロパティでコンパイラ (gcc ではなく icpc など) を変更すると、メインのメイクファイル (Debug/makefile) は新しいコンパイラを使用するように変更されますが、subdir.mk は変更されません。subdir.mk にはまだ gcc がありますが、Debug/makefile にはコンパイラ コマンドとして icpc があります。各サブディレクトリのプロパティを設定しようとしましたが、まだ同じ問題があります。
私はEclipse Marsを使用しています
これを変更する方法はありますか?
これはデバッグ/メイクファイルです ############################################## #################################### # 自動生成ファイル。編集しないでください!#################################################### ###############################
-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 ' '