|
From: | Herta Van den Eynde |
Subject: | Re: "last" target? |
Date: | Wed, 26 Nov 2008 00:35:29 +0100 |
On Tue, Nov 25, 2008 at 6:16 AM, Herta Van den EyndeWithout altering the other targets in the makefile? No. It sounds
<address@hidden> wrote:
> I have a makefile with multiple targets, some of which are prerequisites to
> others, but whichever the user chooses to execute, I always want the
> "cleanup" target to be triggered as the last set of actions.
>
> Is there any way to enforce that?
like you're looking for the BSD make ".END" target, but GNU make
doesn't have that. The closest solution I see with GNU make would be
to rename the makefile to "makefile.real" and then put this in
"makefile":
all:
@$(MAKE) -f makefile.real $(MAKECMDGOALS); \
ret=$$?; stuff-to-always-do-even-if-make-fails; exit $$ret
stuff-to-do-afterwards-on-success-only
.PHONY: all
That, or fix this in the thing that calls make.
Philip Guenther
[Prev in Thread] | Current Thread | [Next in Thread] |