[ACCEPTED]-Using custom Makefile with Eclipse/CDT-eclipse-cdt
You can create a custom Makefile and make 7 sure it's in your project root. Then you 6 need to disable the auto generated makefiles. You 5 can do that by going here:
Project Properties (right click on project and select properties) -> C/C++ Build -> in that window uncheck "Generate Makefiles Automatically."
To use your own 4 targets you can open the View called "Make 3 Target":
Window -> Show View -> Make Target
In that view you can create a new 2 target that will use the corresponding target 1 in your custom Makefile.
There is an option to create a project from 2 existing makefiles: use the "Project Wizard" and 1 select "Makefile project".
You can disable "Generate makefiles automatically" in 2 eclipse project properties -> c/c++ build 1 (builder settings.)
In my latest attempt to compile a Cross 7 ARM compile, I made a painful discovery 6 on how to get this working.
First I created 5 a "Makefile project with existing Code". I 4 selected the Cross ARM tool chain. If I 3 now open a console within Eclipse and make, it 2 works.
Now to build within the GUI, I had 1 to:
- Change properties to Internal Builder, with Generate Makefile checked.
- The settings option now offers Build Artifact tab. pick executable with ${Project}.
- Build. This will result in error in link stage.
- Switch the settings to External Builder, uncheck "Automatic Makefile generation"
- Clean
- Build
All that you have to do is tell gmake to 11 use your makefile. The default command 10 for Code Composer Studio is ${CCS_UTILS_DIR}/bin/gmake
. Simply tell 9 gmake to use your own makefile (e.g. sri.mk
). We 8 do this with the -f option. So the default 7 command would become ${CCS_UTILS_DIR}/bin/gmake -f ../sri.mk
Note that Code Composer 6 Studio is Eclipse based.
Here are the instructions:
- project->properties->C/C++ Build
- click on the 'Builder' tab
- Un-select 'Use default build command"
- Change the command to
${CCS_UTILS_DIR}/bin/gmake -f ../sri.mk
Note 5 that the build is kicked off from the Debug
directory. The 4 Debug
directory contains the makefiles that are 3 generated by Eclipse. I put my makefile 2 in the top level directory of the project 1 so that's why I put ../
in -f ../sri.mk
.
Also, there might be a line that says "default: esh $(PLUGIN_SO),"
or 4 something along those lines depending on 3 your project. I've found that changing the 2 "default"
to "all"
will enable the project to compile 1 too. This is a handy feature, eclipse :)
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.