On Mon, 2016-08-22 at 06:33 -0700, Larry Wilson Sr wrote:
> I have the following:
> 
> In a generic template (Makefile.rules.mak):
> 
> BUILDPATHBASHLIBSCRIPTS = $(addprefix $(BUILDPATHDIR)/, $(BASHLIBSCRIPTS))
> 
> $(BUILDPATHBASHLIBSCRIPTS): $(BUILDPATHDIR)/%: %
>         if test $< -nt $@; then \
>                 cp -f $< $@ \
>                 chmod a+rx $@; fi
> 
> In a local makefile:
> 
> BASHLIBSCRIPTS = revisionclass.sh
> 
> include $(MAKEUTILITYDIR)/Makefile.rules.mak
> 
> $(BUILDPATHDIR)/revisionopssingleton.sh: privateext
> 
> privateext: revisionopssingleton.sh
>         ./compilerevision.sh $< $(BUILDPATHDIR)/$<
> 
> My issues are that the privateext rule is ALWAYS run
> AND the $(BUILDPATHBASHLIBSCRIPTS) rule is always run

Well, sure.

Make needs to build the target privateext.    Make sees that target
doesn't exist so it tries to build it, and to do so make runs the recipe
"./compilerevision.sh $< $(BUILDPATHDIR)/$<".

That recipe succeeds but the file privateext has not been created.  So,
the next time make runs it tries to build the target privateext again.
And the next time it will try to build it again, etc.

Because your recipe doesn't follow the Second Rule of Makefiles (it
doesn't create the file $@), make will always try to run it, hoping this
time it will work.

_______________________________________________
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to