[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: folder deps
From: |
Dan Oelke |
Subject: |
RE: folder deps |
Date: |
Wed, 29 Jun 2005 14:43:56 -0500 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
Adam,
I ran into almost the same problem.
I had directories that I wanted the makefile to generate, but if I made
the things in the directories dependent on the directories then I was
constantly (and needlessly) rebuilding the world.
I *just* solved it by not making those things in the directories
dependent on the directory itself. Instead I just force a creation of
the directory every time make is invoked by using := and $(shell).
mkdir failures are silently ignored. For a small number of directories
this isn't a big performance hit. The only thing that worries me is
silently ignoring the mkdir failures. I ignore them because it fails
once the directory is already there.
Thanks to John Grahm-Cumming for writing up the idea of using := and shell.
Using your example - it would now look something like this.
# Create folders.
#$(INTDIR) $(OUTDIR):
# mkdir -p $@
DUMMY := $(shell mkdir -p $(INTDIR) 2>&1)
DUMMY := $(shell mkdir -p $(OUTDIR) 2>&1)
# Run definitions through the encoder.
$(TARGET): $(OUTDIR) $(ENCODER)
@echo "Generating Output..."
$(ENCODER) gen.def $(OUTDIR)
Hope this helps.