Where is the Makefile generated by the Eclipse CDT?
I've built a hello world C++ projec开发者_JS百科t with Eclipse(helios) CDT. It compiled fine. But I would like to take a look at the Makefile CDT generated. I can't find it in project folder/debug/release folders or in the src folders. Where can I find this Makefile?
On Windows,
Click your project, go to menu project
-> properties
, select Tool Chain Editor
then select in Current Builder
Gnu Make Builder
.
Build a target now generate makefile.
http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Freference%2Fcdt_u_prop_build_toolchain.htm
If you use the default setttings with current builder = CDT internal builder
, there is no make file.
if you select current builder = GNU make
, you will see the makefile in the debug folder.
The only thing I can think of is that the makefile isn't created. Click your project, go to menu project
-> properties
, select C/C++ Build
in the left pane, and make sure the Generate Makefiles automatically
checkbox is checked.
By default you should have [workspace]/[project folder]/Debug/makefile. Have you made any changes to the default environment?
Here's the HelloWorld sample project makefile from a Helios (windows/cygwin) installation:
################################################################################ # 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/subdir.mk -include objects.mk ifneq ($(MAKECMDGOALS),clean) 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: HelloWorld.exe # Tool invocations HelloWorld.exe: $(OBJS) $(USER_OBJS) @echo 'Building target: $@' @echo 'Invoking: Cygwin C++ Linker' g++ -o"HelloWorld.exe" $(OBJS) $(USER_OBJS) $(LIBS) @echo 'Finished building target: $@' @echo ' ' # Other Targets clean: -$(RM) $(C++_DEPS)$(OBJS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) HelloWorld.exe -@echo ' ' .PHONY: all clean dependents .SECONDARY: -include ../makefile.targets
精彩评论