EclipseCDT-Makefile自动更新/刷新 我正在使用CCESTOS上的Eclipse CDT来处理一个简单的C++“Hello World”项目。以下是“src”文件夹中的项目文件: main.cpp 你好,cpp 你好,hpp
Eclipse CDT在“调试”文件夹中自动生成生成文件:EclipseCDT-Makefile自动更新/刷新 我正在使用CCESTOS上的Eclipse CDT来处理一个简单的C++“Hello World”项目。以下是“src”文件夹中的项目文件: main.cpp 你好,cpp 你好,hpp,c++,makefile,eclipse-cdt,C++,Makefile,Eclipse Cdt,Eclipse CDT在“调试”文件夹中自动生成生成文件: 生成文件 objects.mk sources.mk src/subdir.mk “Debug/src/subdir.mk”的内容: ################################################################################ #自动生成的文件。不要编辑! #######################################################
- 生成文件
- objects.mk
- sources.mk
- src/subdir.mk
################################################################################
#自动生成的文件。不要编辑!
################################################################################
#将这些工具调用的输入和输出添加到构建变量中
CPP_SRCS+=\
../src/hello.cpp\
../src/main.cpp
OBJS+=\
/src/hello.o\
./src/main.o
CPP_部门+=\
/src/hello.d\
/src/main.d
#每个子目录都必须提供用于构建其贡献的源的规则
src/%.o:../src/%.cpp
@echo“Building file:$在我看来,如果您像您所说的那样修改项目,您将不得不修改您的Makefile(或者subdir.mk
文件)。Eclipse正是在幕后为您这样做的,不是吗?您可以使用脚本生成这些文件,但在这种情况下,这似乎有些过头了。@faranwath是的,Eclipse只在生成之前修改Makefile。正如我所说,您可以使用脚本来完成这项工作,但我认为它不会为“Hello,world”项目带来回报。事实上,我会考虑:)尽管如此,我还是建议您这样做,但是作为一个纯粹的实验,为了获得一些关于构建系统如何工作的见解。
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
CPP_SRCS += \
../src/hello.cpp \
../src/main.cpp
OBJS += \
./src/hello.o \
./src/main.o
CPP_DEPS += \
./src/hello.d \
./src/main.d
# Each subdirectory must supply rules for building sources it contributes
src/%.o: ../src/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: GCC C++ Compiler'
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '