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
58 $(call
$(TARGET
)/conffiles
)
61 define Package
/base-files
$(TARGET
)/description
62 This package contains a base filesystem and system scripts for OpenWrt.
65 define Package
/gcc
/Default
68 DEPENDS
:=@
!NATIVE_TOOLCHAIN
69 URL
:=http
://gcc.gnu.org
/
70 VERSION
:=$(LIBGCC_VERSION
)-$(PKG_RELEASE
)
74 $(call Package
/gcc
/Default
)
75 TITLE
:=GCC support library
76 DEPENDS
:=@
!TARGET_avr32 @
!NATIVE_TOOLCHAIN
80 $(call Package
/gcc
/Default
)
82 TITLE
:=GCC support library
85 define Package
/libstdcpp
86 $(call Package
/gcc
/Default
)
88 TITLE
:=GNU Standard C
++ Library v3
89 DEPENDS
:=@
!NATIVE_TOOLCHAIN
&&@INSTALL_LIBSTDCPP
92 define Package
/uclibc
/Default
95 DEPENDS
:=@
!NATIVE_TOOLCHAIN
96 URL
:=http
://uclibc.org
/
97 VERSION
:=$(UCLIBC_VERSION
)$(UCLIBC_PATCHVER
)-$(PKG_RELEASE
)
100 define Package
/libpthread
101 $(call Package
/uclibc
/Default
)
102 TITLE
:=POSIX thread library
105 define Package
/uclibc
106 $(call Package
/uclibc
/Default
)
107 TITLE
:=C library embedded systems
111 $(call Package
/uclibc
/Default
)
112 TITLE
:=LDD trace utility
115 define Package
/ldconfig
116 $(call Package
/uclibc
/Default
)
117 TITLE
:=Shared library path configuration
121 mkdir
-p
$(PKG_BUILD_DIR
)
124 define Build
/Compile
/Default
128 $(call Build
/Compile
/Default
)
131 define Package
/base-files
$(TARGET
)/install
132 $(CP
) .
/files
/* $(1)/
133 if
[ -d
$(GENERIC_PLATFORM_DIR
)/base-files
/.
]; then \
134 $(CP
) $(GENERIC_PLATFORM_DIR
)/base-files
/* $(1)/; \
136 if
[ -d
$(PLATFORM_DIR
)/base-files
/.
]; then \
137 $(CP
) $(PLATFORM_DIR
)/base-files
/* $(1)/; \
139 if
[ -d
$(PLATFORM_DIR
)/base-files-
$(PROFILE
)/.
]; then \
140 $(CP
) $(PLATFORM_DIR
)/base-files-
$(PROFILE
)/* $(1)/; \
142 $(if
$(filter-out $(PLATFORM_DIR
),$(PLATFORM_SUBDIR
)), \
143 if
[ -d
$(PLATFORM_SUBDIR
)/base-files
/.
]; then \
144 $(CP
) $(PLATFORM_SUBDIR
)/base-files
/* $(1)/; \
146 if
[ -d
$(PLATFORM_SUBDIR
)/base-files-
$(PROFILE
)/.
]; then \
147 $(CP
) $(PLATFORM_SUBDIR
)/base-files-
$(PROFILE
)/* $(1)/; \
150 $(if
$(CONFIG_BUSYBOX_CONFIG_FEATURE_SHADOWPASSWDS
),cp
$(1)/etc
/passwd
$(1)/etc
/shadow
)
151 $(SED
) 's,$$$$R,$(REVISION),g' $(1)/etc
/banner
152 $(SED
) 's,$$$$S,$(BOARD),g' -e
's,$$$$A,$(ARCH),g' $(1)/etc
/ipkg.conf
154 mkdir
-p
$(1)/etc
/crontabs
156 mkdir
-p
$(1)/lib
/firmware
160 mkdir
-p
$(1)/usr
/lib
161 mkdir
-p
$(1)/usr
/bin
165 ln
-sf
/proc
/mounts
$(1)/etc
/mtab
169 ln
-sf
/tmp
/resolv.conf
/tmp
/fstab
/tmp
/TZ
$(1)/etc
/
170 $(call Package
/base-files
/install-target
,$(1))
171 for conffile in
$(1)/etc
/config
/*; do \
172 if
[ -f
"$$$$conffile" ]; then \
173 grep
"$$$$conffile" $(1)/CONTROL
/conffiles || \
174 echo
"$$$${conffile##$(1)}" >> $(1)/CONTROL
/conffiles
; \
179 define Package
/libgcc
/install
180 $(INSTALL_DIR
) $(1)/lib
181 $(CP
) $(TOOLCHAIN_DIR
)/lib
$(LIB_SUFFIX
)/libgcc_s.so.
* $(1)/lib
/
184 ifeq ($(word 1,$(subst .
, ,$(LIBGCC_VERSION
))),4)
185 define Package
/libssp
/install
186 $(INSTALL_DIR
) $(1)/lib
187 $(CP
) $(TOOLCHAIN_DIR
)/lib
$(LIB_SUFFIX
)/libssp.so.
* $(1)/lib
/
191 define Package
/libstdcpp
/install
192 $(INSTALL_DIR
) $(1)/lib
193 $(CP
) $(TOOLCHAIN_DIR
)/lib
$(LIB_SUFFIX
)/libstdc
++.so.
* $(1)/lib
/
196 define Package
/libpthread
/install
197 $(INSTALL_DIR
) $(1)/lib
198 $(CP
) $(TOOLCHAIN_DIR
)/lib
/libpthread.so.
* $(1)/lib
/
199 $(CP
) $(TOOLCHAIN_DIR
)/lib
/libpthread-
$(UCLIBC_VERSION
).so
$(1)/lib
/
202 define Package
/uclibc
/install
203 $(INSTALL_DIR
) $(1)/lib
204 for file in
ld$(LIB_SUFFIX
)-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil
; do \
205 $(CP
) $(TOOLCHAIN_DIR
)/lib
/$$$$file.so.
* $(1)/lib
/; \
206 $(CP
) $(TOOLCHAIN_DIR
)/lib
/$$$$file-$(UCLIBC_VERSION
).so
$(1)/lib
/; \
210 define Package
/ldd
/install
211 $(INSTALL_DIR
) $(1)/bin
/
212 $(CP
) $(TOOLCHAIN_DIR
)/target-utils
/ldd
$(1)/bin
/
215 define Package
/ldconfig
/install
216 $(INSTALL_DIR
) $(1)/bin
/
217 $(CP
) $(TOOLCHAIN_DIR
)/target-utils
/ldconfig
$(1)/bin
/
221 -include $(PLATFORM_DIR
)/base-files.mk
224 $(eval
$(call BuildPackage
,base-files
$(TARGET
)))
225 $(eval
$(call BuildPackage
,libgcc
))
226 $(eval
$(call BuildPackage
,libssp
))
227 $(eval
$(call BuildPackage
,libstdcpp
))
228 $(eval
$(call BuildPackage
,libpthread
))
229 $(eval
$(call BuildPackage
,uclibc
))
230 $(eval
$(call BuildPackage
,ldd
))
231 $(eval
$(call BuildPackage
,ldconfig
))