document Build/UninstallDev
[openwrt/svn-archive/archive.git] / docs / build.tex
index 03bd1a967585078c29ba4e11435b34486cb433f7..d2d74592fd1f9097ecc12e8cba2eaf428a5c068e 100644 (file)
@@ -202,12 +202,6 @@ simplifies the entire ordeal.
 Here for example, is \texttt{package/bridge/Makefile}:
 
 \begin{Verbatim}[frame=single,numbers=left]
-#
-# Copyright (C) 2006 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 # $Id: Makefile 5624 2006-11-23 00:29:07Z nbd $
 
 include $(TOPDIR)/rules.mk
@@ -229,12 +223,14 @@ define Package/bridge
   SECTION:=net
   CATEGORY:=Base system
   TITLE:=Ethernet bridging configuration utility
-  DESCRIPTION:=\
-    Manage ethernet bridging: a way to connect networks together to \\\
-    form a larger network.
   URL:=http://bridge.sourceforge.net/
 endef
 
+define Package/bridge/description
+  Manage ethernet bridging: 
+  a way to connect networks together to form a larger network.
+endef
+
 define Build/Configure
     $(call Build/Configure/Default, \
         --with-linux-headers="$(LINUX_DIR)" \
@@ -346,6 +342,25 @@ directly as the Nth argument to \texttt{BuildPackage}.
           Contains all environment variables that are passed to the make command
    \end{itemize}
 
+\textbf{\texttt{Build/InstallDev} (optional):} \\
+       If your package provides a library that needs to be made available to other packages,
+       you can use the \texttt{Build/InstallDev} template to copy it into the staging directory
+       which is used to collect all files that other packages might depend on at build time.
+       When it is called by the build system, two parameters are passed to it. \texttt{\$(1)} points to
+       the regular staging dir, typically \texttt{staging\_dir/\textit{ARCH}}, while \texttt{\$(2)} points
+       to \texttt{staging\_dir/host}. The host staging dir is only used for binaries, which are
+       to be executed or linked against on the host and its \texttt{bin/} subdirectory is included
+       in the \texttt{PATH} which is passed down to the build system processes.
+       Please use \texttt{\$(1)} and \texttt{\$(2)} here instead of the build system variables
+       \texttt{\$(STAGING\_DIR)} and \texttt{\$(STAGING\_DIR\_HOST)}, because the build system behavior
+       when staging libraries might change in the future to include automatic uninstallation.
+
+\textbf{\texttt{Build/UninstallDev} (optional):} \\
+       If your package uses \texttt{Build/InstallDev}, you can use this template to tell the
+       build system how to remove the staged files when \texttt{package/\textit{name}/clean} is run.
+
+       It takes the same parameters as \texttt{Build/InstallDev}
+
 \textbf{\texttt{Package/\textit{<name>}/install}:} \\
    A set of commands to copy files out of the compiled source and into the ipkg
    which is represented by the \texttt{\$(1)} directory. Note that there are currently
@@ -384,12 +399,6 @@ For external kernel modules, you can add them to the build system just like if t
 Here for instance the Makefile for the I2C subsytem kernel modules :
 
 \begin{Verbatim}[frame=single,numbers=left]
-#
-# Copyright (C) 2006 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 # $Id $
 
 I2CMENU:=I2C Bus
@@ -398,8 +407,7 @@ define KernelPackage/i2c-core
   TITLE:=I2C support
   DESCRIPTION:=Kernel modules for i2c support
   SUBMENU:=$(I2CMENU)
-  KCONFIG:=$(CONFIG_I2C_CORE) \
-        $(CONFIG_I2C_DEV)
+  KCONFIG:=CONFIG_I2C_CORE CONFIG_I2C_DEV
   FILES:=$(MODULES_DIR)/kernel/drivers/i2c/*.$(LINUX_KMOD_SUFFIX)
   AUTOLOAD:=$(call AutoLoad,50,i2c-core i2c-dev)
 endef