2005-07-18 01:52:59 +03:00
|
|
|
# $Id$
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=base-files
|
2005-11-07 03:12:51 +02:00
|
|
|
PKG_RELEASE:=6
|
2005-07-24 22:58:14 +03:00
|
|
|
PKG_BUILD_DIR:=$(BUILD_DIR)/base-files
|
2005-07-18 01:52:59 +03:00
|
|
|
|
2005-12-25 02:56:25 +02:00
|
|
|
BOARD:=$(shell LANG=C grep ^BR2_LINUX_2 $(TOPDIR)/.config|sed -e "s/=y//" \
|
|
|
|
-e "s/.*_//"| tr "[:upper:]" "[:lower:]")
|
|
|
|
KERNEL:=$(shell LANG=C grep ^BR2_LINUX_2 $(TOPDIR)/.config|sed -e "s/=y//" \
|
|
|
|
-e "s/BR2_LINUX_//" -e "s/_BRCM//" -e "s/_/./"| tr "[:upper:]" "[:lower:]")
|
|
|
|
|
2005-11-27 21:59:03 +02:00
|
|
|
REV:=$(shell LANG=C svn info | awk '/^Revision:/ { print$$2 }' )
|
2005-10-22 19:34:35 +03:00
|
|
|
ifeq ($(REV),)
|
|
|
|
REV:=0
|
|
|
|
endif
|
|
|
|
|
2005-07-24 22:58:14 +03:00
|
|
|
include $(TOPDIR)/package/rules.mk
|
|
|
|
|
|
|
|
IDIR_BASE:=$(PKG_BUILD_DIR)/base-files
|
2005-07-18 01:52:59 +03:00
|
|
|
IPKG_BASE:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_RELEASE)_$(ARCH).ipk
|
|
|
|
|
2005-11-02 04:48:48 +02:00
|
|
|
UCLIBC_VERSION:=${shell cat $(STAGING_DIR)/uclibc_version}
|
|
|
|
IDIR_UCLIBC:=$(PKG_BUILD_DIR)/uclibc
|
|
|
|
IPKG_UCLIBC:=$(PACKAGE_DIR)/uclibc_$(UCLIBC_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
|
2005-07-18 01:52:59 +03:00
|
|
|
|
2005-11-02 04:48:48 +02:00
|
|
|
LIBGCC_VERSION:=${shell cat $(STAGING_DIR)/gcc_version}
|
|
|
|
IDIR_LIBGCC:=$(PKG_BUILD_DIR)/libgcc
|
|
|
|
IPKG_LIBGCC:=$(PACKAGE_DIR)/libgcc_$(LIBGCC_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
|
2005-07-18 01:52:59 +03:00
|
|
|
|
2006-01-04 10:37:19 +02:00
|
|
|
PACKAGES:=$(IPKG_BASE) $(IPKG_UCLIBC)
|
|
|
|
PACKAGES_INSTALL:=$(IPKG_BASE) $(IPKG_UCLIBC)
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_LIBGCC),y)
|
2006-01-20 16:11:31 +02:00
|
|
|
PACKAGES+=$(IPKG_LIBGCC)
|
2006-01-04 10:37:19 +02:00
|
|
|
PACKAGES_INSTALL+=$(IPKG_LIBGCC)
|
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_LIBGCC),m)
|
|
|
|
PACKAGES+=$(IPKG_LIBGCC)
|
|
|
|
endif
|
2005-07-18 01:52:59 +03:00
|
|
|
|
2005-07-24 22:58:14 +03:00
|
|
|
$(PKG_BUILD_DIR)/.prepared:
|
|
|
|
mkdir -p $(PKG_BUILD_DIR) $(PACKAGE_DIR)
|
|
|
|
touch $@
|
|
|
|
|
2005-11-07 20:12:11 +02:00
|
|
|
$(PKG_BUILD_DIR)/.configured:
|
|
|
|
touch $@
|
|
|
|
|
2005-07-24 22:58:14 +03:00
|
|
|
$(PKG_BUILD_DIR)/.built:
|
|
|
|
touch $@
|
2005-07-18 01:52:59 +03:00
|
|
|
|
2005-07-19 03:48:36 +03:00
|
|
|
$(IPKG_BASE):
|
2005-07-18 01:52:59 +03:00
|
|
|
$(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_BASE) ipkg/$(PKG_NAME).control $(PKG_RELEASE) $(ARCH)
|
2006-02-02 01:53:19 +02:00
|
|
|
$(CP) ./default/* $(IDIR_BASE)
|
2005-10-22 19:34:35 +03:00
|
|
|
$(SED) 's,$$R,r$(REV),g' $(IDIR_BASE)/etc/banner
|
2005-12-25 02:56:25 +02:00
|
|
|
$(SED) 's,$$S,$(BOARD)-$(KERNEL),g' $(IDIR_BASE)/etc/ipkg.conf
|
2006-02-01 12:47:17 +02:00
|
|
|
mkdir -p $(IDIR_BASE)/sys
|
2005-07-18 01:52:59 +03:00
|
|
|
mkdir -p $(IDIR_BASE)/jffs
|
|
|
|
mkdir -p $(IDIR_BASE)/dev
|
|
|
|
mkdir -p $(IDIR_BASE)/proc
|
|
|
|
mkdir -p $(IDIR_BASE)/tmp
|
|
|
|
mkdir -p $(IDIR_BASE)/lib
|
|
|
|
mkdir -p $(IDIR_BASE)/usr/lib
|
|
|
|
mkdir -p $(IDIR_BASE)/usr/bin
|
|
|
|
ln -sf /tmp/resolv.conf $(IDIR_BASE)/etc/resolv.conf
|
|
|
|
rm -rf $(IDIR_BASE)/var
|
|
|
|
ln -sf /tmp $(IDIR_BASE)/var
|
|
|
|
-find $(IDIR_BASE) -type d -name CVS | xargs rm -rf
|
|
|
|
-find $(IDIR_BASE) -type d -name .svn | xargs rm -rf
|
2005-08-27 18:40:56 +03:00
|
|
|
-find $(IDIR_BASE) -name '.#*' | xargs rm -f
|
2005-07-18 01:52:59 +03:00
|
|
|
mkdir -p $(IDIR_BASE)/etc
|
|
|
|
-grep \^BR2_SYSCONF $(TOPDIR)/.config > $(IDIR_BASE)/etc/sysconf
|
|
|
|
$(IPKG_BUILD) $(IDIR_BASE) $(PACKAGE_DIR)
|
|
|
|
|
2005-11-02 04:48:48 +02:00
|
|
|
$(IPKG_UCLIBC):
|
|
|
|
$(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_UCLIBC) ipkg/uclibc.control $(UCLIBC_VERSION)-$(PKG_RELEASE) $(ARCH)
|
|
|
|
mkdir -p $(IDIR_UCLIBC)/lib
|
|
|
|
for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil; do \
|
2006-02-02 01:53:19 +02:00
|
|
|
$(CP) $(STAGING_DIR)/lib/$$file.so.* $(IDIR_UCLIBC)/lib/; \
|
|
|
|
$(CP) $(STAGING_DIR)/lib/$$file-$(UCLIBC_VERSION).so $(IDIR_UCLIBC)/lib/; \
|
2005-07-18 01:52:59 +03:00
|
|
|
done
|
2005-11-02 04:48:48 +02:00
|
|
|
-$(STRIP) $(IDIR_UCLIBC)/lib/*
|
|
|
|
$(IPKG_BUILD) $(IDIR_UCLIBC) $(PACKAGE_DIR)
|
2005-07-18 01:52:59 +03:00
|
|
|
|
2005-11-02 04:48:48 +02:00
|
|
|
$(IPKG_LIBGCC):
|
|
|
|
$(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_LIBGCC) ipkg/libgcc.control $(LIBGCC_VERSION)-$(PKG_RELEASE) $(ARCH)
|
|
|
|
mkdir -p $(IDIR_LIBGCC)/lib
|
2006-02-02 01:53:19 +02:00
|
|
|
$(CP) $(STAGING_DIR)/lib/libgcc_s.so.* $(IDIR_LIBGCC)/lib/
|
2005-11-02 04:48:48 +02:00
|
|
|
-$(STRIP) $(IDIR_LIBGCC)/lib/*
|
|
|
|
$(IPKG_BUILD) $(IDIR_LIBGCC) $(PACKAGE_DIR)
|
2005-07-18 01:52:59 +03:00
|
|
|
|
2005-08-15 13:43:09 +03:00
|
|
|
package-clean:
|
|
|
|
rm -f $(PACKAGES)
|
2005-10-22 15:12:59 +03:00
|
|
|
|
|
|
|
clean-targets: package-clean
|
2005-07-18 01:52:59 +03:00
|
|
|
prepare:
|
2005-10-22 15:12:59 +03:00
|
|
|
compile-targets: $(PACKAGES)
|
|
|
|
install-targets: compile
|
2005-07-18 01:52:59 +03:00
|
|
|
mkdir -p $(TARGET_DIR)
|
2006-01-04 10:37:19 +02:00
|
|
|
$(IPKG) install $(PACKAGES_INSTALL)
|