[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multiple targets with one command
From: |
Noel Yap |
Subject: |
Re: Multiple targets with one command |
Date: |
Fri, 21 Nov 2003 11:11:57 -0500 |
Martin Schröder wrote:
>
> On 2003-11-21 09:15:37 -0500, Noel Yap wrote:
> > Not if you do something like:
> >
> > default: install
> >
> > install: targets
> >
> > targets: target1 target2 target3
> >
> > target2 target3: target1
> >
> > target1: source1 ; touch target1 target2 target3
>
> This doesn't create a missing target2.
I think I see what you're getting at. It sounds like there can be times when
target2 isn't there while target1 is. Is this correct? If so, is it
appropriate just to avoid this situation?
If it can be avoided, the following should work:
$ cat GNUmakefile
.PHONY: default
default: install
.PHONY: install
install: targets
.PHONY: targets
targets: target1 target2 target3
target2 target3: target1
target1: source1 ; touch target1 target2 target3
$ gmake
touch target1 target2 target3
$ touch source1
$ gmake
touch target1 target2 target3
Also, I do think it would be a good feature for GNU make to be able to handle
commands that create more than one output file from one input file. Does
anyone know if this has been requested in Savannah?
Thanks,
Noel
--
NOTICE: If received in error, please destroy and notify sender. Sender does
not waive confidentiality or privilege, and use is prohibited.