help-make
[Top][All Lists]
Advanced

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

make dependency question


From: Brendan J Simon
Subject: make dependency question
Date: Thu, 13 Jun 2002 15:49:54 +1000
User-agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:0.9.9) Gecko/20020414 Debian/0.9.9-6

Hi,

I have a build system that has a top level makefile and includes
multiple makefile fragments (module.mk) from each source subdirectory.
  I want the build to only rebuild the objects if the corresponding
source file or module.mk file has been touched.
eg. source tree
Makefile
src/foo/module.mk
src/foo/test1.c
src/foo/test2.c

I currently have the following generic rule in the Makefile.

build/%.o : src/%.c
     $(CC) -o $@ $(CFLAGS) $<

I was thinking something along the lines of:

build/%.o : src/%.c $(<D)/module.mk
or
build/%.o : src/%.c $(dir src/%.c)module.mk
or
build/%.o : src/%.c $(dir src/$*.c)module.mk

but none of these work.
Can anyone suggest another way of achieving the same thing.  I was
hoping to have a generic rule.

Please do reply-all to email me directly as well as the list.
Thanks,
Brendan Simon.







reply via email to

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