2637949699ff7110fa4af4a0691287f06ac1bdff
[openwrt.git] / package / base-files / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=base-files
6 PKG_RELEASE:=7
7 PKG_BUILD_DIR:=$(BUILD_DIR)/base-files
8
9 BOARD:=$(shell LANG=C grep ^CONFIG_LINUX_2_._ $(TOPDIR)/.config|sed -e "s/=y//" \
10 -e "s/.*_//"| tr "[:upper:]" "[:lower:]")
11 KERNEL:=$(shell LANG=C grep ^CONFIG_LINUX_2_._ $(TOPDIR)/.config|sed -e "s/=y//" \
12 -e "s/CONFIG_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 #FIXME: use the version from ./toolchain/uclibc
22 UCLIBC_VERSION:=0.9.28
23 LIBGCC_VERSION:=$(CONFIG_GCC_VERSION)
24
25 define Package/base-files
26 SECTION:=base
27 CATEGORY:=Base system
28 DEFAULT:=y
29 TITLE:=OpenWrt system scripts
30 DESCRIPTION:=OpenWrt system scripts
31 endef
32
33 define Package/libgcc
34 SECTION:=libs
35 CATEGORY:=Libraries
36 DEFAULT:=m, y if GCC_VERSION_4_0_2 || GCC_VERSION_4_0_3 || GCC_VERSION_4_1_0
37 TITLE:=GCC support library
38 VERSION:=$(LIBGCC_VERSION)-$(PKG_RELEASE)
39 DESCRIPTION:=$(TITLE)
40 endef
41
42 define Package/uclibc
43 $(call Package/base-files)
44 VERSION:=$(UCLIBC_VERSION)-$(PKG_RELEASE)
45 TITLE:=C library
46 DESCRIPTION:=C library for embedded systems
47 endef
48
49
50 define Build/Prepare
51 mkdir -p $(PKG_BUILD_DIR)
52 endef
53
54 define Build/Compile
55 endef
56
57 define Package/base-files/install
58 $(CP) ./default/* $(1)
59 $(SED) 's,$$$$R,r$(REV),g' $(1)/etc/banner
60 $(SED) 's,$$$$S,$(BOARD)-$(KERNEL),g' $(1)/etc/ipkg.conf
61 mkdir -p $(1)/dev
62 mkdir -p $(1)/etc/crontabs
63 mkdir -p $(1)/jffs
64 mkdir -p $(1)/lib
65 mkdir -p $(1)/mnt
66 mkdir -p $(1)/proc
67 mkdir -p $(1)/tmp
68 mkdir -p $(1)/usr/lib
69 mkdir -p $(1)/usr/bin
70 mkdir -p $(1)/sys
71 mkdir -p $(1)/www
72 ln -sf /tmp/resolv.conf $(1)/etc/resolv.conf
73 ln -sf /proc/mounts $(1)/etc/mtab
74 rm -f $(1)/var
75 ln -sf /tmp $(1)/var
76 -find $(1) -type d -name CVS | xargs rm -rf
77 -find $(1) -type d -name .svn | xargs rm -rf
78 -find $(1) -name '.#*' | xargs rm -f
79 mkdir -p $(1)/etc
80 endef
81
82 define Package/uclibc/install
83 mkdir -p $(1)/lib
84 for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil; do \
85 $(CP) $(STAGING_DIR)/lib/$$$$file.so.* $(1)/lib/; \
86 $(CP) $(STAGING_DIR)/lib/$$$$file-$(UCLIBC_VERSION).so $(1)/lib/; \
87 done
88 endef
89
90 define Package/libgcc/install
91 mkdir -p $(1)/lib
92 $(CP) $(STAGING_DIR)/lib/libgcc_s.so.* $(1)/lib/
93 endef
94
95 $(eval $(call BuildPackage,base-files))
96 $(eval $(call BuildPackage,libgcc))
97 $(eval $(call BuildPackage,uclibc))
This page took 0.055215 seconds and 3 git commands to generate.