2007-01-23 06:59:04 +05:30
|
|
|
# This is completely unsupported.
|
2008-06-02 10:21:29 +05:30
|
|
|
#
|
|
|
|
# Uasge: make -f scripts/Makefile.IMA
|
|
|
|
#
|
2007-01-23 06:59:04 +05:30
|
|
|
# Fix COMBINED_COMPILE upstream (in the Kbuild) and propagate
|
|
|
|
# the changes back
|
|
|
|
srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
|
|
|
|
objtree := $(CURDIR)
|
|
|
|
src := $(srctree)
|
|
|
|
obj := $(objtree)
|
|
|
|
|
2008-04-11 14:16:56 +05:30
|
|
|
# Look for make include files relative to root of kernel src
|
|
|
|
MAKEFLAGS += --include-dir=$(srctree)
|
|
|
|
|
2007-01-23 06:59:04 +05:30
|
|
|
default: busybox
|
2008-04-11 14:16:56 +05:30
|
|
|
|
2008-06-02 10:21:29 +05:30
|
|
|
include .config
|
|
|
|
|
|
|
|
# Cross compiling and selecting different set of gcc/bin-utils
|
|
|
|
ifeq ($(CROSS_COMPILE),)
|
|
|
|
CROSS_COMPILE := $(subst ",,$(CONFIG_CROSS_COMPILER_PREFIX))
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(CROSS_COMPILE),)
|
|
|
|
SUBARCH := $(shell echo $(CROSS_COMPILE) | cut -d- -f1)
|
|
|
|
else
|
|
|
|
SUBARCH := $(shell uname -m)
|
|
|
|
endif
|
|
|
|
SUBARCH := $(shell echo $(SUBARCH) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
|
|
|
|
-e s/arm.*/arm/ -e s/sa110/arm/ \
|
|
|
|
-e s/s390x/s390/ -e s/parisc64/parisc/ \
|
|
|
|
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ )
|
|
|
|
ARCH ?= $(SUBARCH)
|
|
|
|
|
2008-04-11 14:16:56 +05:30
|
|
|
ifndef HOSTCC
|
|
|
|
HOSTCC = cc
|
|
|
|
endif
|
|
|
|
AS = $(CROSS_COMPILE)as
|
|
|
|
CC = $(CROSS_COMPILE)gcc
|
|
|
|
LD = $(CC) -nostdlib
|
|
|
|
CPP = $(CC) -E
|
|
|
|
AR = $(CROSS_COMPILE)ar
|
|
|
|
NM = $(CROSS_COMPILE)nm
|
|
|
|
STRIP = $(CROSS_COMPILE)strip
|
|
|
|
OBJCOPY = $(CROSS_COMPILE)objcopy
|
|
|
|
OBJDUMP = $(CROSS_COMPILE)objdump
|
|
|
|
|
2008-06-04 16:58:24 +05:30
|
|
|
CFLAGS := $(CFLAGS)
|
|
|
|
CPPFLAGS += -D"KBUILD_STR(s)=\#s" #-Q
|
2008-04-11 14:16:56 +05:30
|
|
|
|
|
|
|
# We need some generic definitions
|
|
|
|
include $(srctree)/scripts/Kbuild.include
|
|
|
|
|
|
|
|
include Makefile.flags
|
2008-05-08 18:55:20 +05:30
|
|
|
|
|
|
|
-include $(srctree)/arch/$(ARCH)/Makefile
|
2007-01-23 06:59:04 +05:30
|
|
|
ifdef CONFIG_FEATURE_COMPRESS_USAGE
|
|
|
|
usage_stuff = include/usage_compressed.h
|
|
|
|
endif
|
|
|
|
|
2008-04-11 14:16:56 +05:30
|
|
|
ifndef BB_VER
|
|
|
|
BB_VER:=""
|
|
|
|
endif
|
|
|
|
|
2008-04-11 18:12:23 +05:30
|
|
|
WHOLE_PROGRAM:=$(call cc-option,-fwhole-program,)
|
2008-04-11 14:16:56 +05:30
|
|
|
|
2007-01-23 06:59:04 +05:30
|
|
|
# pull in the config stuff
|
2007-05-15 14:37:06 +05:30
|
|
|
lib-all-y := applets/applets.o
|
2007-01-23 06:59:04 +05:30
|
|
|
lib-y:=
|
|
|
|
include procps/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,procps/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include networking/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,networking/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include networking/udhcp/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,networking/udhcp/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include networking/libiproute/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,networking/libiproute/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include loginutils/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,loginutils/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include archival/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,archival/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
2010-11-03 07:08:31 +05:30
|
|
|
include archival/libarchive/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,archival/libarchive/%,$(sort $(lib-y)))
|
2007-01-23 06:59:04 +05:30
|
|
|
lib-y:=
|
|
|
|
include applets/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,applets/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include e2fsprogs/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,e2fsprogs/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
#include e2fsprogs/old_e2fsprogs/Kbuild
|
|
|
|
#lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/%,$(sort $(lib-y)))
|
|
|
|
#lib-y:=
|
|
|
|
#include e2fsprogs/old_e2fsprogs/ext2fs/Kbuild
|
|
|
|
#lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/ext2fs/%,$(sort $(lib-y)))
|
|
|
|
#lib-y:=
|
|
|
|
#include e2fsprogs/old_e2fsprogs/blkid/Kbuild
|
|
|
|
#lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/blkid/%,$(sort $(lib-y)))
|
|
|
|
#lib-y:=
|
|
|
|
#include e2fsprogs/old_e2fsprogs/uuid/Kbuild
|
|
|
|
#lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/uuid/%,$(sort $(lib-y)))
|
|
|
|
#lib-y:=
|
|
|
|
#include e2fsprogs/old_e2fsprogs/e2p/Kbuild
|
|
|
|
#lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/e2p/%,$(sort $(lib-y)))
|
|
|
|
#lib-y:=
|
|
|
|
include debianutils/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,debianutils/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include runit/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,runit/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include modutils/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,modutils/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include miscutils/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,miscutils/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include coreutils/libcoreutils/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,coreutils/libcoreutils/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include coreutils/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,coreutils/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include sysklogd/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,sysklogd/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include shell/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,shell/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include console-tools/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,console-tools/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include findutils/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,findutils/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include util-linux/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,util-linux/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
2008-04-11 14:16:56 +05:30
|
|
|
include util-linux/volume_id/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,util-linux/volume_id/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
2007-01-23 06:59:04 +05:30
|
|
|
include init/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,init/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include libpwdgrp/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,libpwdgrp/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include editors/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,editors/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
2008-04-11 14:16:56 +05:30
|
|
|
include printutils/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,printutils/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
2007-03-09 14:16:31 +05:30
|
|
|
include selinux/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,selinux/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
2007-01-23 06:59:04 +05:30
|
|
|
include scripts/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,scripts/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
include libbb/Kbuild
|
|
|
|
lib-all-y += $(patsubst %,libbb/%,$(sort $(lib-y)))
|
|
|
|
lib-y:=
|
|
|
|
|
2008-04-11 18:01:57 +05:30
|
|
|
comma:=,
|
2008-04-12 19:16:39 +05:30
|
|
|
busybox_unstripped.o: $(usage_stuff) include/applet_tables.h include/autoconf.h
|
2008-04-11 16:57:29 +05:30
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) \
|
2008-04-11 18:01:57 +05:30
|
|
|
$(patsubst %,-Wl$(comma)%,$(LDFLAGS) $(EXTRA_LDFLAGS)) \
|
2008-04-11 16:57:29 +05:30
|
|
|
-DGCC_COMBINE=1 \
|
|
|
|
--combine $(WHOLE_PROGRAM) \
|
2007-02-02 21:41:24 +05:30
|
|
|
-funit-at-a-time -Wno-error -std=gnu99 \
|
2008-04-12 19:16:39 +05:30
|
|
|
-c -o busybox_unstripped.o \
|
|
|
|
$(lib-all-y:.o=.c)
|
|
|
|
|
|
|
|
busybox: busybox_unstripped.o
|
|
|
|
$(srctree)/scripts/trylink \
|
|
|
|
busybox_unstripped \
|
2008-06-04 16:58:24 +05:30
|
|
|
"$(CC) $(CFLAGS_busybox)" \
|
2008-04-12 19:16:39 +05:30
|
|
|
"$(CFLAGS)" \
|
|
|
|
"$(LDFLAGS)" \
|
|
|
|
"busybox_unstripped.o" \
|
|
|
|
"" \
|
|
|
|
"crypt m"
|
2007-05-15 14:37:06 +05:30
|
|
|
cp -f $(@)_unstripped $@
|
|
|
|
-$(STRIP) -s -R .note -R .comment -R .version $@
|
2007-01-23 06:59:04 +05:30
|
|
|
|
2008-04-12 19:16:39 +05:30
|
|
|
# If .config is newer than include/autoconf.h, someone tinkered
|
|
|
|
# with it and forgot to run make oldconfig.
|
|
|
|
include/autoconf.h: .config
|
|
|
|
$(MAKE) -f $(srctree)/Makefile silentoldconfig
|
|
|
|
|
|
|
|
applets/usage: include/autoconf.h
|
2008-04-11 16:57:29 +05:30
|
|
|
$(HOSTCC) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I$(srctree)/include -o applets/usage applets/usage.c
|
|
|
|
|
2008-04-12 19:16:39 +05:30
|
|
|
applets/applet_tables: include/autoconf.h
|
2008-04-11 16:57:29 +05:30
|
|
|
$(HOSTCC) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I$(srctree)/include -o applets/applet_tables applets/applet_tables.c
|
|
|
|
|
2010-06-06 05:23:38 +05:30
|
|
|
include/usage_compressed.h: include/usage.h applets/usage
|
2007-01-23 06:59:04 +05:30
|
|
|
$(srctree)/applets/usage_compressed include/usage_compressed.h applets
|
|
|
|
|
2010-06-06 04:23:45 +05:30
|
|
|
include/applet_tables.h: include/applets.h
|
2008-04-11 16:57:29 +05:30
|
|
|
applets/applet_tables include/applet_tables.h
|