[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: compiling flex & bison files
From: |
Artem Kulakov |
Subject: |
Re: compiling flex & bison files |
Date: |
Thu, 7 Mar 2002 12:19:45 +1030 |
Thanks, I implemented our stuff with Command calls.
The only problem I had is when compiling bison files if I pass both .c and
.h files as targets the dependency check goes crazy - it recompiles .y file
but does not recompile the generated .c and the library where it's included
into. If I pass only the .c file everything is ok. As long as it works ...
Now I have another problem. I'm trying to compile some home grown scripts. I
setup the language, I use Objects method - all good. Now I want it to
generate the binaries into game data folder, which is not under build top. I
tried to use ObjectsInDir without any luck - it does not add targets at all.
Any ideas?
_________________________________
Artem Kulakov, Senior Programmer
Ratbag Pty Ltd
Level 8, 63 Pirie Street,
Adelaide, SA, Australia. 5000
T: +618 8223 5830 F: +618 8223 5746
http://www.ratbaggames.com
----- Original Message -----
From: "Erich Waelde" <address@hidden>
To: "Artem Kulakov" <address@hidden>; <address@hidden>
Sent: Monday, February 18, 2002 5:34 PM
Subject: Re: compiling flex & bison files
> Howdy, downunder ...
>
> > What is the best way to compile flex and bison files using ConsPlus?
>
> > Do people use Language or a set of Command calls?
>
>
> I use the following snippets with some success:
>
> -----------------------------------------------------
> $hoc6 = new cons (
> ENV => { PATH => "$PATH" },
> ...
> YACC => "bison",
> YFLAGS => "-y -d",
> LIBS => "-lm -lfl",
> LEX => "flex",
> LFLAGS => "-t",
> ...
> );
>
>
>
> Command $hoc6 "lex.c", "lex.l", q(
> %LEX %LFLAGS %< > %>
> );
>
> Command $hoc6 ["y.tab.h", "hoc6.c"], "hoc6.y", q(
> %YACC %YFLAGS %<
> mv y.tab.c hoc6.c
> );
> -----------------------------------------------------
>
> This example uses Command() calls, note that processing hoc6.y
> produces 2 output files (hoc6.c and y.tab.h), both used further.
>
>
> Using Cons::Plus I got the "lex" bit to work like this (in
> a lower Conscript in this case):
>
> -----------------------------------------------------
> use Cons::Plus;
>
> Import qw( top_env PATH );
>
> Language "Lex",
> SRC_SUFFIX => ".l",
> OBJ_SUFFIX => ".c",
> PREFIX => "L_",
> ENV => {
> LEX => "flex",
> LFLAGS => "-t",
> L_COM => "cd %<:d; %LEX %LFLAGS %<:f > %>:f",
> };
>
> $tgt = Cons::Plus->new (
> ENV => { PATH => "$PATH" },
> );
>
> $tgt->Objects( "lex.l" );
> ----------------------------------------------------
>
> The "yacc" bit I still do with Command() calls, since I failed
> to make cons/Cons::Plus realize that
> *one* command actually produces
> *two* derived files
>
> Maybe Cons::Plus does provide dealing with a list like Command()
> in the above example ? Maybe it can be changed to do it with
> modest effort?
>
> Maybe there are other ways of doing it ...
>
> Cheers,
> Erich
>
>
> _______________________________________________
> address@hidden
> http://mail.gnu.org/mailman/listinfo/cons-discuss
> Cons URL: http://www.dsmit.com/cons/
>
- Re: compiling flex & bison files,
Artem Kulakov <=