cons-discuss
[Top][All Lists]
Advanced

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

How to always build a target?


From: Eric Brown
Subject: How to always build a target?
Date: Mon, 30 Oct 2000 11:26:21 -0800

I'm converting my project from (recursive invocations of) nmake to Cons.
Currently, the project generates a header (containing the current date) on
every invocation; the generating tool is smart enough to not update the file
if it's not necessary.  How would I force the invocation of a Command script
on every invocation?

My current script leaves the <inputs> section of the Command empty, but the
$> tag resolves to '0', and not '$INCLUDE/GeneratedVersion.h', as (I
believe) it should.  I suspect the missing <inputs> section is bollixing
things up, but I'm not sure how to go about fixing it.

I've included the Conscript that I currently have, and part of the Makefile
that builds the header, to show what I want.

Any suggestions are welcome.

Eric

-------- Current Conscript --------------
Import qw( CONS INCLUDE LIB BIN BUILD BUILDTYPE EXPORT DEFINES);

$INCLUDE = "$EXPORT/backend/include";
$LIB = "$EXPORT/backend/lib";
$BIN = "$EXPORT/backend/bin";

Install $CONS $INCLUDE, 'include/BackendVersion.h';

$VERDIR = SourcePath './versioninfo.exe';

Command $CONS "$INCLUDE/GeneratedVersion.h", , qq(
        $VERDIR $>
);

Command $CONS "$INCLUDE/GeneratedVersion.tag",
"$INCLUDE/GeneratedVersion.h", qq(
        del /q $>
        echo VersionTag >> $>
        del /s /q *.res
);
------ Corresponding Makefile -----------

all: GenerateVer CompareVer <more stuff here>

CompareVer: Include\GeneratedVersion.tag

GenerateVer: 
        -versioninfo Include\GeneratedVersion.h

Include\GeneratedVersion.tag: Include\GeneratedVersion.h
        -del /q Include\GeneratedVersion.tag
        echo VersionTag >> Include\GeneratedVersion.tag
        -del /s /q *.res


"It is by caffeine alone I set my mind in motion. 
It is by the Beans of Java that thoughts acquire speed, 
the hands acquire shaking, the shaking becomes a warning. 
It is by caffeine alone I set my mind in motion." -- National Lampoon's
"Doon"





reply via email to

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