convert base-files to new format
[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 define Package/base-files
22 SECTION:=base
23 CATEGORY:=Base system
24 DEFAULT:=y
25 TITLE:=OpenWrt system scripts
26 DESCRIPTION:=OpenWrt system scripts
27 endef
28
29
30 define Package/libgcc
31 SECTION:=libs
32 CATEGORY:=Libraries
33 DEFAULT:=m, y if GCC_VERSION_4_0_2 || GCC_VERSION_4_0_3 || GCC_VERSION_4_1_0
34 TITLE:=GCC support library
35 VERSION:=$(LIBGCC_VERSION)-$(PKG_RELEASE)
36 DESCRIPTION:=$(TITLE)
37 endef
38
39 define Package/uclibc
40 $(call Package/base-files)
41 VERSION:=$(UCLIBC_VERSION)-$(PKG_RELEASE)
42 TITLE:=C library
43 DESCRIPTION:=C library for embedded systems
44 endef
45
46
47 define Build/Prepare
48 mkdir -p $(PKG_BUILD_DIR)
49 endef
50
51 define Build/Compile
52 endef
53
54 define Package/base-files/install
55 $(CP) ./default/* $(1)
56 $(SED) 's,$$R,r$(REV),g' $(1)/etc/banner
57 $(SED) 's,$$S,$(BOARD)-$(KERNEL),g' $(1)/etc/ipkg.conf
58 mkdir -p $(1)/dev
59 mkdir -p $(1)/etc/crontabs
60 mkdir -p $(1)/jffs
61 mkdir -p $(1)/lib
62 mkdir -p $(1)/mnt
63 mkdir -p $(1)/proc
64 mkdir -p $(1)/tmp
65 mkdir -p $(1)/usr/lib
66 mkdir -p $(1)/usr/bin
67 mkdir -p $(1)/sys
68 mkdir -p $(1)/www
69 ln -sf /tmp/resolv.conf $(1)/etc/resolv.conf
70 ln -sf /proc/mounts $(1)/etc/mtab
71 rm -f $(1)/var
72 ln -sf /tmp $(1)/var
73 -find $(1) -type d -name CVS | xargs rm -rf
74 -find $(1) -type d -name .svn | xargs rm -rf
75 -find $(1) -name '.#*' | xargs rm -f
76 mkdir -p $(1)/etc
77 endef
78
79 define Package/uclibc/install
80 mkdir -p $(1)/lib
81 for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil; do \
82 $(CP) $(STAGING_DIR)/lib/$$file.so.* $(1)/lib/; \
83 $(CP) $(STAGING_DIR)/lib/$$file-$(UCLIBC_VERSION).so $(1)/lib/; \
84 done
85 endef
86
87 define Package/libgcc/install
88 mkdir -p $(IDIR_LIBGCC)/lib
89 $(CP) $(STAGING_DIR)/lib/libgcc_s.so.* $(IDIR_LIBGCC)/lib/
90 endef
91
92 $(eval $(call BuildPackage,base-files))
93 $(eval $(call BuildPackage,libgcc))
94 $(eval $(call BuildPackage,uclibc))
This page took 0.073738 seconds and 5 git commands to generate.