Board index » cppbuilder » Custom Build Steps for Lex and Yacc
Nick Shaffne
![]() CBuilder Developer |
Wed, 24 Dec 2003 04:12:51 GMT
|
Nick Shaffne
![]() CBuilder Developer |
Wed, 24 Dec 2003 04:12:51 GMT
Custom Build Steps for Lex and Yacc
What is the best way to add additional custom build steps to my project for
running flex and bison on my .L and .Y files that are translated to .C files and then subsequently compiled by BCB5? I assume there is probably some way to modify the .bpr project file to do this, but have seen little documentation on the meaning of the fields contained therein. Any help would be much appreciated, |
Team
![]() CBuilder Developer |
Wed, 24 Dec 2003 22:41:23 GMT
Re:Custom Build Steps for Lex and YaccQuoteNick Shaffner wrote: asking for IDE improvements regarding plugging in extra tools. If the IDE would allow you do plug in flex and bison, I doubt that Alex would be complaining. My suggestion to you is to use consider using a makefile. Or you could create a .BAT Harold Howe [TeamB] |
Edward Diene
![]() CBuilder Developer |
Thu, 25 Dec 2003 16:29:31 GMT
Re:Custom Build Steps for Lex and YaccCreate a project group for your project. Add a batch file first and from within the batch file add your own make file for running flex and bison against your .L and .Y files respectively to create your source and header output. Then add your project which uses the flex and bison output next to the project group. Use Make All Projects or Build All Projects to create your final output. QuoteNick Shaffner wrote: |
Nick Shaffne
![]() CBuilder Developer |
Sun, 18 Jan 2004 04:36:16 GMT
Re:Custom Build Steps for Lex and YaccQuote> My suggestion to you is to use consider using a makefile. Or you could Quote> all screwed up. group to preprocess my lex and yacc files, but now I also want to run yet more tools to generate my final executable as well as preprocess the output. For example, I now run microsoft's RC compiler to generate an additional .RES file that I need to link to, and I want to feed my final executable through an executable compressor as well as a utility that recomputes it's header's checksum. I can do all this with batch files, but the amount of redundant work would become rather excessive. (ie, that .RES file is quite large, and rarely needs to be regenerated.) Ideally, I'd love to be able to do this with a single makefile, and I see that tempting 'ExportMakefile' option sitting happilly under the project menu. My question is this, how can I export this makefile, and perhaps mod it up a bit and still stay friendly with the IDE? I'm guessing that when I export the makefile and mod it up one of a couple things will happen: [a] I'll lose use of the project manager menu. Basically, to recap, what I want to do is: Preprocess a lex file Right now, I'm thinking my project group is going to look like: Preprocess.bat - calls a custom makefile to build my lex, yacc and .res file Is there any way to simplify this process? In VC it's just a matter of Thanks for the help, -- |
Alexey N. Solofnenk
![]() CBuilder Developer |
Sun, 18 Jan 2004 07:56:45 GMT
Re:Custom Build Steps for Lex and YaccTheoretically you can export makefile from VC, but then you will not be able to debug in BCB. Next step is to use VC for everything. |
Team
![]() CBuilder Developer |
Sun, 18 Jan 2004 09:57:56 GMT
Re:Custom Build Steps for Lex and YaccQuote> Preprocess a lex file 1- build the lex C file from the lex input file it would look sort of like this (lots of stuff missing, namely the options for each lexer.c : lexer.y yacc.c : yacc.y foo.res: foo.rc final.exe: intermediate.exe preprocess: yacc.c lexer.c foo.res Then, change preprocess.bat to look like this make preprocess and change postprocess.bat to look like this: make postprocess preprocess.bat and postprocess.bat would be a part of your project group. I'm not sure why you want to have the RC file external and processed by MSVC. I will Quote> Is there any way to simplify this process? In VC it's just a matter of moment) Quote> Is it manage the pre and post process steps. Harold Howe [TeamB] |
Nick Shaffne
![]() CBuilder Developer |
Sun, 18 Jan 2004 11:36:55 GMT
Re:Custom Build Steps for Lex and YaccThanks for the suggestion Harold, putting it in a single makefile will help keep it a bit easier to maintain. Quote> I'm not sure why you want to have the RC file external and processed by I'd love to use Borland's RC compiler, but from what I've seen, it can't index.html HTML DISCARDABLE "res\\index.html" which makes using the res:// protocol ...muuuuch... easier. (ie, being able Quote> As I described. The key is not to manage or build your EXE from the make Nick |