@ -9,23 +9,16 @@ curdir:=package
- i n c l u d e $( TMP_DIR ) / . p a c k a g e d e p s
$(curdir)/builddirs : =$( sort $ ( package -) $ ( package -y ) $ ( package -m ) )
$(curdir)/builddirs-install : =.
i f e q ( $( SDK ) , 1 )
$( curdir) /builddirs-install:= .
e l s e
$( curdir) /builddirs-default:= . $( sort $( package-y) $( package-m) )
$( curdir) /builddirs-prereq:= . $( sort $( prereq-y) $( prereq-m) )
$( curdir) /builddirs-install:= . $( filter-out base-files,$( sort $( package-y) ) ) $( filter base-files,$( package-y) )
e n d i f
i f n e q ( $( IGNORE_ERRORS ) , )
$( curdir) /builddirs-ignore-compile:= $( if $( filter n m y, $( IGNORE_ERRORS) ) ,$( foreach m,$( IGNORE_ERRORS) ,$( package-$( subst n,,$( m) ) ) ) ,$( package-m) $( package-) )
e n d i f
$(curdir)/install : =$( curdir ) /install -cleanup
$(curdir)/cleanup : $( TMP_DIR ) /.build
- find $( STAGING_DIR_ROOT) -type d | $( XARGS) chmod 0755
rm -rf $( TARGET_DIR) $( STAGING_DIR_ROOT)
i f d e f C O N F I G _ U S E _ M K L I B S
define mklibs
rm -rf $( TMP_DIR) /mklibs-progs $( TMP_DIR) /mklibs-out
@ -61,7 +54,36 @@ ifdef CONFIG_USE_MKLIBS
endef
e n d i f
$(curdir)/rootfs-prepare : $( TMP_DIR ) /.build
# where to build (and put) .ipk packages
OPKG := \
IPKG_TMP = $( TMP_DIR) /ipkg \
IPKG_INSTROOT = $( TARGET_DIR) \
IPKG_CONF_DIR = $( STAGING_DIR) /etc \
IPKG_OFFLINE_ROOT = $( TARGET_DIR) \
$( STAGING_DIR_HOST) /bin/opkg \
--offline-root $( TARGET_DIR) \
--force-depends \
--force-overwrite \
--force-postinstall \
--force-maintainer \
--add-dest root:/ \
--add-arch all:100 \
--add-arch $( if $( ARCH_PACKAGES) ,$( ARCH_PACKAGES) ,$( BOARD) ) :200
PACKAGE_INSTALL := $( sort $( foreach pkg,$( package-y) ,$( lastword $( subst /,$( space) ,$( pkg) ) ) ) )
PACKAGE_INSTALL_FILES := $( patsubst %,$( PKG_INFO_DIR) /%.install,$( PACKAGE_INSTALL) )
$(curdir)/install : $( TMP_DIR ) /.build
- find $( STAGING_DIR_ROOT) -type d | $( XARGS) chmod 0755
rm -rf $( TARGET_DIR) $( STAGING_DIR_ROOT)
[ -d $( TARGET_DIR) /tmp ] || mkdir -p $( TARGET_DIR) /tmp
$( OPKG) install ` cat $( PACKAGE_INSTALL_FILES) | sed -e 's,^\(.*\)$$,$(PACKAGE_DIR)/\1_*.ipk,' `
@for pkg in $( PACKAGE_INSTALL) ; do \
[ -s $( PKG_INFO_DIR) /$$ { pkg} .install.flags ] || continue ; \
for flag in ` cat $( PKG_INFO_DIR) /$$ { pkg} .install.flags` ; do \
$( OPKG) flag $$ flag ` cat $( PKG_INFO_DIR) /$$ { pkg} .install` ; \
done ; \
done || true
@-$( MAKE) package/preconfig
@if [ -d $( TOPDIR) /files ] ; then \
( cd $( TOPDIR) /files; find -type f ) | \
@ -94,12 +116,12 @@ $(curdir)/index: FORCE
gzip -9c Packages > Packages.gz \
)
$(curdir)/preconfig :
$(curdir)/flags-install : = -j 1
$( eval $ ( call stampfile ,$ ( curdir ) ,package ,prereq ,.config ) )
$( eval $ ( call stampfile ,$ ( curdir ) ,package ,cleanup ,$ ( TMP_DIR ) /.build ) )
$( eval $ ( call stampfile ,$ ( curdir ) ,package ,compile ,$ ( TMP_DIR ) /.build ) )
$( eval $ ( call stampfile ,$ ( curdir ) ,package ,install ,$ ( TMP_DIR ) /.build ) )
$( eval $ ( call stampfile ,$ ( curdir ) ,package ,rootfs -prepare ,$ ( TMP_DIR ) /.build ) )
$( eval $ ( call subdir ,$ ( curdir ) ) )