Noel Yap <[EMAIL PROTECTED]> writes:
> .PHONY: install
> install: install/common/make/file
>
> install/common/%: | install/common/.
>
> install/common/.:
> @echo create install/common
>
> %/.:
> @echo mkdir -p $(@)
>
> install/common/make/%: src/make/% | install/common/make/.
> @echo install -m 444 $(<) $(@)
>
> src/make/file:
>
>
> which produces the following:
>
> $ gmake
> mkdir -p install/common/make/.
> install -m 444 src/make/file install/common/make/file
>
>
> I'd like to produce:
>
> $ gmake
> create install/common
> mkdir -p install/common/make/.
> install -m 444 src/make/file install/common/make/file
>
>
> without having to have:
>
> install/common/make/.: | install/common/.
>
>
> Is this possible?
Sure, everything is possible ;-). Just change
%/.:
@echo mkdir -p $(@)
to be
%/.: | $$(dir\ %).
@echo mkdir $(@)
Now '%/.' depends on it's subdirectory. In your case it
would expand to
install/common/make/.: | install/common/.
Which is what you need, right? There is a little catch,
however. Make doesn't do double expansion in implicit
rules. If you don't mind patching your make you can find
a patch that implements double expansion here:
http://www.kolpackov.net/projects/make/bk/
hth,
-boris
_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make