Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Use flex/bison in build
Use flex/bison in build [message #1725118] Tue, 01 March 2016 00:15 Go to next message
Andrew Schepler is currently offline Andrew ScheplerFriend
Messages: 1
Registered: February 2016
Junior Member
I have in my C++ project a flex file ws.l and a bison file ws.yy. CDT doesn't know what to do with these, so the build ignores them. I tried adding a "Make target" with target name "ws.tab.cc" and build command "bison -d ws.yy", but selecting "Build target" on it doesn't appear to do anything.

How can I get Eclipse's build action to automatically run flex and bison? I'd prefer a solution that uses the automatic build system.

If I have to write my own Makefile, how can I make it do different things for Eclipse's "Debug" and "Release" configurations?
Re: Use flex/bison in build [message #1725307 is a reply to message #1725118] Wed, 02 March 2016 12:01 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
It's not surprising that CDT doesn't know about flex and bison which are source file generators. You could try adding a pre-build step.
http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Freference%2Fcdt_u_prop_build_settings_steps.htm

I've never used it myself, though. It may be easier to call a script with it which does the flex/bison run. It may run for every build so it probably should check if any action is needed.

Writing your own make file is OT for this forum. You could start by examining the ones (there may be more than one) generated by CDT for ideas. In fact, it might be easier to disable makefile generation after the first and modify it.

You may find this helpful when you do: http://www.gnu.org/software/make/manual/make.html

[Updated on: Wed, 02 March 2016 12:21]

Report message to a moderator

Previous Topic:Formatter: unwanted new lines, Typing: unwanted comment closure
Next Topic:No console output
Goto Forum:
  


Current Time: Fri Apr 26 07:35:43 GMT 2024

Powered by FUDForum. Page generated in 0.04057 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top