Skip to contentSkip to conversation

touch commands in Makefiles

DISCUSSION Brendan J Simon 3 participants 4 messages Jan 25, 2002 – Jan 28, 2002

lore
Share & tools
lore
#0 lore raw

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.

#1 lore raw
Quoted 1 line · Brendan J Simon

Why are header file touched in Makefiles ?

To handle the two level dependencies on CONFIG options. bar.c depends on foo.h which depends on CONFIG_BLIP. Change CONFIG_BLIP and the Makefiles touch foo.h which in turn recompiles bar.c.

Yes, it sucks with source repositories. Which is why kbuild 2.5 completely removes this "feature", with kbuild 2.5 you can build from a read only file system.

Quoted 2 lines

You then tell it which files you intend to modify and it will check those files out as read-write to the local sandbox.

Even easier with kbuild 2.5, it has shadow trees. You keep the base read only, copy the files to modify to a separate tree and kbuild 2.5 logically merges all the files.

http://sourceforge.net/projects/kbuild/

#2 lore raw
Quoted 4 lines · Keith Owens

Even easier with kbuild 2.5, it has shadow trees. You keep the base read only, copy the files to modify to a separate tree and kbuild 2.5 logically merges all the files.

Does it allow to compile more kernels each with its own config from one source tree?

Marian Jancar

#3 lore raw
Quoted 8 lines · Marian Jancar
Quoted 3 lines · Keith Owens

Even easier with kbuild 2.5, it has shadow trees. You keep the base read only, copy the files to modify to a separate tree and kbuild 2.5 logically merges all the files.

Does it allow to compile more kernels each with its own config from one source tree?

Yes, the .config is in the object directory. You can even compile for different architectures from the same source tree at the same time.