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 LIBGCC_VERSION
:=$(GCC_VERSION
)
23 UCLIBC_VERSION
:=<UCLIBC_VERSION
>
24 LIBGCC_VERSION
:=<LIBGCC_VERSION
>
27 CONFIG_PACKAGE_base-files
$(TARGET
):=$(CONFIG_PACKAGE_base-files
)
29 define Package
/base-files
$(TARGET
)
32 TITLE
:=Base filesystem for OpenWrt
33 URL
:=http
://openwrt.org
/
34 VERSION
:=$(PKG_RELEASE
)-$(REVISION
)
35 $(call Config
,network.lan.proto
,string
,static
,LAN Protocol
)
36 $(call Config
,network.lan.ipaddr
,ip
,192.168.1.1,LAN IP Address
)
37 $(call Config
,network.lan.netmask
,netmask
,255.255.255.0,LAN Network Mask
)
38 $(call Config
,network.lan.gateway
,ip
,,LAN Gateway
)
39 $(call Config
,network.lan.dns
,ip
,,LAN DNS server
)
42 define Package
/base-files
$(TARGET
)/conffiles
52 $(call
$(TARGET
)/conffiles
)
55 define Package
/base-files
$(TARGET
)/description
56 This package contains a base filesystem and system scripts for OpenWrt.
59 define Package
/gcc
/Default
62 DEPENDS
:=@
!NATIVE_TOOLCHAIN
63 URL
:=http
://gcc.gnu.org
/
64 VERSION
:=$(LIBGCC_VERSION
)-$(PKG_RELEASE
)
68 $(call Package
/gcc
/Default
)
69 TITLE
:=GCC support library
70 DEPENDS
:=@
!TARGET_avr32 @
!NATIVE_TOOLCHAIN
74 $(call Package
/gcc
/Default
)
75 TITLE
:=GCC support library
78 define Package
/libstdcpp
79 $(call Package
/gcc
/Default
)
81 TITLE
:=GNU Standard C
++ Library v3
82 DEPENDS
:=@
!NATIVE_TOOLCHAIN
&&@INSTALL_LIBSTDCPP
85 define Package
/uclibc
/Default
88 DEPENDS
:=@
!NATIVE_TOOLCHAIN
89 URL
:=http
://uclibc.org
/
90 VERSION
:=$(UCLIBC_VERSION
)$(UCLIBC_PATCHVER
)-$(PKG_RELEASE
)
93 define Package
/libpthread
94 $(call Package
/uclibc
/Default
)
95 TITLE
:=POSIX thread library
99 $(call Package
/uclibc
/Default
)
100 TITLE
:=C library embedded systems
104 $(call Package
/uclibc
/Default
)
105 TITLE
:=LDD trace utility
108 define Package
/ldconfig
109 $(call Package
/uclibc
/Default
)
110 TITLE
:=Shared library path configuration
114 mkdir
-p
$(PKG_BUILD_DIR
)
117 define Build
/Compile
/Default
121 $(call Build
/Compile
/Default
)
124 define Package
/base-files
$(TARGET
)/install
125 $(CP
) .
/files
/* $(1)/
126 if
[ -d
$(GENERIC_PLATFORM_DIR
)/base-files
/.
]; then \
127 $(CP
) $(GENERIC_PLATFORM_DIR
)/base-files
/* $(1)/; \
129 if
[ -d
$(PLATFORM_DIR
)/base-files
/.
]; then \
130 $(CP
) $(PLATFORM_DIR
)/base-files
/* $(1)/; \
132 $(if
$(filter-out $(PLATFORM_DIR
),$(PLATFORM_SUBDIR
)), \
133 if
[ -d
$(PLATFORM_SUBDIR
)/base-files
/.
]; then \
134 $(CP
) $(PLATFORM_SUBDIR
)/base-files
/* $(1)/; \
137 $(SED
) 's,$$$$R,$(REVISION),g' $(1)/etc
/banner
138 $(SED
) 's,$$$$S,$(BOARD),g' -e
's,$$$$A,$(ARCH),g' $(1)/etc
/ipkg.conf
140 mkdir
-p
$(1)/etc
/crontabs
142 mkdir
-p
$(1)/lib
/firmware
146 mkdir
-p
$(1)/usr
/lib
147 mkdir
-p
$(1)/usr
/bin
151 ln
-sf
/proc
/mounts
$(1)/etc
/mtab
155 ln
-sf
/tmp
/resolv.conf
$(1)/etc
/resolv.conf
156 $(call Package
/base-files
/install-target
,$(1))
157 for conffile in
$(1)/etc
/config
/*; do \
158 if
[ -f
"$$$$conffile" ]; then \
159 grep
"$$$$conffile" $(1)/CONTROL
/conffiles || \
160 echo
"$$$${conffile##$(1)}" >> $(1)/CONTROL
/conffiles
; \
165 define Package
/libgcc
/install
166 $(INSTALL_DIR
) $(1)/lib
167 $(CP
) $(TOOLCHAIN_DIR
)/lib
/libgcc_s.so.
* $(1)/lib
/
170 ifeq ($(word 1,$(subst .
, ,$(LIBGCC_VERSION
))),4)
171 define Package
/libssp
/install
172 $(INSTALL_DIR
) $(1)/lib
173 $(CP
) $(TOOLCHAIN_DIR
)/lib
/libssp.so.
* $(1)/lib
/
177 define Package
/libstdcpp
/install
178 $(INSTALL_DIR
) $(1)/lib
179 $(CP
) $(TOOLCHAIN_DIR
)/lib
/libstdc
++.so.
* $(1)/lib
/
182 define Package
/libpthread
/install
183 $(INSTALL_DIR
) $(1)/lib
184 $(CP
) $(TOOLCHAIN_DIR
)/lib
/libpthread.so.
* $(1)/lib
/
185 $(CP
) $(TOOLCHAIN_DIR
)/lib
/libpthread-
$(UCLIBC_VERSION
).so
$(1)/lib
/
188 define Package
/uclibc
/install
189 $(INSTALL_DIR
) $(1)/lib
190 for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil
; do \
191 $(CP
) $(TOOLCHAIN_DIR
)/lib
/$$$$file.so.
* $(1)/lib
/; \
192 $(CP
) $(TOOLCHAIN_DIR
)/lib
/$$$$file-$(UCLIBC_VERSION
).so
$(1)/lib
/; \
196 define Package
/ldd
/install
197 $(INSTALL_DIR
) $(1)/bin
/
198 $(CP
) $(TOOLCHAIN_DIR
)/target-utils
/ldd
$(1)/bin
/
201 define Package
/ldconfig
/install
202 $(INSTALL_DIR
) $(1)/bin
/
203 $(CP
) $(TOOLCHAIN_DIR
)/target-utils
/ldconfig
$(1)/bin
/
207 -include $(PLATFORM_DIR
)/base-files.mk
210 $(eval
$(call BuildPackage
,base-files
$(TARGET
)))
211 $(eval
$(call BuildPackage
,libgcc
))
212 $(eval
$(call BuildPackage
,libssp
))
213 $(eval
$(call BuildPackage
,libstdcpp
))
214 $(eval
$(call BuildPackage
,libpthread
))
215 $(eval
$(call BuildPackage
,uclibc
))
216 $(eval
$(call BuildPackage
,ldd
))
217 $(eval
$(call BuildPackage
,ldconfig
))