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