It involves these steps:
- Add the source within Eclipse
- Tell Eclipse how to build it.
- (Optionally) Fix Indexing
Since we are covering Zlib source in this book, let’s have a walk through how that code is imported / built into Eclipse.
Tip
For our example, Zlib is present in C:\sw\src\zlib\1.2.3\zlib-1.2.3
And the build commands is
make -f win32/Makefile.gcc LOC="-DDEBUG -g" all
Follow the steps as shown below to import any Makefile based project into Eclipse.
The parameters in steps marked [X]
might have to be adapted other projects.
Create a new C Project. C Project
(Select C++ Project
if your
project is based on C++`)
[X]
Set project name as Zlib-1.2.3
Unset
[X]
Set as
C:\sw\src\zlib\1.2.3\zlib-1.2.3
Set
asSet
as (On Linux, select )Click
buttonClick
Select the option,
Change the build command to
make -f win32/Makefile.gcc LOC="-DDEBUG -g"
The Console view should show the build output.
The Project Explorer view should show the generated binaries.
The feature to Change the Make Utility is already described.