cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unexpected cons Repository behaviour


From: Nadim Khemir
Subject: Unexpected cons Repository behaviour
Date: Thu, 25 Apr 2002 14:16:11 +0200

Hi, I quickly map the environment I have.

Running under Linux,I have the following directory structure

/phoenix
+---src
|   +---common
|   |   +---poolheap
+---projects
    +---xxx
        +---src
            +---common
                +---poolheap

/phoenix/src is going to be used as a repository, under
project/xxx/src/common I only have files that I want to modify from our base
code for the xx project.

I have 2 construct files, one for building the repository (located in
/phoenix) an one for building the xxx project (located in
/phoenix/projects/xxx)

I build the repository in /phoenix/build and the project in
/phoenix/projects/xxx/build.

Here is the "repository" construct file:
Export qw( CONS INCLUDE LIB BIN );

$BUILD  = '#build';
$INCLUDE = "$BUILD/include";
$LIB     = "$BUILD/lib";
$BIN     = "$BUILD/bin";

Default '#build' ;

$CONS = new cons
                (
                ENV       => {%ENV}
                , CPPPATH => "$INCLUDE:." 
                , LIBPATH => $LIB
                #, LIBS    => ''  # List of standard libraries
                , CCCOM =>
                        [
                          qq#@ printf "\\n\33[30;42m- Compiling
%%s\33[0m\\n" %<#
                        , '%CC %CFLAGS %_IFLAGS -c %< -o %>'
                        ]
                , LINKCOM =>
                        [
                          qq#@ printf "\\n\33[37;45m----- Linking
\33[0m\\n"#
                        , '%LINK %LDFLAGS -o %> %< %_LDIRS %LIBS',
                        ]
                                );
Link "$BUILD" => 'src' ;

Build
        (
          "$BUILD/common/poolheap/conscript.cons"
        );

<<<<<<<<<<<<EOF

The project construct is equivalent with the following line inserted between
the Link and Build command:

Repository '/phoenix';

<<<<<<<<<<<<EOC

in the project only one file is present ( the one that is specific to this
project), the repository contains many more files.

The problem:
Starting without anything build:

1/ I build the project, all goes smooth, I get a build directory where I
want, the files that are only present in the repository are copied (not
linked, I wonder why) the compilation goes fine.

2/ I build the repository, all goes smooth again.

Now if I do the opposite, first build the repository and then the project:

The repository build fine but not the project! I get this compilation error:

cc -Ibuild/include -I/phoenix/build/include -I. -I/phoenix -c
build/common/poolheap/PoolHeap.c -o build/common/poolheap/PoolHeap.o

build/common/poolheap/PoolHeap.c:15:43: PoolHeap_private_declarations.h: No
such file or directory
cons: *** [build/common/poolheap/PoolHeap.o] Error 1
cons: errors constructing build/common/poolheap/PoolHeap.o

That file was copied in the first case but not in the second one.

If I completely remove the file that is specific then the files are
"locally" copied from the repository as expected.

What did I miss?

Nadim.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]