help-make
[Top][All Lists]
Advanced

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

Re: Problem regenerating file removed by rule [solved]


From: Darren Hiebert (Contractor)
Subject: Re: Problem regenerating file removed by rule [solved]
Date: Mon, 11 Apr 2005 13:16:38 -0500 (CDT)

I have solved my problem. The problem was that I made
sub/Makefile.SH an order-only prerequisite of sub/config.sh, which
circumvented the execution of the command for sub/config.sh when its
dependency (sub/Makefile.SH) was out of date. By simply removing the
'|' and making it a normal prerequisite, everything now works as
expected.

Thank you for your help.

On Wed, 6 Apr 2005, I wrote:

-------------- Begin Makefile -------------
# I have no control over this action, performed by a third party compiler
define third_party_compiler
        rm -fr sub
        mkdir -p sub
        touch sub/Makefile.SH
echo 'if [ ! -f config.sh ]; then echo "config.sh missing"; exit 1; fi' >> sub/Makefile.SH
        echo '. ./config.sh' >> sub/Makefile.SH
        echo 'echo "default: ; touch final" >>Makefile' >> sub/Makefile.SH
        touch $@
endef

sub/final: sub/Makefile
        $(MAKE) -C $(<D)

sub/Makefile: sub/Makefile.SH sub/config.sh
        cd $(<D) && sh Makefile.SH

sub/config.sh: | sub/Makefile.SH
        touch $@

sub/Makefile.SH: epr ;

epr: source
        $(third_party_compiler)

source:
        touch $@

clean:
        rm -f epr source
        rm -fr sub

-------------- End Makefile -------------

--
Darren Hiebert
Phone: 256-964-5830
Pager: 877-214-3485
XonTech Systems
Missle Defense Division
Northrop Grumman Mission Systems




reply via email to

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