Где находится Makefile, сгенерированный Eclipse CDT? - PullRequest
28 голосов
/ 02 декабря 2010

Я создал привет проект C ++ с Eclipse (helios) CDT. Скомпилировано нормально. Но я бы хотел взглянуть на созданный Makefile CDT. Я не могу найти его в папках проекта / debug / release или в папках src. Где я могу найти этот Makefile?

Ответы [ 4 ]

17 голосов
/ 03 декабря 2010

Если вы используете настройки по умолчанию с current builder = CDT internal builder, файл make отсутствует.если вы выберете current builder = GNU make, вы увидите make-файл в папке отладки.

16 голосов
/ 25 ноября 2012

в Windows,

Щелкните ваш проект, перейдите в меню project -> properties, выберите Tool Chain Editor, затем выберите Current Builder Gnu Make Builder.

Создайте цель, теперь создайте make-файл.

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

5 голосов
/ 02 декабря 2010

Единственное, о чем я могу думать, это то, что make-файл не создан. Нажмите на свой проект, перейдите в меню project -> properties, выберите C/C++ Build на левой панели и убедитесь, что установлен флажок Generate Makefiles automatically.

5 голосов
/ 02 декабря 2010

По умолчанию у вас должно быть [рабочее пространство] / [папка проекта] / Debug / makefile .Вносили ли вы какие-либо изменения в среду по умолчанию?

Вот пример файла проекта HelloWorld из установки Helios (windows / cygwin):

################################################################################
# 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
...