help-make
[Top][All Lists]
Advanced

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

auto-generated dependencies...?


From: Rick Flower
Subject: auto-generated dependencies...?
Date: Wed, 17 Dec 2008 10:49:14 -0800 (PST)
User-agent: SquirrelMail/1.4.10a

Hi all..

I've got some unit test Makefiles that will be strewn about a large
directory tree and in a handful of the Makefiles, the need will arise to
make a local copy of a file that resides elsewhere in the source tree and
apply a patch to it to allow some off-nominal handling of the code (to
force failures,etc).

To that end, in each unit test Makefile that needs this 'patch' gizmo,
I've got lines like the following added :

PATCH_SOURCES = \
        ${TOP_DIR}/foo/bar/baz/foobarbaz.cc

For each case like this, I'd like to be able to have some sort of rule that
can generate something like the following (which I currently hand-code into
the each unit-test Makefile) :

foobarbaz.cc : ${TOP_DIR}/foo/bar/baz/foobarbaz.cc
      cp $< $@
      chmod +w $@
      /usr/local/bin/patch <address@hidden

The above rule will make a local copy of the file that lives elsewhere
and then apply the patch called foobarbaz.cc.diff to it.  After that is
done, it's compiled along with the rest of the unit test files..

Ultimately, I'd like to find an automated way to generate some Makefile
magic that can allow me move the patch rules into a central Makefile
instead of repeating the same sort of steps over and over in each unit test
Makefile, all without the need to hard-code paths and file names..  But,
I'm not sure if this is possible or not..

Many thanks in advance!







reply via email to

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