[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference smurf::buildhelp

Title:USG buildhelp questions/answers
Moderator:SMURF::FILTER
Created:Mon Apr 26 1993
Last Modified:Mon Jan 20 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2763
Total number of notes:5802

788.0. "Question about GOLD BL10 make" by SMURF::FILTER (Automatic Posting Software - mail to flume::puck) Mon Jun 06 1994 09:53

Date Of Receipt: 	 3-JUN-1994 17:59:42.59
From: 	WASTED::"[email protected]"
To: 	wasted::buildhelp
CC: 	JDADDAMIO@DEC:.zko.wasted
Subj: 	Question about GOLD BL10 make

Hi,

I'm trying to test my current auto-dependency work on a GOLD BL10 system.

The latest difficulty seems to be with make not behaving as expected. Namely,
I have a rule with no dependencies for which I intended to get executed each 
time the rule is invoked. It doesn't. For example, If the rules look like 
this:


selzter: carbonation
	[bunch of commands]

carbonation:
	echo "Fizzzzzzzzz"
	cp bubbles carbonation

If I type 'build carbonation' and carbonation exists, the message
"'carbonation' is up to date." is printed. If I type 'build selzter', make 
executes the commands under the seltzer rule but does not update carbonation 
if it exists.

The man page for make says "The use of dependencies is not mandatory, but if 
they are not used, the command line is always executed when the target 
is made."

Do you have any idea of what's going on?

Thanks
John

T.RTitleUserPersonal
Name
DateLines
788.1Re: Question about GOLD BL10 makeSMURF::FILTERAutomatic Posting Software - mail to flume::puckMon Jun 06 1994 09:5416
Date Of Receipt: 	 3-JUN-1994 18:12:18.05
From: 	FLUME::jmcg "Jim McGinness"
To: 	jdaddamio@dec:.zso.decwet
CC: 	buildhelp@DEC:.zko.flume
Subj: 	Re:  Question about GOLD BL10 make

The target is not being made, so the commands are not executed.  The
commands under a target with no dependencies will be executed only if
the target does not already exist.

The ODE make rules have an ALWAYS concept which, when listed as
a dependency, forces the firing of the commands.  Maybe this is
what you are looking for.

	-- jmcg

788.2Re: Question about GOLD BL10 makeSMURF::FILTERAutomatic Posting Software - mail to flume::puckMon Jun 06 1994 11:0454
Date Of Receipt: 	 3-JUN-1994 19:52:25.88
From: 	FLUME::jmcg "Jim McGinness"
To: 	jdaddamio@dec:.zso.decwet
CC: 	buildhelp@DEC:.zko.flume
Subj: 	Re:  Question about GOLD BL10 make

I don't know exactly what environment you are in and which makerules
you have available.  Perhaps you do have a problem.  I think the
only problem is misinterpreting the make manpage, though.

On gulch, running Gold BL9, I created the following Makefile

ALWAYS=_ALWAYS_

${ALWAYS}:;@

selzter: carbonation
        echo 'Executing commands for "selzter"'


carbonation: ${ALWAYS}
        echo "Fizzzzzzzzz"
        echo "Fizzzzzzzzz" > bubbles
        cp bubbles carbonation
        echo ALWAYS=${ALWAYS}

This makefile behaves as I think you are expecting.  The commands under
target carbonation are re-executed every time you say "make carbonation",
regardless of whether a file named "carbonation" already exists.

This works because the dependency on _ALWAYS_ triggers the firing of
the commands for _ALWAYS_, then for carbonation.  No file _ALWAYS_
is created (the command list is null), make doesn't check again for
_ALWAYS_ before continuing with the commands for carbonation.

If ALWAYS is not defined, you get back to the original situation
of carbonation having no dependencies.  What the manpage says
about this situation is:

  The use of dependencies is not mandatory, but if they are not
  used, the command line is always executed when the target is made.

The key phrase is "when the target is made".  There's an unfortunate
collision of English with computer jargon here.  You might think
that saying "make target" leads inexorably to a situation where
"the target is made", but the latter phrase must be understood
in the context of the earlier sentence:

  The make command updates the target based on whether the target's
  dependencies have been modified relative to the time of last
  modification to the target, or if the target itself does not exist.



788.3Re: Question about GOLD BL10 makeSMURF::FILTERAutomatic Posting Software - mail to flume::puckMon Jun 06 1994 17:5328
Date Of Receipt: 	 6-JUN-1994 15:46:42.77
From: 	FLUME::jmcg "Jim McGinness"
To: 	jdaddamio@dec:.zso.decwet
CC: 	buildhelp@DEC:.zko.flume
Subj: 	Re: Question about GOLD BL10 make
> seltzer: 	carbonation

 >   echo 'Executing commands for "selzter"'

 > carbonation: ${ALWAYS}
On the first scan of the makefile, this ${ALWAYS} is NULL because it
hasn't been defined yet.  The reason ODE makefiles appear to have the
includes at the bottom is that most of them consist entirely of macro
definitions.  These macros are then consumed by the included rules.
If there are any additional rules, they're supposed to come after the
includes, but this usually doesn't matter much if the rules are simple
and don't contain macros that need expansion.  In your case, it DOES
matter.  Move your rules to come after the includes.
 >   echo "Fizzzzzzzzz"
 >   echo "Fizzzzzzzzz" > bubbles
 >   cp bubbles carbonation
 >   echo ALWAYS=${ALWAYS}

 > include ${MAKEFILEPATH}/standard.mk
 > include ${MAKEFILEPATH}/subdirs.mk
 > include ${MAKEFILEPATH}/others.mk