cons-discuss
[Top][All Lists]
Advanced

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

RE: derived include file (includes patch to print warnings)


From: Gary Oberbrunner
Subject: RE: derived include file (includes patch to print warnings)
Date: Wed, 22 Aug 2001 10:25:06 -0400

My guess, not having seen the rest of your stuff, is that cons thinks that,
given your CPPPATH, cons thinks that foo1.C requires an inc.h in another
directory than the one your Command below builds it into.  Cons does know
how to generate a required .h as needed.  Are you including inc.h with
quotes rather than angle-brackets?

Here's a little patch I just wrote to warn when cons can't find one of your
include files.   You turn it on with the new -wi arg (for Warn about Include
files), and I put a little doc in for it too.   Maybe this will help you.

I noticed, btw, that on Windows this patch shows that things like <stdio.h>
etc. are "missing," I think because cons doesn't know about the INCLUDE
environment var.  But those messages are harmless.

-- Gary Oberbrunner

 > -----Original Message-----
 > From: address@hidden [mailto:address@hidden
 > Behalf Of CARRY,GILLES (Non-HP-France,ex1)
 > Sent: Wednesday, August 22, 2001 8:16 AM
 > To: 'address@hidden'
 > Subject: derived include file
 >
 >
 > 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
 >
 > _______________________________________________
 > address@hidden
 > http://mail.gnu.org/mailman/listinfo/cons-discuss
 > Cons URL: http://www.dsmit.com/cons/
 >

Attachment: cons.patch
Description: Binary data


reply via email to

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