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_FILE_DEPEND
:=$(PLATFORM_DIR
)/ $(GENERIC_PLATFORM_DIR
)/base-files
/
17 REV
:=$(shell LANG
=C svn
info | awk
'/^Revision:/ { print$$2 }' )
21 include $(INCLUDE_DIR
)/package.mk
24 TARGET
:=-$(BOARD
)-$(KERNEL
)
25 LIBGCC_VERSION
:=$(GCC_VERSION
)
27 UCLIBC_VERSION
:=<UCLIBC_VERSION
>
28 LIBGCC_VERSION
:=<LIBGCC_VERSION
>
31 CONFIG_PACKAGE_base-files
$(TARGET
):=$(CONFIG_PACKAGE_base-files
)
33 define Package
/base-files
$(TARGET
)
36 TITLE
:=Base filesystem for OpenWrt
38 This package contains a base filesystem and system scripts for OpenWrt.
39 URL
:=http
://openwrt.org
/
40 VERSION
:=$(PKG_RELEASE
)-$(REV
)
41 $(call Config
,network.lan.proto
,string
,static
,LAN Protocol
)
42 $(call Config
,network.lan.ipaddr
,ip
,192.168.1.1,LAN IP Address
)
43 $(call Config
,network.lan.netmask
,netmask
,255.255.255.0,LAN Network Mask
)
44 $(call Config
,network.lan.gateway
,ip
,,LAN Gateway
)
45 $(call Config
,network.lan.dns
,ip
,,LAN DNS server
)
48 define Package
/base-files
$(TARGET
)/conffiles
58 $(call
$(TARGET
)/conffiles
)
61 define Package
/gcc
/Default
64 DEPENDS
:=@
!NATIVE_TOOLCHAIN
65 URL
:=http
://gcc.gnu.org
/
66 VERSION
:=$(LIBGCC_VERSION
)-$(PKG_RELEASE
)
70 $(call Package
/gcc
/Default
)
71 TITLE
:=GCC support library
72 DEPENDS
:=@
!TARGET_AVR32 @
!NATIVE_TOOLCHAIN
76 $(call Package
/gcc
/Default
)
77 TITLE
:=GCC support library
80 define Package
/libstdcpp
81 $(call Package
/gcc
/Default
)
83 TITLE
:=GNU Standard C
++ Library v3
84 DEPENDS
:=@
!NATIVE_TOOLCHAIN
&&@INSTALL_LIBSTDCPP
87 define Package
/uclibc
/Default
90 DEPENDS
:=@
!NATIVE_TOOLCHAIN
91 URL
:=http
://uclibc.org
/
92 VERSION
:=$(UCLIBC_VERSION
)$(UCLIBC_PATCHVER
)-$(PKG_RELEASE
)
95 define Package
/libpthread
96 $(call Package
/uclibc
/Default
)
97 TITLE
:=POSIX thread library
100 define Package
/uclibc
101 $(call Package
/uclibc
/Default
)
102 TITLE
:=C library embedded systems
106 mkdir
-p
$(PKG_BUILD_DIR
)
109 define Build
/Compile
/Default
113 $(call Build
/Compile
/Default
)
116 define Package
/base-files
$(TARGET
)/install
117 $(CP
) .
/files
/* $(1)/
118 if
[ -d
$(GENERIC_PLATFORM_DIR
)/base-files
/.
]; then \
119 $(CP
) $(GENERIC_PLATFORM_DIR
)/base-files
/* $(1)/; \
121 if
[ -d
$(PLATFORM_DIR
)/base-files
/default
/.
]; then \
122 $(CP
) $(PLATFORM_DIR
)/base-files
/default
/* $(1)/; \
124 if
[ "$(PROFILE)" != "Default" ]; then \
125 if
[ -d
$(PLATFORM_DIR
)/base-files
/profile-
$(PROFILE
)/.
]; then \
126 $(CP
) $(PLATFORM_DIR
)/base-files
/profile-
$(PROFILE
)/* $(1)/; \
129 $(SED
) 's,$$$$R,r$(REV),g' $(1)/etc
/banner
130 $(SED
) 's,$$$$S,$(BOARD)-$(KERNEL),g' -e
's,$$$$A,$(ARCH),g' $(1)/etc
/ipkg.conf
132 mkdir
-p
$(1)/etc
/crontabs
134 mkdir
-p
$(1)/lib
/firmware
138 mkdir
-p
$(1)/usr
/lib
139 mkdir
-p
$(1)/usr
/bin
142 ln
-sf
/proc
/mounts
$(1)/etc
/mtab
146 ln
-sf
/tmp
/resolv.conf
$(1)/etc
/resolv.conf
147 $(call Package
/base-files
/install-target
,$(1))
148 for conffile in
$(1)/etc
/config
/*; do \
149 if
[ -f
"$$$$conffile" ]; then \
150 grep
"$$$$conffile" $(1)/CONTROL
/conffiles || \
151 echo
"$$$${conffile##$(1)}" >> $(1)/CONTROL
/conffiles
; \
156 define Package
/libgcc
/install
157 $(INSTALL_DIR
) $(1)/lib
158 $(CP
) $(TOOLCHAIN_DIR
)/lib
/libgcc_s.so.
* $(1)/lib
/
161 ifeq ($(word 1,$(subst .
, ,$(LIBGCC_VERSION
))),4)
162 define Package
/libssp
/install
163 $(INSTALL_DIR
) $(1)/lib
164 $(CP
) $(TOOLCHAIN_DIR
)/lib
/libssp.so.
* $(1)/lib
/
168 define Package
/libstdcpp
/install
169 $(INSTALL_DIR
) $(1)/lib
170 $(CP
) $(TOOLCHAIN_DIR
)/lib
/libstdc
++.so.
* $(1)/lib
/
173 define Package
/libpthread
/install
174 $(INSTALL_DIR
) $(1)/lib
175 $(CP
) $(TOOLCHAIN_DIR
)/lib
/libpthread.so.
* $(1)/lib
/
176 $(CP
) $(TOOLCHAIN_DIR
)/lib
/libpthread-
$(UCLIBC_VERSION
).so
$(1)/lib
/
179 define Package
/uclibc
/install
180 $(INSTALL_DIR
) $(1)/lib
181 for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil
; do \
182 $(CP
) $(TOOLCHAIN_DIR
)/lib
/$$$$file.so.
* $(1)/lib
/; \
183 $(CP
) $(TOOLCHAIN_DIR
)/lib
/$$$$file-$(UCLIBC_VERSION
).so
$(1)/lib
/; \
187 define Package
/ldd
/install
188 $(INSTALL_DIR
) $(1)/bin
/
189 $(CP
) $(TOOLCHAIN_DIR
)/utils
/ldd
$(1)/bin
/
192 define Package
/ldconfig
/install
193 $(INSTALL_DIR
) $(1)/bin
/
194 $(CP
) $(TOOLCHAIN_DIR
)/utils
/ldconfig
$(1)/bin
/
198 -include $(PLATFORM_DIR
)/base-files.mk
201 $(eval
$(call BuildPackage
,base-files
$(TARGET
)))
202 $(eval
$(call BuildPackage
,libgcc
))
203 $(eval
$(call BuildPackage
,libssp
))
204 $(eval
$(call BuildPackage
,libstdcpp
))
205 $(eval
$(call BuildPackage
,libpthread
))
206 $(eval
$(call BuildPackage
,uclibc
))