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
)
46 define Package
/base-files
$(TARGET
)/conffiles
56 $(call
$(TARGET
)/conffiles
)
62 DEPENDS
:=@
!NATIVE_TOOLCHAIN
63 TITLE
:=GCC support library
64 URL
:=http
://gcc.gnu.org
/
65 VERSION
:=$(LIBGCC_VERSION
)-$(PKG_RELEASE
)
68 define Package
/libpthread
71 DEPENDS
:=@
!NATIVE_TOOLCHAIN
72 TITLE
:=POSIX thread library
73 URL
:=http
://uclibc.org
/
74 VERSION
:=$(UCLIBC_VERSION
)-$(PKG_RELEASE
)
80 DEPENDS
:=@
!NATIVE_TOOLCHAIN
81 TITLE
:=C library embedded systems
82 URL
:=http
://uclibc.org
/
83 VERSION
:=$(UCLIBC_VERSION
)-$(PKG_RELEASE
)
87 mkdir
-p
$(PKG_BUILD_DIR
)
90 define Build
/Compile
/Default
94 $(call Build
/Compile
/Default
)
97 define Package
/base-files
$(TARGET
)/install
99 if
[ -d
$(PLATFORM_DIR
)/base-files
/.
]; then \
100 $(CP
) $(PLATFORM_DIR
)/base-files
/* $(1)/; \
102 $(SED
) 's,$$$$R,r$(REV),g' $(1)/etc
/banner
103 $(SED
) 's,$$$$S,$(BOARD)-$(KERNEL),g' $(1)/etc
/ipkg.conf
105 mkdir
-p
$(1)/etc
/crontabs
111 mkdir
-p
$(1)/usr
/lib
112 mkdir
-p
$(1)/usr
/bin
115 ln
-sf
/proc
/mounts
$(1)/etc
/mtab
119 ln
-sf
/tmp
/resolv.conf
$(1)/etc
/resolv.conf
120 $(call Package
/base-files
/install-target
,$(1))
121 for conffile in
$(1)/etc
/config
/*; do \
122 if
[ -f
"$$$$conffile" ]; then \
123 grep
"$$$$conffile" $(1)/CONTROL
/conffiles || \
124 echo
"$$$${conffile##$(1)}" >> $(1)/CONTROL
/conffiles
; \
129 define Package
/libgcc
/install
130 $(INSTALL_DIR
) $(1)/lib
131 $(CP
) $(STAGING_DIR
)/lib
/libgcc_s.so.
* $(1)/lib
/
134 define Package
/libpthread
/install
135 $(INSTALL_DIR
) $(1)/lib
136 $(CP
) $(STAGING_DIR
)/lib
/libpthread.so.
* $(1)/lib
/
137 $(CP
) $(STAGING_DIR
)/lib
/libpthread-
$(UCLIBC_VERSION
).so
$(1)/lib
/
140 define Package
/uclibc
/install
141 $(INSTALL_DIR
) $(1)/lib
142 for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil
; do \
143 $(CP
) $(STAGING_DIR
)/lib
/$$$$file.so.
* $(1)/lib
/; \
144 $(CP
) $(STAGING_DIR
)/lib
/$$$$file-$(UCLIBC_VERSION
).so
$(1)/lib
/; \
149 -include $(PLATFORM_DIR
)/base-files.mk
152 $(eval
$(call BuildPackage
,base-files
$(TARGET
)))
153 $(eval
$(call BuildPackage
,libgcc
))
154 $(eval
$(call BuildPackage
,libpthread
))
155 $(eval
$(call BuildPackage
,uclibc
))