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
)
16 PKG_FILE_DEPEND
:=$(PLATFORM_DIR
)
18 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
)
43 $(call Config
,network.lan.proto
,string
,static
,LAN Protocol
)
44 $(call Config
,network.lan.ipaddr
,ip
,192.168.1.1,LAN IP Address
)
45 $(call Config
,network.lan.netmask
,netmask
,255.255.0.0,LAN Network Mask
)
46 $(call Config
,network.lan.gateway
,ip
,,LAN Gateway
)
47 $(call Config
,network.lan.dns
,ip
,,LAN DNS server
)
50 define Package
/base-files
$(TARGET
)/conffiles
60 $(call
$(TARGET
)/conffiles
)
66 DEPENDS
:=@
!NATIVE_TOOLCHAIN
67 TITLE
:=GCC support library
68 URL
:=http
://gcc.gnu.org
/
69 VERSION
:=$(LIBGCC_VERSION
)-$(PKG_RELEASE
)
72 define Package
/libpthread
75 DEPENDS
:=@
!NATIVE_TOOLCHAIN
76 TITLE
:=POSIX thread library
77 URL
:=http
://uclibc.org
/
78 VERSION
:=$(UCLIBC_VERSION
)-$(PKG_RELEASE
)
84 DEPENDS
:=@
!NATIVE_TOOLCHAIN
85 TITLE
:=C library embedded systems
86 URL
:=http
://uclibc.org
/
87 VERSION
:=$(UCLIBC_VERSION
)-$(PKG_RELEASE
)
91 mkdir
-p
$(PKG_BUILD_DIR
)
94 define Build
/Compile
/Default
98 $(call Build
/Compile
/Default
)
101 define Package
/base-files
$(TARGET
)/install
102 $(CP
) .
/files
/* $(1)/
103 if
[ -d
$(PLATFORM_DIR
)/base-files
/default
/.
]; then \
104 $(CP
) $(PLATFORM_DIR
)/base-files
/default
/* $(1)/; \
106 if
[ "$(PROFILE)" != "Default" ]; then \
107 if
[ -d
$(PLATFORM_DIR
)/base-files
/profile-
$(PROFILE
)/.
]; then \
108 $(CP
) $(PLATFORM_DIR
)/base-files
/profile-
$(PROFILE
)/* $(1)/; \
111 $(SED
) 's,$$$$R,r$(REV),g' $(1)/etc
/banner
112 $(SED
) 's,$$$$S,$(BOARD)-$(KERNEL),g' $(1)/etc
/ipkg.conf
114 mkdir
-p
$(1)/etc
/crontabs
120 mkdir
-p
$(1)/usr
/lib
121 mkdir
-p
$(1)/usr
/bin
124 ln
-sf
/proc
/mounts
$(1)/etc
/mtab
128 ln
-sf
/tmp
/resolv.conf
$(1)/etc
/resolv.conf
129 $(call Package
/base-files
/install-target
,$(1))
130 for conffile in
$(1)/etc
/config
/*; do \
131 if
[ -f
"$$$$conffile" ]; then \
132 grep
"$$$$conffile" $(1)/CONTROL
/conffiles || \
133 echo
"$$$${conffile##$(1)}" >> $(1)/CONTROL
/conffiles
; \
138 define Package
/libgcc
/install
139 $(INSTALL_DIR
) $(1)/lib
140 $(CP
) $(STAGING_DIR
)/lib
/libgcc_s.so.
* $(1)/lib
/
143 define Package
/libpthread
/install
144 $(INSTALL_DIR
) $(1)/lib
145 $(CP
) $(STAGING_DIR
)/lib
/libpthread.so.
* $(1)/lib
/
146 $(CP
) $(STAGING_DIR
)/lib
/libpthread-
$(UCLIBC_VERSION
).so
$(1)/lib
/
149 define Package
/uclibc
/install
150 $(INSTALL_DIR
) $(1)/lib
151 for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil
; do \
152 $(CP
) $(STAGING_DIR
)/lib
/$$$$file.so.
* $(1)/lib
/; \
153 $(CP
) $(STAGING_DIR
)/lib
/$$$$file-$(UCLIBC_VERSION
).so
$(1)/lib
/; \
158 -include $(PLATFORM_DIR
)/base-files.mk
161 $(eval
$(call BuildPackage
,base-files
$(TARGET
)))
162 $(eval
$(call BuildPackage
,libgcc
))
163 $(eval
$(call BuildPackage
,libpthread
))
164 $(eval
$(call BuildPackage
,uclibc
))