[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Making multiple action lines from a varaible
From: |
EXT-Pennington, Dale K |
Subject: |
RE: Making multiple action lines from a varaible |
Date: |
Wed, 1 Aug 2007 14:24:32 -0500 |
Well, I tried the last option
> -----Original Message-----
> From: Kristof Provost [mailto:address@hidden
> Sent: Wednesday, August 01, 2007 1:25 PM
> A slightly different way might be:
> TARGETS := a.mak b.mak c.mak
>
> CLEANTARGETS := $(addprefix phony-clean-, $(TARGETS))
> ALLTARGETS := $(addprefix phony-all-, $(TARGETS))
>
> clean: $(CLEANTARGETS)
> all: $(ALLTARGETS)
>
> phony-clean-%:
> gmake -f $* clean
>
> phony-all-%:
> gmake -f $* all
>
> .PHONY: $(CLEANTARGERS) $(ALLTARGETS)
>
> It won't guarantee the order, but you can run it with -j N.
>
> Kristof
And so far it does not appear to work. When I do a gmake clean, I get a
"nothing to be done for 'clean'. When I turn on debug to check
processing what I see is :
Considering target file 'phony-clean-a.mak'
File 'phoney-clean-a.mak' does not exist
Finished prerequisites of target file 'phony-clean-a.mak'
Must remake target 'phony-clean-a.mak'
Successfully remade target file 'phoney-clean-a.mak'
For all the .maks I added an echo Cleaning $* to the phony-clean-% rule
just to make sure I saw something.
I also ran a gmake -p clean. There I saw the following :
# Implicit Rules
phony-clean-%:
# commands to execute (from 'makefile', line 42)
@echo Cleaning $*
gmake -f $* clean
... Later on
# Files
.PHONY: (includes the phony-clean-a.mak)
...
# Not a target
phony-clean-a.mak
# Phony target (prerequisite of .PHONY)
# Implicit rule search has not been done
# File does not exist
# File has been updated
# Successfully updated
...
clean : (include phony-clean-a.mak)
# Phony target (prerequisite of .PHONY)
# Command-line target
# Implicit rule search has not been done
# File does not exist
# File has been updated
# Successfully updated
It is almost like the phony-clean-*.mak is hooking up with some
different rule in the rule database, but I did not find one that might
match.
FYI, I am still using gmake 3.80
Am I missing something obvious ?