From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751898AbaJANgL (ORCPT ); Wed, 1 Oct 2014 09:36:11 -0400 Received: from hofr.at ([212.69.189.236]:47529 "EHLO mail.hofr.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751452AbaJANgJ (ORCPT ); Wed, 1 Oct 2014 09:36:09 -0400 Date: Wed, 1 Oct 2014 15:36:08 +0200 From: Nicholas Mc Guire To: Randy Dunlap , Michal Marek Cc: Christoph Hellwig , Joe Perches , LKML Subject: [PATCH 1/3] handling of _shipped files Message-ID: <20141001133608.GB5560@opentech.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org handling of _shipped files This adds a section on handling of _shipped files in kbuild Makefiles and the build process. Signed-off-by: Nicholas Mc Guire --- Documentation/kbuild/makefiles.txt | 57 +++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index 764f599..d0bd91a 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt @@ -19,6 +19,7 @@ This document describes the Linux kernel Makefiles. --- 3.10 Special Rules --- 3.11 $(CC) support functions --- 3.12 $(LD) support functions + --- 3.13 _shipped - generated files === 4 Host Program support --- 4.1 Simple Host Program @@ -595,6 +596,60 @@ more details, with real examples. LDFLAGS_vmlinux += $(call ld-option, -X) +--- 3.13 _shipped - generated files + + Some sources in the kernel are generated by tools or special + purpose scrips so that the build process dependencies can be kept + at a resonable level. Also in cases where the translation is not + configuration dependent but might impact build time _shipped files + may be added along with the actual sources to speed up the build + process. + + For standard tools like lex and yacc the make process will actually + generate the _shipped files (see scripts/Makefile.lib) and retain + them by marking them .PRECIOUS so they are not removed by the clean + targets. + + For non standard tools the generation of the _shipped file it self + may be manually achived by building and then renaming. A makefile + target for generate the actual target file should to be provided + though and can be conditioned on an environment variable. + + Example: + ifdef GENERATE_KEYMAP + + $(obj)/defkeymap.c: $(obj)/%.c: $(src)/%.map + loadkeys --mktable $< > $@ + + endif + + The _shipped file does not appear in the actual Makefile, this is + handled by the rules found in scripts/Makefile.lib. + + + cmd_shipped = cat $< > $@ + + $(obj)/%: $(src)/%_shipped + $(call cmd,shipped) + + + which simply will copy the target_shipped to the target + + If a file of a make target is found in the build directory with the + extension _shipped make will used it, rather than generating the + respective target file from source. + + The build will indicate the use of the _shipped file by the SHIPPED + quiet command in the make output. + + Example: + LD drivers/scsi/aic7xxx/built-in.o + SHIPPED drivers/scsi/aic7xxx/aic79xx_seq.h + SHIPPED drivers/scsi/aic7xxx/aic79xx_reg.h + CC [M] drivers/scsi/aic7xxx/aic79xx_core.o + CC [M] drivers/scsi/aic7xxx/aic79xx_pci.o + SHIPPED drivers/scsi/aic7xxx/aic79xx_reg_print.c + CC [M] drivers/scsi/aic7xxx/aic79xx_reg_print.o === 4 Host Program support Kbuild supports building executables on the host for use during the @@ -1423,10 +1478,10 @@ Original version made by Michael Elizabeth Chastain, Updates by Kai Germaschewski Updates by Sam Ravnborg Language QA by Jan Engelhardt +Kbuild support for shipped files Nicholas Mc Guire === 11 TODO -- Describe how kbuild supports shipped files with _shipped. - Generating offset header files. - Add more variables to section 7? -- 1.7.10.4