Where is the Makefile generated by the Eclipse CDT?

前端 未结 4 665
无人及你
无人及你 2021-01-31 03:52

I\'ve built a hello world C++ project 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 fold

相关标签:
4条回答
  • 2021-01-31 04:08

    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.

    0 讨论(0)
  • 2021-01-31 04:14

    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.

    Current builder Gnu Make Builder

    http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Freference%2Fcdt_u_prop_build_toolchain.htm

    0 讨论(0)
  • 2021-01-31 04:22

    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
    
    0 讨论(0)
  • 2021-01-31 04:25

    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.

    0 讨论(0)
提交回复
热议问题