2 # Copyright (C) 2007 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 include $(INCLUDE_DIR
)/package.mk
21 ifneq ($(wildcard $(PLATFORM_DIR
)/base-files-
$(PROFILE
) $(PLATFORM_SUBDIR
)/base-files-
$(PROFILE
)),)
22 TARGET
:=$(TARGET
)-$(PROFILE
)
24 LIBGCC_VERSION
:=$(GCC_VERSION
)
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
39 URL
:=http
://openwrt.org
/
40 VERSION
:=$(PKG_RELEASE
)-$(REVISION
)
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
57 $(call
$(TARGET
)/conffiles
)
60 define Package
/base-files
$(TARGET
)/description
61 This package contains a base filesystem and system scripts for OpenWrt.
64 define Package
/gcc
/Default
67 DEPENDS
:=@
!NATIVE_TOOLCHAIN
68 URL
:=http
://gcc.gnu.org
/
69 VERSION
:=$(LIBGCC_VERSION
)-$(PKG_RELEASE
)
73 $(call Package
/gcc
/Default
)
74 TITLE
:=GCC support library
75 DEPENDS
:=@
!TARGET_avr32 @
!NATIVE_TOOLCHAIN
79 $(call Package
/gcc
/Default
)
81 TITLE
:=GCC support library
84 define Package
/libstdcpp
85 $(call Package
/gcc
/Default
)
87 TITLE
:=GNU Standard C
++ Library v3
88 DEPENDS
:=@
!NATIVE_TOOLCHAIN
&&@INSTALL_LIBSTDCPP
91 define Package
/uclibc
/Default
94 DEPENDS
:=@
!NATIVE_TOOLCHAIN
95 URL
:=http
://uclibc.org
/
96 VERSION
:=$(UCLIBC_VERSION
)$(UCLIBC_PATCHVER
)-$(PKG_RELEASE
)
99 define Package
/libpthread
100 $(call Package
/uclibc
/Default
)
101 TITLE
:=POSIX thread library
104 define Package
/uclibc
105 $(call Package
/uclibc
/Default
)
106 TITLE
:=C library embedded systems
110 $(call Package
/uclibc
/Default
)
111 TITLE
:=LDD trace utility
114 define Package
/ldconfig
115 $(call Package
/uclibc
/Default
)
116 TITLE
:=Shared library path configuration
120 mkdir
-p
$(PKG_BUILD_DIR
)
123 define Build
/Compile
/Default
127 $(call Build
/Compile
/Default
)
130 define Package
/base-files
$(TARGET
)/install
131 $(CP
) .
/files
/* $(1)/
132 if
[ -d
$(GENERIC_PLATFORM_DIR
)/base-files
/.
]; then \
133 $(CP
) $(GENERIC_PLATFORM_DIR
)/base-files
/* $(1)/; \
135 if
[ -d
$(PLATFORM_DIR
)/base-files
/.
]; then \
136 $(CP
) $(PLATFORM_DIR
)/base-files
/* $(1)/; \
138 if
[ -d
$(PLATFORM_DIR
)/base-files-
$(PROFILE
)/.
]; then \
139 $(CP
) $(PLATFORM_DIR
)/base-files-
$(PROFILE
)/* $(1)/; \
141 $(if
$(filter-out $(PLATFORM_DIR
),$(PLATFORM_SUBDIR
)), \
142 if
[ -d
$(PLATFORM_SUBDIR
)/base-files
/.
]; then \
143 $(CP
) $(PLATFORM_SUBDIR
)/base-files
/* $(1)/; \
145 if
[ -d
$(PLATFORM_SUBDIR
)/base-files-
$(PROFILE
)/.
]; then \
146 $(CP
) $(PLATFORM_SUBDIR
)/base-files-
$(PROFILE
)/* $(1)/; \
149 $(if
$(CONFIG_BUSYBOX_CONFIG_FEATURE_SHADOWPASSWDS
),cp
$(1)/etc
/passwd
$(1)/etc
/shadow
)
150 $(SED
) 's,$$$$R,$(REVISION),g' $(1)/etc
/banner
152 mkdir
-p
$(1)/etc
/crontabs
154 mkdir
-p
$(1)/lib
/firmware
158 mkdir
-p
$(1)/usr
/lib
159 mkdir
-p
$(1)/usr
/bin
163 ln
-sf
/proc
/mounts
$(1)/etc
/mtab
167 ln
-sf
/tmp
/resolv.conf
/tmp
/fstab
/tmp
/TZ
$(1)/etc
/
168 $(call Package
/base-files
/install-target
,$(1))
169 for conffile in
$(1)/etc
/config
/*; do \
170 if
[ -f
"$$$$conffile" ]; then \
171 grep
"$$$$conffile" $(1)/CONTROL
/conffiles || \
172 echo
"$$$${conffile##$(1)}" >> $(1)/CONTROL
/conffiles
; \
177 define Package
/libgcc
/install
178 $(INSTALL_DIR
) $(1)/lib
179 $(CP
) $(TOOLCHAIN_DIR
)/lib
$(LIB_SUFFIX
)/libgcc_s.so.
* $(1)/lib
/
182 ifeq ($(word 1,$(subst .
, ,$(LIBGCC_VERSION
))),4)
183 define Package
/libssp
/install
184 $(INSTALL_DIR
) $(1)/lib
185 $(CP
) $(TOOLCHAIN_DIR
)/lib
$(LIB_SUFFIX
)/libssp.so.
* $(1)/lib
/
189 define Package
/libstdcpp
/install
190 $(INSTALL_DIR
) $(1)/lib
191 $(CP
) $(TOOLCHAIN_DIR
)/lib
$(LIB_SUFFIX
)/libstdc
++.so.
* $(1)/lib
/
194 define Package
/libpthread
/install
195 $(INSTALL_DIR
) $(1)/lib
196 $(CP
) $(TOOLCHAIN_DIR
)/lib
/libpthread.so.
* $(1)/lib
/
197 $(CP
) $(TOOLCHAIN_DIR
)/lib
/libpthread-
$(UCLIBC_VERSION
).so
$(1)/lib
/
200 define Package
/uclibc
/install
201 $(INSTALL_DIR
) $(1)/lib
202 for file in
ld$(LIB_SUFFIX
)-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil
; do \
203 $(CP
) $(TOOLCHAIN_DIR
)/lib
/$$$$file.so.
* $(1)/lib
/; \
204 $(CP
) $(TOOLCHAIN_DIR
)/lib
/$$$$file-$(UCLIBC_VERSION
).so
$(1)/lib
/; \
208 define Package
/ldd
/install
209 $(INSTALL_DIR
) $(1)/bin
/
210 $(CP
) $(TOOLCHAIN_DIR
)/target-utils
/ldd
$(1)/bin
/
213 define Package
/ldconfig
/install
214 $(INSTALL_DIR
) $(1)/bin
/
215 $(CP
) $(TOOLCHAIN_DIR
)/target-utils
/ldconfig
$(1)/bin
/
219 -include $(PLATFORM_DIR
)/base-files.mk
222 $(eval
$(call BuildPackage
,base-files
$(TARGET
)))
223 $(eval
$(call BuildPackage
,libgcc
))
224 $(eval
$(call BuildPackage
,libssp
))
225 $(eval
$(call BuildPackage
,libstdcpp
))
226 $(eval
$(call BuildPackage
,libpthread
))
227 $(eval
$(call BuildPackage
,uclibc
))
228 $(eval
$(call BuildPackage
,ldd
))
229 $(eval
$(call BuildPackage
,ldconfig
))