help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

folder deps


From: Adam Heinz
Subject: folder deps
Date: Tue, 28 Jun 2005 13:14:03 -0700

[ GNU Make 3.80, Cygwin ]

Since our builds organize their output into various folders, I need to
ensure that these folders exist before I execute the rules that output
into them.

        # Create folders.
        $(INTDIR) $(OUTDIR):
                mkdir -p $@

        # Run definitions through the encoder.
        $(TARGET): $(OUTDIR) $(ENCODER) 
                @echo "Generating Output..."
                $(ENCODER) gen.def $(OUTDIR)

On initial glance, this looked adequate, until I realized that changing
the contents of a folder updates its modification time, causing most of
the world to be rebuilt.

Doing a bit of reading, it looks like I could use "-o file" on the
command line to mark my folders as ancient.  This would require me to
invoke a recursive make, as INTDIR and OUTDIR are defined
per-configuration within the makefile.  The crux of the matter is that I
want the normal "run rule if file does not exist" dependency behavior,
but not its "run rule if file modification date is greater than target"
companion.  I didn't see a special .ANCIENT target in the documentation.

Is there a better way to go about this task?  I'm currently
investigating modifying MAKEFLAGS inside my makefile to use the -o
switch.

Adam




reply via email to

[Prev in Thread] Current Thread [Next in Thread]