[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: exception to Paul's Second Rule?
From: |
Benoit Poulot-Cazajous |
Subject: |
Re: exception to Paul's Second Rule? |
Date: |
24 Oct 2003 00:22:37 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
Noel Yap <address@hidden> writes:
> I've created the following rule:
>
> .PRECIOUS: %/../...
> %/../...:
> @mkdir -p $(dir $(patsubst %/,%,$(dir $(@D)))) && : >> $(dir
> $(patsubst %/,%,$(dir $(@D))))$(@F)
>
> which lets me do stuff like:
>
> %.o: %.c %.o/../...
>
> %.d: %.c %.d/../...
>
> so that parent directories are automatically created.
You can also use something like this :
.PRECIOUS: %/.
%/.:; mkdir -p $@
$(OBJDIR)/%.o: %.c | $(OBJDIR)/.
...
or something like this :
.PRECIOUS: %/.
%/.:; mkdir -p $@
DIRSTOCREATE = some dirs to/create
.SECONDARY .PHONY: mkalldirs
mkalldirs: | $(DIRSTOCREATE:%=%/.)
%.o: %.c mkalldirs
...
-- Benoit
Re: exception to Paul's Second Rule?, Noel Yap, 2003/10/16
- Re: exception to Paul's Second Rule?, Robert Mecklenburg, 2003/10/16
- Re: exception to Paul's Second Rule?, Noel Yap, 2003/10/16
- Re: exception to Paul's Second Rule?, Robert Mecklenburg, 2003/10/16
- Re: exception to Paul's Second Rule?, Noel Yap, 2003/10/16
- Re: exception to Paul's Second Rule?, Noel Yap, 2003/10/16
Re: exception to Paul's Second Rule?,
Benoit Poulot-Cazajous <=