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 }' )
23 include $(INCLUDE_DIR
)/package.mk
26 TARGET
:=-$(BOARD
)-$(KERNEL
)
27 UCLIBC_VERSION
:=${shell cat
$(STAGING_DIR
)/uclibc_version
2>/dev
/null
}
28 LIBGCC_VERSION
:=${shell cat
$(STAGING_DIR
)/gcc_version
2>/dev
/null
}
30 UCLIBC_VERSION
:=<UCLIBC_VERSION
>
31 LIBGCC_VERSION
:=<LIBGCC_VERSION
>
34 CONFIG_PACKAGE_base-files
$(TARGET
):=$(CONFIG_PACKAGE_base-files
)
36 define Package
/base-files
$(TARGET
)
39 TITLE
:=Base filesystem for OpenWrt
41 This package contains a base filesystem and system scripts for OpenWrt.
42 URL
:=http
://openwrt.org
/
43 VERSION
:=$(PKG_RELEASE
)-$(REV
)
44 $(call Config
,network.lan.proto
,string
,static
,LAN Protocol
)
45 $(call Config
,network.lan.ipaddr
,ip
,192.168.1.1,LAN IP Address
)
46 $(call Config
,network.lan.netmask
,netmask
,255.255.0.0,LAN Network Mask
)
47 $(call Config
,network.lan.gateway
,ip
,,LAN Gateway
)
48 $(call Config
,network.lan.dns
,ip
,,LAN DNS server
)
51 define Package
/base-files
$(TARGET
)/conffiles
61 $(call
$(TARGET
)/conffiles
)
67 DEPENDS
:=@
!NATIVE_TOOLCHAIN
68 TITLE
:=GCC support library
69 URL
:=http
://gcc.gnu.org
/
70 VERSION
:=$(LIBGCC_VERSION
)-$(PKG_RELEASE
)
73 define Package
/libpthread
76 DEPENDS
:=@
!NATIVE_TOOLCHAIN
77 TITLE
:=POSIX thread library
78 URL
:=http
://uclibc.org
/
79 VERSION
:=$(UCLIBC_VERSION
)-$(PKG_RELEASE
)
85 DEPENDS
:=@
!NATIVE_TOOLCHAIN
86 TITLE
:=C library embedded systems
87 URL
:=http
://uclibc.org
/
88 VERSION
:=$(UCLIBC_VERSION
)-$(PKG_RELEASE
)
92 mkdir
-p
$(PKG_BUILD_DIR
)
95 define Build
/Compile
/Default
99 $(call Build
/Compile
/Default
)
102 define Package
/base-files
$(TARGET
)/install
103 $(CP
) .
/files
/* $(1)/
104 if
[ -d
$(PLATFORM_DIR
)/base-files
/default
/.
]; then \
105 $(CP
) $(PLATFORM_DIR
)/base-files
/default
/* $(1)/; \
107 if
[ "$(PROFILE)" != "Default" ]; then \
108 if
[ -d
$(PLATFORM_DIR
)/base-files
/profile-
$(PROFILE
)/.
]; then \
109 $(CP
) $(PLATFORM_DIR
)/base-files
/profile-
$(PROFILE
)/* $(1)/; \
112 $(SED
) 's,$$$$R,r$(REV),g' $(1)/etc
/banner
113 $(SED
) 's,$$$$S,$(BOARD)-$(KERNEL),g' $(1)/etc
/ipkg.conf
115 mkdir
-p
$(1)/etc
/crontabs
121 mkdir
-p
$(1)/usr
/lib
122 mkdir
-p
$(1)/usr
/bin
125 ln
-sf
/proc
/mounts
$(1)/etc
/mtab
129 ln
-sf
/tmp
/resolv.conf
$(1)/etc
/resolv.conf
130 $(call Package
/base-files
/install-target
,$(1))
131 for conffile in
$(1)/etc
/config
/*; do \
132 if
[ -f
"$$$$conffile" ]; then \
133 grep
"$$$$conffile" $(1)/CONTROL
/conffiles || \
134 echo
"$$$${conffile##$(1)}" >> $(1)/CONTROL
/conffiles
; \
139 define Package
/libgcc
/install
140 $(INSTALL_DIR
) $(1)/lib
141 $(CP
) $(STAGING_DIR
)/lib
/libgcc_s.so.
* $(1)/lib
/
144 define Package
/libpthread
/install
145 $(INSTALL_DIR
) $(1)/lib
146 $(CP
) $(STAGING_DIR
)/lib
/libpthread.so.
* $(1)/lib
/
147 $(CP
) $(STAGING_DIR
)/lib
/libpthread-
$(UCLIBC_VERSION
).so
$(1)/lib
/
150 define Package
/uclibc
/install
151 $(INSTALL_DIR
) $(1)/lib
152 for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil
; do \
153 $(CP
) $(STAGING_DIR
)/lib
/$$$$file.so.
* $(1)/lib
/; \
154 $(CP
) $(STAGING_DIR
)/lib
/$$$$file-$(UCLIBC_VERSION
).so
$(1)/lib
/; \
159 -include $(PLATFORM_DIR
)/base-files.mk
162 $(eval
$(call BuildPackage
,base-files
$(TARGET
)))
163 $(eval
$(call BuildPackage
,libgcc
))
164 $(eval
$(call BuildPackage
,libpthread
))
165 $(eval
$(call BuildPackage
,uclibc
))