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
15 PKG_BUILD_DIR
:=$(KERNEL_BUILD_DIR
)/$(PKG_NAME
)
17 REV
:=$(shell LANG
=C svn
info | awk
'/^Revision:/ { print$$2 }' )
22 include $(INCLUDE_DIR
)/package.mk
25 TARGET
:=-$(BOARD
)-$(KERNEL
)
26 UCLIBC_VERSION
:=${shell cat
$(STAGING_DIR
)/uclibc_version
2>/dev
/null
}
27 LIBGCC_VERSION
:=${shell cat
$(STAGING_DIR
)/gcc_version
2>/dev
/null
}
29 UCLIBC_VERSION
:=<UCLIBC_VERSION
>
30 LIBGCC_VERSION
:=<LIBGCC_VERSION
>
33 CONFIG_PACKAGE_base-files
$(TARGET
):=$(CONFIG_PACKAGE_base-files
)
35 define Package
/base-files
$(TARGET
)
39 TITLE
:=Base filesystem for OpenWrt
41 This package contains a base filesystem and system scripts for OpenWrt.
42 URL
:=http
://openwrt.org
/
43 VERSION
:=$(PKG_RELEASE
)-$(REV
)
46 define -ar7-2.4
/conffiles
50 define -aruba-2.6
/conffiles
54 define -au1000-2.6
/conffiles
58 define -rb532-2.6
/conffiles
62 define -sibyte-2.6
/conffiles
66 define -x86-2.6
/conffiles
70 define -xscale-2.6
/conffiles
74 define Package
/base-files
$(TARGET
)/conffiles
84 $(call
$(TARGET
)/conffiles
)
91 DEPENDS
:=@
!NATIVE_TOOLCHAIN
92 TITLE
:=GCC support library
93 URL
:=http
://gcc.gnu.org
/
94 VERSION
:=$(LIBGCC_VERSION
)-$(PKG_RELEASE
)
97 define Package
/libpthread
100 DEPENDS
:=@
!NATIVE_TOOLCHAIN
101 TITLE
:=POSIX thread library
102 URL
:=http
://uclibc.org
/
103 VERSION
:=$(UCLIBC_VERSION
)-$(PKG_RELEASE
)
106 define Package
/uclibc
108 CATEGORY
:=Base system
110 DEPENDS
:=@
!NATIVE_TOOLCHAIN
111 TITLE
:=C library embedded systems
112 URL
:=http
://uclibc.org
/
113 VERSION
:=$(UCLIBC_VERSION
)-$(PKG_RELEASE
)
117 mkdir
-p
$(PKG_BUILD_DIR
)
120 define Build
/Compile
/ar7
121 $(TARGET_CC
) -o
$(PKG_BUILD_DIR
)/adam2patcher src
/adam2patcher.c
124 define Build
/Compile
/brcm
125 $(TARGET_CC
) -o
$(PKG_BUILD_DIR
)/jffs2root src
/jffs2root.c
129 $(call Build
/Compile
/$(BOARD
))
133 define Package
/base-files
$(TARGET
)/install-ar7
135 $(CP
) $(PKG_BUILD_DIR
)/adam2patcher
$(1)/sbin
138 define Package
/base-files
$(TARGET
)/install-brcm
139 rm -f
$(1)/etc
/config
/network
141 $(CP
) $(PKG_BUILD_DIR
)/jffs2root
$(1)/sbin
144 define Package
/base-files
$(TARGET
)/install
145 $(CP
) .
/default
/* $(1)/
146 if
[ -d
$(BOARD
)-$(KERNEL
) ]; then \
147 $(CP
) $(BOARD
)-$(KERNEL
)/* $(1)/; \
149 $(SED
) 's,$$$$R,r$(REV),g' $(1)/etc
/banner
150 $(SED
) 's,$$$$S,$(BOARD)-$(KERNEL),g' $(1)/etc
/ipkg.conf
152 mkdir
-p
$(1)/etc
/crontabs
158 mkdir
-p
$(1)/usr
/lib
159 mkdir
-p
$(1)/usr
/bin
162 ln
-sf
/proc
/mounts
$(1)/etc
/mtab
166 $(call Package
/base-files
$(TARGET
)/install-
$(BOARD
),$(1))
169 define Package
/libgcc
/install
170 install -m0755
-d
$(1)/lib
171 $(CP
) $(STAGING_DIR
)/lib
/libgcc_s.so.
* $(1)/lib
/
174 define Package
/libpthread
/install
175 install -m0755
-d
$(1)/lib
176 $(CP
) $(STAGING_DIR
)/lib
/libpthread.so.
* $(1)/lib
/
177 $(CP
) $(STAGING_DIR
)/lib
/libpthread-
$(UCLIBC_VERSION
).so
$(1)/lib
/
180 define Package
/uclibc
/install
181 install -m0755
-d
$(1)/lib
182 for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil
; do \
183 $(CP
) $(STAGING_DIR
)/lib
/$$$$file.so.
* $(1)/lib
/; \
184 $(CP
) $(STAGING_DIR
)/lib
/$$$$file-$(UCLIBC_VERSION
).so
$(1)/lib
/; \
188 $(eval
$(call BuildPackage
,base-files
$(TARGET
)))
189 $(eval
$(call BuildPackage
,libgcc
))
190 $(eval
$(call BuildPackage
,libpthread
))
191 $(eval
$(call BuildPackage
,uclibc
))