2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
10 include $(INCLUDE_DIR
)/kernel.mk
14 PKG_BUILD_DIR
:=$(KERNEL_BUILD_DIR
)/base-files
16 REV
:=$(shell LANG
=C svn
info | awk
'/^Revision:/ { print$$2 }' )
21 include $(INCLUDE_DIR
)/package.mk
24 TARGET
:=-$(BOARD
)-$(KERNEL
)
25 UCLIBC_VERSION
:=${shell cat
$(STAGING_DIR
)/uclibc_version
}
26 LIBGCC_VERSION
:=${shell cat
$(STAGING_DIR
)/gcc_version
}
28 UCLIBC_VERSION
:=<UCLIBC_VERSION
>
29 LIBGCC_VERSION
:=<LIBGCC_VERSION
>
32 CONFIG_PACKAGE_base-files
$(TARGET
):=$(CONFIG_PACKAGE_base-files
)
34 define Package
/base-files
$(TARGET
)
38 TITLE
:=OpenWrt system scripts
39 DESCRIPTION
:=Base filesystem for OpenWrt
40 VERSION
:=$(PKG_RELEASE
)-$(REV
)
43 define -ar7-2.4
/conffiles
47 define -aruba-2.6
/conffiles
51 define -au1000-2.6
/conffiles
55 define -rb532-2.6
/conffiles
59 define -sibyte-2.6
/conffiles
63 define -x86-2.6
/conffiles
67 define -xscale-2.6
/conffiles
72 define Package
/base-files
$(TARGET
)/conffiles
82 $(call
$(TARGET
)/conffiles
)
89 TITLE
:=GCC support library
90 VERSION
:=$(LIBGCC_VERSION
)-$(PKG_RELEASE
)
94 define Package
/libpthread
95 $(call Package
/base-files
$(TARGET
))
97 VERSION
:=$(UCLIBC_VERSION
)-$(PKG_RELEASE
)
98 TITLE
:=POSIX thread library
99 DESCRIPTION
:=POSIX thread library
103 define Package
/uclibc
104 $(call Package
/base-files
$(TARGET
))
105 VERSION
:=$(UCLIBC_VERSION
)-$(PKG_RELEASE
)
107 DESCRIPTION
:=C library for embedded systems
111 mkdir
-p
$(PKG_BUILD_DIR
)
115 define Build
/Compile
/ar7
116 $(TARGET_CC
) -o
$(PKG_BUILD_DIR
)/adam2patcher src
/adam2patcher.c
119 define Build
/Compile
/brcm
120 $(TARGET_CC
) -o
$(PKG_BUILD_DIR
)/jffs2root src
/jffs2root.c
124 $(call Build
/Compile
/$(BOARD
))
128 define Package
/base-files
$(TARGET
)/install-ar7
130 $(CP
) $(PKG_BUILD_DIR
)/adam2patcher
$(1)/sbin
132 define Package
/base-files
$(TARGET
)/install-brcm
134 $(CP
) $(PKG_BUILD_DIR
)/jffs2root
$(1)/sbin
137 define Package
/base-files
$(TARGET
)/install
138 $(call Package
/base-files
$(TARGET
)/install-
$(BOARD
),$(1))
139 $(CP
) .
/default
/* $(1)/
140 if
[ -d
$(BOARD
)-$(KERNEL
) ]; then \
141 $(CP
) $(BOARD
)-$(KERNEL
)/* $(1)/; \
143 $(SED
) 's,$$$$R,r$(REV),g' $(1)/etc
/banner
144 $(SED
) 's,$$$$S,$(BOARD)-$(KERNEL),g' $(1)/etc
/ipkg.conf
146 mkdir
-p
$(1)/etc
/crontabs
152 mkdir
-p
$(1)/usr
/lib
153 mkdir
-p
$(1)/usr
/bin
156 ln
-sf
/tmp
/resolv.conf
$(1)/etc
/resolv.conf
157 ln
-sf
/proc
/mounts
$(1)/etc
/mtab
163 define Package
/libgcc
/install
164 install -m0755
-d
$(1)/lib
165 $(CP
) $(STAGING_DIR
)/lib
/libgcc_s.so.
* $(1)/lib
/
168 define Package
/libpthread
/install
169 install -m0755
-d
$(1)/lib
170 $(CP
) $(STAGING_DIR
)/lib
/libpthread.so.
* $(1)/lib
/
171 $(CP
) $(STAGING_DIR
)/lib
/libpthread-
$(UCLIBC_VERSION
).so
$(1)/lib
/
174 define Package
/uclibc
/install
175 install -m0755
-d
$(1)/lib
176 for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil
; do \
177 $(CP
) $(STAGING_DIR
)/lib
/$$$$file.so.
* $(1)/lib
/; \
178 $(CP
) $(STAGING_DIR
)/lib
/$$$$file-$(UCLIBC_VERSION
).so
$(1)/lib
/; \
182 $(eval
$(call BuildPackage
,base-files
$(TARGET
)))
183 $(eval
$(call BuildPackage
,libgcc
))
184 $(eval
$(call BuildPackage
,libpthread
))
185 $(eval
$(call BuildPackage
,uclibc
))