Build Steps for Makefile Project in Eclipse

回眸只為那壹抹淺笑 提交于 2019-12-12 11:57:42

问题


I am trying to use Eclipse to build some existing software (written in C), which is built with a Makefile. For this reason I created a 'Makefile project' in Eclipse.

However, I just found out, the in the 'C/C++ Build / Settings' menu, I only see the 'Binary Parsers' and 'Error Parsers' tabs. However, I really need the 'Build Steps' tabs, because I also need to add a post-build command.

How can I make the 'Build Steps' tab appear in my project?


回答1:


You should include those steps in the makefile. The reason pre-build and post-build steps are included in the default Eclipse C++ projects is that in that case Eclipse generates the makefile automatically, so if you want to do anything apart from building your code, you need to do it separately. But if you create the Makefile yourself, then you can include pre- and post-build steps in it.




回答2:


I have had exactly the same issue recently. There is how I've resolved it:

Wrote a script build.sh:

#! /bin/bash

source env.sh
# do other steps
make debug

Then

chmod a+x build.sh

Configure the project:

Properties->C/C++ Build->Behavior->Build (incremental build): empty

Properties->C/C++ Build->Builder Settings->Build command: ${ProjDirPath}/build.sh



来源:https://stackoverflow.com/questions/2651908/build-steps-for-makefile-project-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!