summaryrefslogtreecommitdiff
path: root/package/busybox/Makefile
blob: 946c85b18afd8163d008a6d7b9ae437bc28f170c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# This file is part of the OpenADK project. OpenADK is copyrighted
# material, please see the LICENCE file in the top-level directory.

include $(TOPDIR)/rules.mk

PKG_NAME:=		busybox
PKG_VERSION:=		1.20.2
PKG_RELEASE:=		1
PKG_MD5SUM:=		e025414bc6cd79579cc7a32a45d3ae1c
PKG_DESCR:=		Core utilities for embedded systems
PKG_SECTION:=		base
PKG_BUILDDEP:=		libtirpc
PKG_URL:=		http://www.busybox.net/
PKG_SITES:=		http://www.busybox.net/downloads/

DISTFILES:=		${PKG_NAME}-${PKG_VERSION}.tar.bz2

PKG_SUBPKGS:=		BUSYBOX UDHCPD
PKGSD_UDHCPD:=		uDHCPD meta package
PKGSC_UDHCPD:=		net

include $(TOPDIR)/mk/package.mk

$(eval $(call PKG_template,BUSYBOX,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
$(eval $(call PKG_template,UDHCPD,udhcpd,${PKG_VERSION}-${PKG_RELEASE},busybox,${PKGSD_UDHCPD},${PKGSC_UDHCPD}))

# This is how to extract the Config.in files from a _built_ busybox source tree:
#|for c in $(find build_viprinux_arm_glibc/w-busybox-1.18.1-4/busybox-1.18.1/ -name Config.in); do
#|	c=$(sed s,build_viprinux_arm_glibc/w-busybox-1.18.1-4/busybox-1.18.1/,, <<< $c)
#|	mkdir -p package/busybox/config_new/$(dirname $c)
#|	cp build_viprinux_arm_glibc/w-busybox-1.18.1-4/busybox-1.18.1/$c package/busybox/config_new/$c
#|done

CONFIG_STYLE:=		manual
BUILD_STYLE:=		manual
INSTALL_STYLE:=		manual

BB_MAKE_FLAGS:=		V=1 IPKG_ARCH="${CPU_ARCH}" ARCH="${ARCH}" GCC_HONOUR_COPTS=s \
			HOSTCC="${CC_FOR_BUILD}" HOSTCFLAGS="$(CFLAGS_FOR_BUILD)" \
			-C ${WRKBUILD}
ifneq (${ADK_NATIVE},y)
BB_MAKE_FLAGS+=		CROSS_COMPILE="$(TARGET_CROSS)" EXTRA_LDFLAGS='-pthread  -ltirpc' EXTRA_CPPFLAGS="-I$(STAGING_DIR)/usr/include/tirpc"
endif

# XXX: Although this looks like all new symbols are enabled when 'make oldconfig' runs, they're not.
#      In fact, you can pipe "yes ''" as well as "yes n", each time leading to the default value being
#      chosen for each unknown symbol.
#      A real solution for that task (disabling everything that's unknown, as we know better) is to
#      upgrade ${TOPDIR}/config so it understands the oldnoconfig target, and using that to update
#      the busybox config before compiling.
#      The workaround for now is to patch all busybox symbols to default n inside the busybox source
#      which do depend on non-existance of other packages outside the busybox source.
do-configure:
	grep BUSYBOX_ $(TOPDIR)/.config|sed -e 's/BUSYBOX_/CONFIG_/' > \
		${WRKBUILD}/.config
	$(SED) 's;@IDIR@;${WRKINST};' ${WRKBUILD}/.config
	yes '' | $(MAKE) ${BB_MAKE_FLAGS} oldconfig $(MAKE_TRACE)

do-build:
	$(MAKE) ${BB_MAKE_FLAGS} busybox

do-install:
	$(MAKE) ${BB_MAKE_FLAGS} install $(MAKE_TRACE)
	$(CP) $(WRKINST)/* $(IDIR_BUSYBOX)/
ifeq ($(ADK_DEBUG),y)
	${INSTALL_BIN} $(WRKBUILD)/busybox_unstripped \
		$(IDIR_BUSYBOX)/bin/busybox
endif
ifneq ($(strip ${ADK_PACKAGE_CFGFS}),)
	cd ${IDIR_BUSYBOX}/sbin && rm -f halt poweroff reboot
endif

udhcpd-install:
	${INSTALL_DIR} ${IDIR_UDHCPD}/etc/
	${INSTALL_DATA} ./files/udhcpd.conf ${IDIR_UDHCPD}/etc/

include ${TOPDIR}/mk/pkg-bottom.mk