add hotplug stuff to trunk/
[openwrt.git] / openwrt / package / base-files / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=base-files
6 PKG_RELEASE:=6
7 PKG_BUILD_DIR:=$(BUILD_DIR)/base-files
8
9 REV:=${shell svn info | grep Revision | cut -d ' ' -f 2}
10 ifeq ($(REV),)
11 REV:=0
12 endif
13
14 include $(TOPDIR)/package/rules.mk
15
16 IDIR_BASE:=$(PKG_BUILD_DIR)/base-files
17 IPKG_BASE:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_RELEASE)_$(ARCH).ipk
18
19 UCLIBC_VERSION:=${shell cat $(STAGING_DIR)/uclibc_version}
20 IDIR_UCLIBC:=$(PKG_BUILD_DIR)/uclibc
21 IPKG_UCLIBC:=$(PACKAGE_DIR)/uclibc_$(UCLIBC_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
22
23 LIBGCC_VERSION:=${shell cat $(STAGING_DIR)/gcc_version}
24 IDIR_LIBGCC:=$(PKG_BUILD_DIR)/libgcc
25 IPKG_LIBGCC:=$(PACKAGE_DIR)/libgcc_$(LIBGCC_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
26
27 PACKAGES:=$(IPKG_BASE) $(IPKG_UCLIBC) $(IPKG_LIBGCC)
28
29 $(PKG_BUILD_DIR)/.prepared:
30 mkdir -p $(PKG_BUILD_DIR) $(PACKAGE_DIR)
31 touch $@
32
33 $(PKG_BUILD_DIR)/.built:
34 touch $@
35
36 $(IPKG_BASE):
37 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_BASE) ipkg/$(PKG_NAME).control $(PKG_RELEASE) $(ARCH)
38 cp -a ./default/* $(IDIR_BASE)
39 $(SED) 's,$$R,r$(REV),g' $(IDIR_BASE)/etc/banner
40 mkdir -p $(IDIR_BASE)/jffs
41 mkdir -p $(IDIR_BASE)/dev
42 mkdir -p $(IDIR_BASE)/proc
43 mkdir -p $(IDIR_BASE)/tmp
44 mkdir -p $(IDIR_BASE)/lib
45 mkdir -p $(IDIR_BASE)/usr/lib
46 mkdir -p $(IDIR_BASE)/usr/bin
47 ln -sf /tmp/resolv.conf $(IDIR_BASE)/etc/resolv.conf
48 rm -rf $(IDIR_BASE)/var
49 ln -sf /tmp $(IDIR_BASE)/var
50 -find $(IDIR_BASE) -type d -name CVS | xargs rm -rf
51 -find $(IDIR_BASE) -type d -name .svn | xargs rm -rf
52 -find $(IDIR_BASE) -name '.#*' | xargs rm -f
53 mkdir -p $(IDIR_BASE)/etc
54 -grep \^BR2_SYSCONF $(TOPDIR)/.config > $(IDIR_BASE)/etc/sysconf
55 $(IPKG_BUILD) $(IDIR_BASE) $(PACKAGE_DIR)
56
57 $(IPKG_UCLIBC):
58 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_UCLIBC) ipkg/uclibc.control $(UCLIBC_VERSION)-$(PKG_RELEASE) $(ARCH)
59 mkdir -p $(IDIR_UCLIBC)/lib
60 for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil; do \
61 cp -fpR $(STAGING_DIR)/lib/$$file.so.* $(IDIR_UCLIBC)/lib/; \
62 cp -fpR $(STAGING_DIR)/lib/$$file-$(UCLIBC_VERSION).so $(IDIR_UCLIBC)/lib/; \
63 done
64 -$(STRIP) $(IDIR_UCLIBC)/lib/*
65 $(IPKG_BUILD) $(IDIR_UCLIBC) $(PACKAGE_DIR)
66
67 $(IPKG_LIBGCC):
68 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_LIBGCC) ipkg/libgcc.control $(LIBGCC_VERSION)-$(PKG_RELEASE) $(ARCH)
69 mkdir -p $(IDIR_LIBGCC)/lib
70 cp -fpR $(STAGING_DIR)/lib/libgcc_s.so.* $(IDIR_LIBGCC)/lib/
71 -$(STRIP) $(IDIR_LIBGCC)/lib/*
72 $(IPKG_BUILD) $(IDIR_LIBGCC) $(PACKAGE_DIR)
73
74 package-clean:
75 rm -f $(PACKAGES)
76
77 clean-targets: package-clean
78 prepare:
79 compile-targets: $(PACKAGES)
80 install-targets: compile
81 mkdir -p $(TARGET_DIR)
82 $(IPKG) install $(PACKAGES)
This page took 0.044644 seconds and 5 git commands to generate.