public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* touch commands in Makefiles
@ 2002-01-25  5:54 Brendan J Simon
  2002-01-26 10:38 ` Keith Owens
  0 siblings, 1 reply; 5+ messages in thread
From: Brendan J Simon @ 2002-01-25  5:54 UTC (permalink / raw)
  To: linux-kernel

Why are header file touched in Makefiles ?

The reason I ask is that I am using a configuration management system to 
maintain the linux kernel.  It "checks out" all source files read-only 
(actuall it uses symbolic links to a baseline directory which is 
read-only).  You then tell it which files you intend to modify and it 
will check those files out as read-write to the local sandbox.

When trying to do a "make zImage" some of the header files (eg. 
include/linux/types.h) are being touched by a dependency rule.  The 
build is failing as the files are readonly and can't be touched.  I 
don't understand why the header files need to be touched.  Surely the 
"make dep" should only generate rules to recompile .c files.

Thanks for any help explaining why header files need to be touched.
Regards,
Brendan Simon.



^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: touch commands in Makefiles
@ 2002-01-27  1:29 Peter Samuelson
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Samuelson @ 2002-01-27  1:29 UTC (permalink / raw)
  To: brendan.simon; +Cc: linux-kernel

[Brendan Simon]
> Why are header file touched in Makefiles ?

Dependency reasons.  Header files depend on whatever CONFIG options
they reference, and this is implemented via proxy header files.  Say
you have foo.c which includes foo_bar.h which makes a reference to
CONFIG_BAR.  The correct dep tree would be

  foo.o: foo.c foo_bar.h CONFIG_BAR

but, as it turned out, it was easier / more efficient to represent the
tree as

  foo.o: foo.c foo_bar.h
  foo_bar.h: CONFIG_BAR

This second tree is not strictly correct -- foo_bar.h does *not* in
fact need to be rebuilt when CONFIG_BAR changes -- so the 'touch'
commands are there to make it work correctly.

If you don't like it (and most of us don't!), you should patch your
tree with Keith Owens's 2.5 makefile structure, "kbuild-2.5".  It fixes
this problem (and many others).  It is hoped that kbuild-2.5 will be
merged with Linux 2.5 in the near future.

Peter

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-01-28  8:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-25  5:54 touch commands in Makefiles Brendan J Simon
2002-01-26 10:38 ` Keith Owens
2002-01-28  8:17   ` Marian Jancar
2002-01-28  8:20     ` Keith Owens
  -- strict thread matches above, loose matches on Subject: below --
2002-01-27  1:29 Peter Samuelson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox