cons-discuss
[Top][All Lists]
Advanced

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

derived include file


From: CARRY,GILLES (Non-HP-France,ex1)
Subject: derived include file
Date: Wed, 22 Aug 2001 14:15:53 +0200

Hello,

Let me explain the problem I'm facing.

I have an include file (inc.h) which is derived from inc.msg and is
generated by a perl script.
In the Construct file I have this line:

Command $env inc.h, inc.msg, "gen_inc.pl inc.msg";

inc.h is included by several C files (let's say: foo1.C and foo2.C).
The compilation of foo1.C or foo2.C always fails complaining that inc.h
cannot be found.
This is perfectly understandable since inc.h has not been built.
Despite I correctly set CPPPATH (I can see it when the gcc command shows up
(-ImyDir)), inc.h is never built. I have to set the dependency myself with
the line:

Depends $env foo1.o inc.h

>From what I understand, cons defines the .h dependency by scanning and
comparing the c-source files and the directories specified in CPPPATH. If
the .h file does not exist before, the dependency is not set because it
cannot determine where the .h file is.

I found these two workarounds:
- set the dependency myself (.o -> .h) which might be very tough if inc.h is
included in many sources
- set the dependency to always build the file

Do you, folks, have any better idea?

Thanks.
Cheers.


Gilles CARRY.
B1N2F6 (un croiseur touché, deux coups dans l'eau)
Tel. +33 4 76 14 5783 Telnet 779-5783



reply via email to

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