Книга: Embedded Linux development using Eclipse

5.1 User-Supplied Makefiles

In the last chapter we created a project where Eclipse supplied the Makefile. But there are situations where it makes more sense to create the Makefile yourself and import it into the project along with the source files. This is also useful for bringing “legacy” projects into Eclipse that already have a makefile.

In the C/C++ perspective, create a new C project (File?New?C Project) but this time select Makefile Project as shown in Figure 5.1. Call the project “thermostat.” Eclipse creates an empty project with an Includes entry and attempts to build the “all” target. Since the project is empty, there is no “all” target and the build fails.


Figure 5.1: Makefile Project.

Right-click thermostat in the Project Explorer and select Import?General?File System. Browse to the EclipseSamples/thermostat directory and click OK. Now click Select All and Finish as shown in Figure 5.2 to import the entire collection of source files into your thermostat project. Eclipse again attempts to build the “all” target and oddly, it fails even though the Makefile does in fact include an “all” target.


Figure 5.2: Import File System dialog.

Right-click thermostat and select Build Configurations?Build?All. This time Eclipse builds an executable target called thermostat_s (“s” for simulation).

Оглавление книги

Оглавление статьи/книги

Генерация: 1.579. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз