1 message in com.perforce.jamming[jamming] Bison, Flex, G++ project pr...| From | Sent On | Attachments |
|---|---|---|
| Ken Perry | 02 Dec 2003 00:04 |
| Subject: | [jamming] Bison, Flex, G++ project problem![]() |
|---|---|
| From: | Ken Perry (whis...@blinksoft.com) |
| Date: | 12/02/2003 12:04:47 AM |
| List: | com.perforce.jamming |
To start out with I have to admit I am pretty new at Jam. I have simplified my build process for 4 source trees in the last couple of days with Jam but by no means am I an expert and I haven't even had to write any of my own rules yet.
IN truth if I had to write my own rule I might be lost since I can't even find where the 2.5 rpm I used to instal jam hid my Jambase file.
So now to my question.
I have a compiler that has 14 .cpp files and 2.y files and 2.l files. I tried to make just a MAIN statement to do them all at once but it failed on the .y and .l files and after looking at the makefile I can understand why. The following is the shortened version of the makefile I need to convert.
vmcpar.cpp: vmcpar.y
YFLAG = -d -y -v
bison --debug $(YFLAG) vmcpar.y
@-if [ -f y.output ]; then mv y.output
../platform/$(PLATFORM)/vmc/tmp_vmcpar.output; fi
@mv y.tab.c ../platform/$(PLATFORM)/vmc/tmp_vmcpar.cpp
@mv y.tab.h ../platform/$(PLATFORM)/vmc/tmp_vmcpar.h
vmclex.cpp: vmclex.l flex -t vmclex.l $(LEXFILTER) > ../platform/$(PLATFORM)/vmc/tmp_vmclex.cpp
dilpar.cpp: dilpar.y
bison --debug -d -v -pdil dilpar.y
@-if [ -f dilpar.output ]; then mv dilpar.output
../platform/$(PLATFORM)/vmc/tmp_dilpar.output; fi
@mv dilpar.tab.c ../platform/$(PLATFORM)/vmc/tmp_dilpar.cpp
@mv dilpar.tab.h ../platform/$(PLATFORM)/vmc/tmp_dilpar.h
dillex.cpp: dillex.l
flex -Pdil -t dillex.l $(LEXFILTER) >
../platform/$(PLATFORM)/vmc/tmp_dillex.cpp
As you can see both parsers are generated using different flags for the bison and flex generator. What I want to know is how do I build these parsers and compile and link them in with the other .cpp files in the directory. Do I need to make multiple Jamfiles or is there some way to run bison and lex with one set of flags and create the resulting sources and then change the flags for the next parser I create? I also then have to include the resulting source files into the MAIN build so do I do the bison and lex stuff first in the file or does it matter?
Further more if you look at the lines where flex is run you will see I run a filter on the output of flex by piping the text out put of flex into a perl script and then directing it into a .cpp file can this be done in Jam if it can I haven't found how.
Well I am not sure if this question is clear enough but if anyone is willing to work with me I am even willing to make phone calls if necessary I am just banging my head against the Jam documents I have found on the web and haven't come up with a fix.
Ken Perry /Confused Software engineer




