From patchwork Thu Feb 14 11:21:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Hoffmann X-Patchwork-Id: 220415 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 8ED5C2C007C for ; Thu, 14 Feb 2013 22:23:46 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D5333102451; Thu, 14 Feb 2013 11:23:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8Bl9RvooHCNb; Thu, 14 Feb 2013 11:23:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6CEE01017B9; Thu, 14 Feb 2013 11:23:22 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id C16B78F753 for ; Thu, 14 Feb 2013 11:23:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4C3228143D for ; Thu, 14 Feb 2013 11:23:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gtBbnRzmXAru for ; Thu, 14 Feb 2013 11:23:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.9]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0E9568B46B for ; Thu, 14 Feb 2013 11:22:02 +0000 (UTC) Received: from stephan-desktop (p5492DFDB.dip.t-dialin.net [84.146.223.219]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0LiIi3-1UkHv22SLz-00nLWF; Thu, 14 Feb 2013 12:21:59 +0100 Received: by stephan-desktop (Postfix, from userid 1000) id 9E34650130C; Thu, 14 Feb 2013 12:21:53 +0100 (CET) From: Stephan Hoffmann To: buildroot@busybox.net Date: Thu, 14 Feb 2013 12:21:53 +0100 Message-Id: <1360840913-10908-1-git-send-email-sho@relinux.de> X-Mailer: git-send-email 1.7.0.4 X-Provags-ID: V02:K0:X5zRhWYSLo4CqaWZPCoe3Mf9S8dkBsn5wSaD6+gNSS5 IHpLWQZsXSmz2obtRpa5EVP/T6pJ+mivo3qL1ru6VNFjhgvBQM PjN/ErEvdvE9E+K72pDSc+Owm+oQEdewQ4d2zIjmrG4qcqAwgv V+Sg1yLhiWGMvHiR8pWEXA3IcR2SA8K9gWVfx0JN4DvUwSR4fA MoLhrBUywnSmHMHpgJjvAF1N2uyGVNG2a3KW0la4cMJfKNBNut mGOjkaO5dJ6nNWxNiwyWBlTmzp+oc7/t/sKBgTvrixjRUEFCX3 nBEiavpRaMaRi5kd/XZHAB2heDrkCmyEXXuZtKzZFPaV4R8WqL PJfvHh9EFO42ewQ6qoqWuU1RYjS0s7huUm3jmf0q5eJnBf/izW IN74jNOKa01ag== Subject: [Buildroot] [PATCH] Manual: add empty line after header im .mk files X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Signed-off-by: Stephan Hoffmann --- docs/manual/adding-packages-autotools.txt | 33 ++++++------ docs/manual/adding-packages-cmake.txt | 33 ++++++------ docs/manual/adding-packages-generic.txt | 79 +++++++++++++++-------------- 3 files changed, 74 insertions(+), 71 deletions(-) diff --git a/docs/manual/adding-packages-autotools.txt b/docs/manual/adding-packages-autotools.txt index 84d76f9..81c833e 100644 --- a/docs/manual/adding-packages-autotools.txt +++ b/docs/manual/adding-packages-autotools.txt @@ -17,24 +17,25 @@ package, with an example : 03: # libfoo 04: # 05: ############################################################# -06: LIBFOO_VERSION = 1.0 -07: LIBFOO_SOURCE = libfoo-$(LIBFOO_VERSION).tar.gz -08: LIBFOO_SITE = http://www.foosoftware.org/download -09: LIBFOO_INSTALL_STAGING = YES -10: LIBFOO_INSTALL_TARGET = NO -11: LIBFOO_CONF_OPT = --disable-shared -12: LIBFOO_DEPENDENCIES = libglib2 host-pkgconf -13: -14: $(eval $(autotools-package)) +06: +07: LIBFOO_VERSION = 1.0 +08: LIBFOO_SOURCE = libfoo-$(LIBFOO_VERSION).tar.gz +09: LIBFOO_SITE = http://www.foosoftware.org/download +10: LIBFOO_INSTALL_STAGING = YES +11: LIBFOO_INSTALL_TARGET = NO +12: LIBFOO_CONF_OPT = --disable-shared +13: LIBFOO_DEPENDENCIES = libglib2 host-pkgconf +14: +15: $(eval $(autotools-package)) ------------------------ -On line 6, we declare the version of the package. +On line 7, we declare the version of the package. -On line 7 and 8, we declare the name of the tarball and the location +On line 8 and 9, we declare the name of the tarball and the location of the tarball on the Web. Buildroot will automatically download the tarball from this location. -On line 9, we tell Buildroot to install the package to the staging +On line 10, we tell Buildroot to install the package to the staging directory. The staging directory, located in +output/staging/+ is the directory where all the packages are installed, including their development files, etc. By default, packages are not installed to the @@ -44,7 +45,7 @@ other libraries or applications depending on them. Also by default, when staging installation is enabled, packages are installed in this location using the +make install+ command. -On line 10, we tell Buildroot to not install the package to the +On line 11, we tell Buildroot to not install the package to the target directory. This directory contains what will become the root filesystem running on the target. For purely static libraries, it is not necessary to install them in the target directory because they will @@ -52,14 +53,14 @@ not be used at runtime. By default, target installation is enabled; setting this variable to NO is almost never needed. Also by default, packages are installed in this location using the +make install+ command. -On line 11, we tell Buildroot to pass a custom configure option, that +On line 12, we tell Buildroot to pass a custom configure option, that will be passed to the +./configure+ script before configuring and building the package. -On line 12, we declare our dependencies, so that they are built +On line 13, we declare our dependencies, so that they are built before the build process of our package starts. -Finally, on line line 14, we invoke the +autotools-package+ +Finally, on line line 15, we invoke the +autotools-package+ macro that generates all the Makefile rules that actually allows the package to be built. diff --git a/docs/manual/adding-packages-cmake.txt b/docs/manual/adding-packages-cmake.txt index bb1705b..b904c28 100644 --- a/docs/manual/adding-packages-cmake.txt +++ b/docs/manual/adding-packages-cmake.txt @@ -17,24 +17,25 @@ with an example : 03: # libfoo 04: # 05: ############################################################# -06: LIBFOO_VERSION = 1.0 -07: LIBFOO_SOURCE = libfoo-$(LIBFOO_VERSION).tar.gz -08: LIBFOO_SITE = http://www.foosoftware.org/download -09: LIBFOO_INSTALL_STAGING = YES -10: LIBFOO_INSTALL_TARGET = NO -11: LIBFOO_CONF_OPT = -DBUILD_DEMOS=ON -12: LIBFOO_DEPENDENCIES = libglib2 host-pkgconf -13: -14: $(eval $(cmake-package)) +06: +07: LIBFOO_VERSION = 1.0 +08: LIBFOO_SOURCE = libfoo-$(LIBFOO_VERSION).tar.gz +09: LIBFOO_SITE = http://www.foosoftware.org/download +10: LIBFOO_INSTALL_STAGING = YES +11: LIBFOO_INSTALL_TARGET = NO +12: LIBFOO_CONF_OPT = -DBUILD_DEMOS=ON +13: LIBFOO_DEPENDENCIES = libglib2 host-pkgconf +14: +15: $(eval $(cmake-package)) ------------------------ -On line 6, we declare the version of the package. +On line 7, we declare the version of the package. -On line 7 and 8, we declare the name of the tarball and the location +On line 8 and 9, we declare the name of the tarball and the location of the tarball on the Web. Buildroot will automatically download the tarball from this location. -On line 9, we tell Buildroot to install the package to the staging +On line 10, we tell Buildroot to install the package to the staging directory. The staging directory, located in +output/staging/+ is the directory where all the packages are installed, including their development files, etc. By default, packages are not installed to the @@ -44,7 +45,7 @@ other libraries or applications depending on them. Also by default, when staging installation is enabled, packages are installed in this location using the +make install+ command. -On line 10, we tell Buildroot to not install the package to the +On line 11, we tell Buildroot to not install the package to the target directory. This directory contains what will become the root filesystem running on the target. For purely static libraries, it is not necessary to install them in the target directory because they will @@ -52,13 +53,13 @@ not be used at runtime. By default, target installation is enabled; setting this variable to NO is almost never needed. Also by default, packages are installed in this location using the +make install+ command. -On line 11, we tell Buildroot to pass custom options to CMake when it is +On line 12, we tell Buildroot to pass custom options to CMake when it is configuring the package. -On line 12, we declare our dependencies, so that they are built +On line 13, we declare our dependencies, so that they are built before the build process of our package starts. -Finally, on line line 14, we invoke the +cmake-package+ +Finally, on line line 15, we invoke the +cmake-package+ macro that generates all the Makefile rules that actually allows the package to be built. diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt index 7b8561a..f5d94d7 100644 --- a/docs/manual/adding-packages-generic.txt +++ b/docs/manual/adding-packages-generic.txt @@ -19,41 +19,42 @@ system is based on hand-written Makefiles or shell scripts. 03: # libfoo 04: # 05: ############################################################# -06: LIBFOO_VERSION = 1.0 -07: LIBFOO_SOURCE = libfoo-$(LIBFOO_VERSION).tar.gz -08: LIBFOO_SITE = http://www.foosoftware.org/download -09: LIBFOO_LICENSE = GPLv3+ -10: LIBFOO_LICENSE_FILES = COPYING -11: LIBFOO_INSTALL_STAGING = YES -12: LIBFOO_DEPENDENCIES = host-libaaa libbbb -13: -14: define LIBFOO_BUILD_CMDS -15: $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D) all -16: endef -17: -18: define LIBFOO_INSTALL_STAGING_CMDS -19: $(INSTALL) -D -m 0755 $(@D)/libfoo.a $(STAGING_DIR)/usr/lib/libfoo.a -20: $(INSTALL) -D -m 0644 $(@D)/foo.h $(STAGING_DIR)/usr/include/foo.h -21: $(INSTALL) -D -m 0755 $(@D)/libfoo.so* $(STAGING_DIR)/usr/lib -22: endef -23: -24: define LIBFOO_INSTALL_TARGET_CMDS -25: $(INSTALL) -D -m 0755 $(@D)/libfoo.so* $(TARGET_DIR)/usr/lib -26: $(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/foo.d -27: endef -28: -29: define LIBFOO_DEVICES -30: /dev/foo c 666 0 0 42 0 - - - -31: endef -32: -33: define LIBFOO_PERMISSIONS -34: /bin/foo f 4755 0 0 - - - - - -35: endef -36: -37: $(eval $(generic-package)) +06: +07: LIBFOO_VERSION = 1.0 +08: LIBFOO_SOURCE = libfoo-$(LIBFOO_VERSION).tar.gz +09: LIBFOO_SITE = http://www.foosoftware.org/download +10: LIBFOO_LICENSE = GPLv3+ +11: LIBFOO_LICENSE_FILES = COPYING +12: LIBFOO_INSTALL_STAGING = YES +13: LIBFOO_DEPENDENCIES = host-libaaa libbbb +14: +15: define LIBFOO_BUILD_CMDS +16: $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D) all +17: endef +18: +19: define LIBFOO_INSTALL_STAGING_CMDS +20: $(INSTALL) -D -m 0755 $(@D)/libfoo.a $(STAGING_DIR)/usr/lib/libfoo.a +21: $(INSTALL) -D -m 0644 $(@D)/foo.h $(STAGING_DIR)/usr/include/foo.h +22: $(INSTALL) -D -m 0755 $(@D)/libfoo.so* $(STAGING_DIR)/usr/lib +23: endef +24: +25: define LIBFOO_INSTALL_TARGET_CMDS +26: $(INSTALL) -D -m 0755 $(@D)/libfoo.so* $(TARGET_DIR)/usr/lib +27: $(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/foo.d +28: endef +29: +30: define LIBFOO_DEVICES +31: /dev/foo c 666 0 0 42 0 - - - +32: endef +33: +34: define LIBFOO_PERMISSIONS +35: /bin/foo f 4755 0 0 - - - - - +36: endef +37: +38: $(eval $(generic-package)) -------------------------------- -The Makefile begins on line 6 to 10 with metadata information: the +The Makefile begins on line 7 to 11 with metadata information: the version of the package (+LIBFOO_VERSION+), the name of the tarball containing the package (+LIBFOO_SOURCE+) the Internet location at which the tarball can be downloaded from @@ -63,20 +64,20 @@ the same prefix, +LIBFOO_+ in this case. This prefix is always the uppercased version of the package name (see below to understand where the package name is defined). -On line 11, we specify that this package wants to install something to +On line 12, we specify that this package wants to install something to the staging space. This is often needed for libraries, since they must install header files and other development files in the staging space. This will ensure that the commands listed in the +LIBFOO_INSTALL_STAGING_CMDS+ variable will be executed. -On line 12, we specify the list of dependencies this package relies +On line 13, we specify the list of dependencies this package relies on. These dependencies are listed in terms of lower-case package names, which can be packages for the target (without the +host-+ prefix) or packages for the host (with the +host-+) prefix). Buildroot will ensure that all these packages are built and installed 'before' the current package starts its configuration. -The rest of the Makefile, lines 14..27, defines what should be done +The rest of the Makefile, lines 15..28, defines what should be done at the different steps of the package configuration, compilation and installation. +LIBFOO_BUILD_CMDS+ tells what steps should be performed to @@ -89,13 +90,13 @@ All these steps rely on the +$(@D)+ variable, which contains the directory where the source code of the package has been extracted. -On line 29..31, we define a device-node file used by this package +On line 30..32, we define a device-node file used by this package (+LIBFOO_DEVICES+). -On line 33..35, we define the permissions to set to specific files +On line 34..36, we define the permissions to set to specific files installed by this package (+LIBFOO_PERMISSIONS+). -Finally, on line 37, we call the +generic-package+ function, which +Finally, on line 38, we call the +generic-package+ function, which generates, according to the variables defined previously, all the Makefile code necessary to make your package working.