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
)
38 TITLE
:=Base filesystem for OpenWrt
40 This package contains a base filesystem and system scripts for OpenWrt.
41 URL
:=http
://openwrt.org
/
42 VERSION
:=$(PKG_RELEASE
)-$(REV
)
45 define Package
/base-files
$(TARGET
)/conffiles
55 $(call
$(TARGET
)/conffiles
)
61 DEPENDS
:=@
!NATIVE_TOOLCHAIN
62 TITLE
:=GCC support library
63 URL
:=http
://gcc.gnu.org
/
64 VERSION
:=$(LIBGCC_VERSION
)-$(PKG_RELEASE
)
67 define Package
/libpthread
70 DEPENDS
:=@
!NATIVE_TOOLCHAIN
71 TITLE
:=POSIX thread library
72 URL
:=http
://uclibc.org
/
73 VERSION
:=$(UCLIBC_VERSION
)-$(PKG_RELEASE
)
79 DEPENDS
:=@
!NATIVE_TOOLCHAIN
80 TITLE
:=C library embedded systems
81 URL
:=http
://uclibc.org
/
82 VERSION
:=$(UCLIBC_VERSION
)-$(PKG_RELEASE
)
86 mkdir
-p
$(PKG_BUILD_DIR
)
89 define Build
/Compile
/Default
93 $(call Build
/Compile
/Default
)
96 define Package
/base-files
$(TARGET
)/install
98 if
[ -d
$(PLATFORM_DIR
)/base-files
/.
]; then \
99 $(CP
) $(PLATFORM_DIR
)/base-files
/* $(1)/; \
101 $(SED
) 's,$$$$R,r$(REV),g' $(1)/etc
/banner
102 $(SED
) 's,$$$$S,$(BOARD)-$(KERNEL),g' $(1)/etc
/ipkg.conf
104 mkdir
-p
$(1)/etc
/crontabs
110 mkdir
-p
$(1)/usr
/lib
111 mkdir
-p
$(1)/usr
/bin
114 ln
-sf
/proc
/mounts
$(1)/etc
/mtab
118 $(call Package
/base-files
/install-target
,$(1))
119 for conffile in
$(1)/etc
/config
/*; do \
120 if
[ -f
"$$$$conffile" ]; then \
121 grep
"$$$$conffile" $(1)/CONTROL
/conffiles || \
122 echo
"$$$${conffile##$(1)}" >> $(1)/CONTROL
/conffiles
; \
127 define Package
/libgcc
/install
128 $(INSTALL_DIR
) $(1)/lib
129 $(CP
) $(STAGING_DIR
)/lib
/libgcc_s.so.
* $(1)/lib
/
132 define Package
/libpthread
/install
133 $(INSTALL_DIR
) $(1)/lib
134 $(CP
) $(STAGING_DIR
)/lib
/libpthread.so.
* $(1)/lib
/
135 $(CP
) $(STAGING_DIR
)/lib
/libpthread-
$(UCLIBC_VERSION
).so
$(1)/lib
/
138 define Package
/uclibc
/install
139 $(INSTALL_DIR
) $(1)/lib
140 for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil
; do \
141 $(CP
) $(STAGING_DIR
)/lib
/$$$$file.so.
* $(1)/lib
/; \
142 $(CP
) $(STAGING_DIR
)/lib
/$$$$file-$(UCLIBC_VERSION
).so
$(1)/lib
/; \
147 -include $(PLATFORM_DIR
)/base-files.mk
150 $(eval
$(call BuildPackage
,base-files
$(TARGET
)))
151 $(eval
$(call BuildPackage
,libgcc
))
152 $(eval
$(call BuildPackage
,libpthread
))
153 $(eval
$(call BuildPackage
,uclibc
))