version of make (3.71.1).
clean distclean \
release tags
-# make-3.79.1 didn't support MAKEFILE_LIST
-# for building out-of-tree, users of make-3.79 still have to pass top_srcdir=
-# to make: make -f /srcs/busybox/Makefile top_srcdir=/srcs/busybox
-ifndef MAKEFILE_LIST
-MAKEFILE_LIST=.
-endif
# the toplevel sourcedir
ifndef top_srcdir
+# make-3.79.1 didn't support MAKEFILE_LIST
+# for building out-of-tree, users of make-3.79.1 still have to pass top_srcdir=
+# to make: make -f /srcs/busybox/Makefile top_srcdir=/srcs/busybox
+ifdef MAKEFILE_LIST
top_srcdir:=$(shell cd $(dir $(firstword $(MAKEFILE_LIST))) && pwd)
+else
+top_srcdir:=$(CURDIR)
+endif
endif
# toplevel directory of the object-tree
ifndef top_builddir
PACKAGE_OUTPUTDIR := $(top_builddir)
endif
-#######################################################################
-# Try to workaround bugs in make
-
-# make-3.79.1 didn't understand order-only prerequisites ('|').
-# Just treat them as normal prerequisites. Note that this will lead to
-# spurious rebuilds.
-ifeq ($(MAKE_VERSION),3.79.1)
-|: ;
-endif
-
-# Workaround for bugs in make-3.80
-# eval is broken if it is in a conditional
-
-#$ cat 3.80-eval-in-cond.mak
-#all:: ; @echo it
-#define Y
-# all:: ; @echo worked
-#endef
-#ifdef BAR
-#$(eval $(Y))
-#endif
-#$ make -f 3.80-eval-in-cond.mak
-#it
-#$ make -f 3.80-eval-in-cond.mak BAR=set
-#3.80-eval-in-cond.mak:5: *** missing `endif'. Stop.
-
-# This was fixed in December 2003.
define check_gcc
-$(eval $(1)+=$(if $(2),$(if $(shell $(CC) $(2) -S -o /dev/null -xc /dev/null > /dev/null 2>&1 && echo y),$(2),$(if $(3),$(3))),$(if $(3),$(3))))
+$(if $(2),$(if $(shell $(CC) $(2) -S -o /dev/null -xc /dev/null > /dev/null 2>&1 && echo y),$(2),$(if $(3),$(3))),$(if $(3),$(3)))
endef
define check_ld
-$(eval $(1)+=$(if $(2),$(if $(shell $(LD) $(2) -o /dev/null -b binary /dev/null > /dev/null 2>&1 && echo y),$(shell echo \-Wl,$(2)),$(if $(3),$(3))),$(if $(3),$(3))))
+$(if $(2),$(if $(shell $(LD) $(2) -o /dev/null -b binary /dev/null > /dev/null 2>&1 && echo y),$(shell echo \-Wl,$(2)),$(if $(3),$(3))),$(if $(3),$(3)))
endef
#######################################################################
+# make-3.79.1 doesn't support order-only prerequisites..
+ifeq ($(MAKE_VERSION),3.79.1)
+|: $(^) ;
+endif
+#######################################################################
+
--include $(top_srcdir)/Rules.mak
# Handle building out of tree
ifneq ($(top_builddir),$(top_srcdir))
@echo ' 2 also print when make enters a directory'
@echo ' 3 also verbosely print shell invocations'
+-include $(top_srcdir)/Rules.mak
+
ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
# Default target if none was requested explicitly
all: defconfig menuconfig ;
endif # ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
-# convert $(DIRS) to upper case. Use sed instead of tr since we're already
-# depending on it.
-DIRS_UPPER:=$(shell echo $(DIRS) | $(SED) 'h;y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/')
-
-# First populate the variables ..._OBJ-y et al
-$(foreach d,$(DIRS_UPPER),$(eval $(notdir $(d))-y:=))
-
include $(patsubst %,%/Makefile.in,$(SRC_DIRS))
-# Then we need the dependencies for ..._OBJ
-define dir_pattern.o
-ifeq ($(os),.os)
-$(if $($(1)_OBJ.os),$($(1)_OBJ.os:.os=.o): $(top_builddir)/$(2)/%.o: $(top_srcdir)/$(2)/%.c)
-endif
-$(if $($(1)_OBJ$(os)),$($(1)_OBJ$(os)): $(top_builddir)/$(2)/%$(os): $(top_srcdir)/$(2)/%.c)
-$(if $($(1)_OBJ),$($(1)_OBJ): $(top_builddir)/$(2)/%.o: $(top_srcdir)/$(2)/%.c)
-endef
-
-# The actual directory patterns for .o*
-$(foreach d,$(DIRS),$(eval $(call dir_pattern.o,$(subst /,_,$(d)),$(d))))
-
-define file_lists
-$($(1)$(2)) $($(1)$(2).o) $($(1)$(2).os)
-endef
-bin-obj-y:=$(subst .os,.o,$(foreach d,$(DIRS),$(call file_lists,$(subst /,_,$(d)),_OBJ)))
-bin-mobj-y:=$(subst .osm,.om,$(foreach d,$(DIRS),$(call file_lists,$(subst /,_,$(d)),_MOBJ)))
-
ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
# Finally pull in the dependencies (headers and other includes) of the
# individual object files
# IMA compiles all sources at once (aka IPO aka IPA etc.)
ifeq ($(strip $(CONFIG_BUILD_AT_ONCE)),y)
-# We are not building .o
-bin-obj-y:=
-bin-mobj-y:=
+libraries-y:=
# Which parts of the internal libs are requested?
# Per default we only want what was actually selected.
# -a denotes all while -y denotes the selected ones.
else # CONFIG_BUILD_AT_ONCE
# no --combine, build archives out of the individual .o
# This was the old way the binary was built.
-libbusybox-obj:=$(archival_libunarchive_OBJ$(os)) \
- $(networking_libiproute_OBJ$(os)) \
- $(libpwdgrp_MOBJ$(os)) \
- $(coreutils_libcoreutils_OBJ$(os)) \
- $(libbb_OBJ$(os)) $(libbb_MOBJ$(os))
-
+libbusybox-obj:=archival/libunarchive/libunarchive.a \
+ networking/libiproute/libiproute.a \
+ libpwdgrp/libpwdgrp.a coreutils/libcoreutils/libcoreutils.a \
+ libbb/libbb.a
+libbusybox-obj:=$(patsubst %,$(top_builddir)/%,$(libbusybox-obj))
ifeq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y)
-# linking against libbusybox, so don't build the .o already contained in the .so
-bin-obj-y:=$(filter-out $(libbusybox-obj) $(libbusybox-obj:.os=.o),$(bin-obj-y))
-bin-mobj-y:=$(filter-out $(libbusybox-obj) $(libbusybox-obj:.osm=.om),$(bin-mobj-y))
+# linking against libbusybox, so don't build the .a already contained in the .so
+libraries-y:=$(filter-out $(libbusybox-obj),$(libraries-y))
endif # CONFIG_FEATURE_SHARED_BUSYBOX
-endif # CONFIG_BUILD_AT_ONCE
-
-# build an .a to keep .hash et al small
-ifneq ($(bin-obj-y)$(bin-mobj-y),)
- applets.a:=$(bin-obj-y) $(bin-mobj-y)
-endif
-ifdef applets.a
-applets.a: $(applets.a)
- $(Q)-rm -f $(@)
- $(do_ar)
-bin-obj.a=applets.a
-endif
+endif # CONFIG_BUILD_AT_ONCE
ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y)
LD_LIBBUSYBOX:=libbusybox.so
$(LIBBUSYBOX_SONAME): $(LIBRARY_SRC)
else # CONFIG_BUILD_AT_ONCE
$(LIBBUSYBOX_SONAME): $(libbusybox-obj)
+AR_INTRO:=-Wl,--whole-archive
+AR_EXTRO:=-Wl,--no-whole-archive
endif # CONFIG_BUILD_AT_ONCE
ifndef MAJOR_VERSION
$(error MAJOR_VERSION needed for $@ is not defined)
endif
- $(do_link) $(LIB_CFLAGS) $(LIB_LDFLAGS) $(CFLAGS_COMBINE) \
+ $(do_link) $(LIB_CFLAGS) $(CFLAGS_COMBINE) \
-Wl,-soname=$(LD_LIBBUSYBOX).$(MAJOR_VERSION) \
-Wl,-z,combreloc $(LIB_LDFLAGS) \
-o $(@) \
-Wl,--start-group \
- $(LIBRARY_DEFINE) $(^) \
+ $(LIBRARY_DEFINE) $(AR_INTRO) $(^) $(AR_EXTRO) \
-Wl,--end-group
@rm -f $(DO_INSTALL_LIBS)
@for i in $(DO_INSTALL_LIBS); do ln -s $(@) $$i ; done
endif # ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y)
-busybox_unstripped: $(top_builddir)/.depend $(LIBBUSYBOX_SONAME) $(BUSYBOX_SRC) $(APPLET_SRC) $(bin-obj.a)
+busybox_unstripped: $(top_builddir)/.depend $(LIBBUSYBOX_SONAME) $(BUSYBOX_SRC) $(APPLET_SRC) $(libraries-y)
$(do_link) $(PROG_CFLAGS) $(PROG_LDFLAGS) $(CFLAGS_COMBINE) \
$(foreach f,$(^:.o=.c),$(CFLAGS-$(notdir $(patsubst %/$,%,$(dir $(f))))-$(notdir $(f)))) \
$(CFLAGS-$(@)) \
-o $@ -Wl,--start-group \
$(APPLETS_DEFINE) $(APPLET_SRC) \
$(BUSYBOX_DEFINE) $(BUSYBOX_SRC) \
- $(bin-obj.a) \
+ $(libraries-y) \
$(LDBUSYBOX) $(LIBRARIES) \
-Wl,--end-group
defconfig allyesconfig allnoconfig allbareconfig \
clean distclean \
release tags
+
# Ensure consistent sort order, 'gcc -print-search-dirs' behavior, etc.
LC_ALL:= C
+# initialize flags here
+CFLAGS:=
+CFLAGS_COMBINE:=
+CFLAGS_PIC:=
+LD_FLAGS:=
+LIB_LDFLAGS:=
+PROG_LDFLAGS:=
+PROG_CFLAGS:=
+OPTIMIZATIONS:=
+
# If you want to add some simple compiler switches (like -march=i686),
# especially from the command line, use this instead of CFLAGS directly.
# For optimization overrides, it's better still to set OPTIMIZATIONS.
WARNINGS=-Wall -Wstrict-prototypes -Wshadow
CFLAGS+=-I$(top_builddir)/include -I$(top_srcdir)/include
-ARFLAGS=cruP
+ARFLAGS=cru
)
endif
-$(call check_gcc,CFLAGS,-funsigned-char,)
-$(call check_gcc,CFLAGS,-mmax-stack-frame=256,)
+CFLAGS+=$(call check_gcc,CFLAGS,-funsigned-char,)
+CFLAGS+=$(call check_gcc,CFLAGS,-mmax-stack-frame=256,)
#--------------------------------------------------------
# Arch specific compiler optimization stuff should go here.
# for OPTIMIZATIONS...
# use '-Os' optimization if available, else use -O2
-$(call check_gcc,OPTIMIZATIONS,-Os,-O2)
+OPTIMIZATIONS+=$(call check_gcc,OPTIMIZATIONS,-Os,-O2)
# gcc 2.95 exits with 0 for "unrecognized option"
-$(if $(call is_eq,$(CONFIG_BUILD_AT_ONCE),y),\
+CFLAGS_COMBINE+=$(if $(call is_eq,$(CONFIG_BUILD_AT_ONCE),y),\
$(if $(call cc_ge,3,0),\
$(call check_gcc,CFLAGS_COMBINE,--combine,)))
-$(if $(call is_eq,$(CONFIG_BUILD_AT_ONCE),y),\
+OPTIMIZATIONS+=$(if $(call is_eq,$(CONFIG_BUILD_AT_ONCE),y),\
$(call check_gcc,OPTIMIZATIONS,-funit-at-a-time,))
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25795
-#$(if $(call is_eq,$(CONFIG_BUILD_AT_ONCE),y),\
+#PROG_CFLAGS+=$(if $(call is_eq,$(CONFIG_BUILD_AT_ONCE),y),\
# $(call check_gcc,PROG_CFLAGS,-fwhole-program,))
-$(call check_ld,LIB_LDFLAGS,--enable-new-dtags,)
-#$(call check_ld,LIB_LDFLAGS,--reduce-memory-overheads,)
-#$(call check_ld,LIB_LDFLAGS,--as-needed,)
-#$(call check_ld,LIB_LDFLAGS,--warn-shared-textrel,)
+LIB_LDFLAGS+=$(call check_ld,LIB_LDFLAGS,--enable-new-dtags,)
+#LIB_LDFLAGS+=$(call check_ld,LIB_LDFLAGS,--reduce-memory-overheads,)
+#LIB_LDFLAGS+=$(call check_ld,LIB_LDFLAGS,--as-needed,)
+#LIB_LDFLAGS+=$(call check_ld,LIB_LDFLAGS,--warn-shared-textrel,)
-$(call check_ld,PROG_LDFLAGS,--gc-sections,)
+PROG_LDFLAGS+=$(call check_ld,PROG_LDFLAGS,--gc-sections,)
# Some nice architecture specific optimizations
ifeq ($(__TARGET_ARCH),arm)
OPTIMIZATIONS+=-fstrict-aliasing
endif # arm
-$(if $(call is_eq,$(__TARGET_ARCH),i386),\
+OPTIMIZATIONS+=$(if $(call is_eq,$(__TARGET_ARCH),i386),\
$(call check_gcc,OPTIMIZATIONS,-march=i386,))
# gcc-4.0 and older seem to benefit from these
-$(if $(call cc_le,4,0),\
+OPTIMIZATIONS+=$(if $(call cc_le,4,0),\
$(call check_gcc,OPTIMIZATIONS,-mpreferred-stack-boundary=2,)\
$(call check_gcc,OPTIMIZATIONS,-falign-functions=1 -falign-jumps=1 -falign-loops=1,\
-malign-functions=0 -malign-jumps=0 -malign-loops=0))
# gcc-4.1 and beyond seem to benefit from these
# turn off flags which hurt -Os
-$(if $(call cc_ge,4,1),\
+OPTIMIZATIONS+=$(if $(call cc_ge,4,1),\
$(call check_gcc,OPTIMIZATIONS,-fno-tree-loop-optimize,)\
$(call check_gcc,OPTIMIZATIONS,-fno-tree-dominator-opts,)\
$(call check_gcc,OPTIMIZATIONS,-fno-strength-reduce,)\
\
$(call check_gcc,OPTIMIZATIONS,-fno-branch-count-reg,))
-$(call check_gcc,OPTIMIZATIONS,-fomit-frame-pointer,)
+OPTIMIZATIONS+=$(call check_gcc,OPTIMIZATIONS,-fomit-frame-pointer,)
#
#--------------------------------------------------------
endif
endif
-$(if $(call is_eq,$(CONFIG_DEBUG),y),\
- $(call check_ld,LDFLAGS,--warn-common,),\
- $(call check_ld,LDFLAGS,--warn-common,)$(call check_ld,LDFLAGS,--sort-common,))
+LDFLAGS+=$(if $(call is_eq,$(CONFIG_DEBUG),y),$(call check_ld,LDFLAGS,--warn-common,)$(call check_ld,LDFLAGS,--sort-common,))
ifeq ($(CONFIG_DEBUG),y)
CFLAGS +=$(WARNINGS) -g -D_GNU_SOURCE
STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging
CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG
STRIPCMD:=$(STRIP) -s --remove-section=.note --remove-section=.comment
endif
-$(if $(call is_eq,$(CONFIG_STATIC),y),\
+PROG_CFLAGS+=$(if $(call is_eq,$(CONFIG_STATIC),y),\
$(call check_gcc,PROG_CFLAGS,-static,))
-$(call check_gcc,CFLAGS_SHARED,-shared,)
+CFLAGS_SHARED+=$(call check_gcc,CFLAGS_SHARED,-shared,)
LIB_CFLAGS+=$(CFLAGS_SHARED)
-$(if $(call is_eq,$(CONFIG_BUILD_LIBBUSYBOX),y),\
+CFLAGS_PIC+=$(if $(call is_eq,$(CONFIG_BUILD_LIBBUSYBOX),y),\
$(call check_gcc,CFLAGS_PIC,-fPIC,))
+LIB_CFLAGS+=$(CFLAGS_PIC)
ifeq ($(CONFIG_SELINUX),y)
LIBRARIES += -lselinux
.SUFFIXES: .c .S .o .os .om .osm .oS .so .a .s .i .E
# generic rules
-%.o: %.c ; $(compile.c)
-%.os: %.c ; $(compile.c) $(CFLAGS_PIC)
%.o: ; $(compile.c)
%.os: ; $(compile.c) $(CFLAGS_PIC)
%.om: ; $(compile.m)
%.osm: ; $(compile.m) $(CFLAGS_PIC)
+%.a: ; $(do_ar)
endif # rules-mak-rules
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/applets
-objdir=$(top_builddir)/applets
+srcdir:=$(top_srcdir)/applets
+objdir:=$(top_builddir)/applets
APPLETS_SRC:= $(patsubst %,$(srcdir)/%,applets.c busybox.c version.c)
applets_OBJ:=$(patsubst $(srcdir)/%.c,$(objdir)/%.o,$(APPLETS_SRC))
+$(applets_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/applets.a: $(applets_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/applets.a
+
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/archival
-objdir=$(top_builddir)/archival
+srcdir:=$(top_srcdir)/archival
+objdir:=$(top_builddir)/archival
ARCHIVAL-$(CONFIG_AR) += ar.o
ARCHIVAL-$(CONFIG_BUNZIP2) += bunzip2.o
archival_OBJ:= $(patsubst %,$(objdir)/%,$(ARCHIVAL-y))
+$(archival_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/archival.a: $(archival_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/archival.a
+
#
# Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/archival/libunarchive
-objdir=$(top_builddir)/archival/libunarchive
+srcdir:=$(top_srcdir)/archival/libunarchive
+objdir:=$(top_builddir)/archival/libunarchive
LIBUNARCHIVE-y:= \
\
archival_libunarchive_OBJ$(os):=$(patsubst %,$(objdir)/%$(os),$(LIBUNARCHIVE-y))
+$(archival_libunarchive_OBJ$(os)): $(objdir)/%$(os): $(srcdir)/%.c
+$(objdir)/libunarchive.a: $(archival_libunarchive_OBJ$(os))
+libraries-y:=$(libraries-y) $(objdir)/libunarchive.a
+
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/console-tools
-objdir=$(top_builddir)/console-tools
+srcdir:=$(top_srcdir)/console-tools
+objdir:=$(top_builddir)/console-tools
CONSOLETOOLS-$(CONFIG_CHVT) += chvt.o
CONSOLETOOLS-$(CONFIG_CLEAR) += clear.o
console-tools_OBJ:= $(patsubst %,$(objdir)/%,$(CONSOLETOOLS-y))
+$(console-tools_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/console-tools.a: $(console-tools_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/console-tools.a
+
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/coreutils
-objdir=$(top_builddir)/coreutils
+srcdir:=$(top_srcdir)/coreutils
+objdir:=$(top_builddir)/coreutils
COREUTILS-$(CONFIG_BASENAME) += basename.o
COREUTILS-$(CONFIG_CAL) += cal.o
coreutils_OBJ:= $(patsubst %,$(objdir)/%,$(COREUTILS-y))
+$(coreutils_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/coreutils.a: $(coreutils_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/coreutils.a
+
#
# Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/coreutils/libcoreutils
-objdir=$(top_builddir)/coreutils/libcoreutils
+srcdir:=$(top_srcdir)/coreutils/libcoreutils
+objdir:=$(top_builddir)/coreutils/libcoreutils
LIBCOREUTILS-$(CONFIG_MKFIFO) += getopt_mk_fifo_nod
LIBCOREUTILS-$(CONFIG_MKNOD) += getopt_mk_fifo_nod
LIBRARY_SRC-a+=$(LIBCOREUTILS_SRC-a)
coreutils_libcoreutils_OBJ$(os):=$(patsubst %,$(objdir)/%$(os),$(LIBCOREUTILS-y))
+
+$(coreutils_libcoreutils_OBJ$(os)): $(objdir)/%$(os): $(srcdir)/%.c
+$(objdir)/libcoreutils.a: $(coreutils_libcoreutils_OBJ$(os))
+libraries-y:=$(libraries-y) $(objdir)/libcoreutils.a
+
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/debianutils
-objdir=$(top_builddir)/debianutils
+srcdir:=$(top_srcdir)/debianutils
+objdir:=$(top_builddir)/debianutils
DEBIANUTILS-$(CONFIG_MKTEMP) += mktemp.o
DEBIANUTILS-$(CONFIG_PIPE_PROGRESS) += pipe_progress.o
debianutils_OBJ:= $(patsubst %,$(objdir)/%,$(DEBIANUTILS-y))
+$(debianutils_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/debianutils.a: $(debianutils_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/debianutils.a
+
# may have object files created after the timestamp of the directory was
# updated which would lead to spurious rebuilds (as some of the dentries
# may be older than the dir itself).
-ifneq ($(MAKE_VERSION),3.81beta4)
-# /top/obj/dir/*.o: /top/obj/dir/file.o: /top/src/dir/file.c
-$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid/%.o: $(srcdir)/blkid/%.c |$(objdir)/blkid
-$(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck/%.o:$(srcdir)/e2fsck/%.c|$(objdir)/e2fsck
-$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p/%.o: $(srcdir)/e2p/%.c |$(objdir)/e2p
-$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs/%.o:$(srcdir)/ext2fs/%.c|$(objdir)/ext2fs
-$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid/%.o: $(srcdir)/uuid/%.c |$(objdir)/uuid
-else
+ifeq ($(MAKE_VERSION),3.81beta4)
# alleged bug in 3.81beta4. Stripping dir from dir/files.c
# /top/obj/dir/*.o: /top/obj/dir/file.o: /top/src/file.c
$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid/%.o: $(srcdir)/%.c |$(objdir)/blkid
$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p/%.o: $(srcdir)/%.c |$(objdir)/e2p
$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs/%.o:$(srcdir)/%.c|$(objdir)/ext2fs
$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid/%.o: $(srcdir)/%.c |$(objdir)/uuid
+
+e2fsprogs-rules-seen:=1
+endif
+
+ifeq ($(MAKE_VERSION),3.79.1)
+# no order-only prerequesites
+$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid/%.o: $(srcdir)/blkid/%.c #|$(objdir)/blkid
+$(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck/%.o:$(srcdir)/e2fsck/%.c#|$(objdir)/e2fsck
+$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p/%.o: $(srcdir)/e2p/%.c #|$(objdir)/e2p
+$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs/%.o:$(srcdir)/ext2fs/%.c#|$(objdir)/ext2fs
+$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid/%.o: $(srcdir)/uuid/%.c #|$(objdir)/uuid
+$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid
+$(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck
+$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p
+$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs
+$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid
+$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid
+$(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck
+$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p
+$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs
+$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid
+
+e2fsprogs-rules-seen:=1
endif
+ifndef e2fsprogs-rules-seen
+$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid/%.o: $(srcdir)/blkid/%.c |$(objdir)/blkid
+$(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck/%.o:$(srcdir)/e2fsck/%.c|$(objdir)/e2fsck
+$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p/%.o: $(srcdir)/e2p/%.c |$(objdir)/e2p
+$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs/%.o:$(srcdir)/ext2fs/%.c|$(objdir)/ext2fs
+$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid/%.o: $(srcdir)/uuid/%.c |$(objdir)/uuid
+endif
+
+
E2FSPROGS-$(CONFIG_CHATTR) += chattr.o $(E2P_OBJS)
E2FSPROGS-$(CONFIG_E2FSCK) += e2fsck.o util.o $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
E2FSPROGS-$(CONFIG_FSCK) += fsck.o util.o $(BLKID_OBJS) $(UUID_OBJS)
e2fsprogs_OBJ:= $(patsubst %,$(objdir)/%,$(E2FSPROGS-y))
+$(e2fsprogs_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/e2fsprogs.a: $(e2fsprogs_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/e2fsprogs.a
+
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/editors
-objdir=$(top_builddir)/editors
+srcdir:=$(top_srcdir)/editors
+objdir:=$(top_builddir)/editors
EDITORS-$(CONFIG_AWK) += awk.o
EDITORS-$(CONFIG_PATCH) += patch.o
editors_OBJ:= $(patsubst %,$(objdir)/%,$(EDITORS-y))
+$(editors_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/editors.a: $(editors_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/editors.a
+
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/findutils
-objdir=$(top_builddir)/findutils
+srcdir:=$(top_srcdir)/findutils
+objdir:=$(top_builddir)/findutils
FINDUTILS-$(CONFIG_FIND) += find.o
FINDUTILS-$(CONFIG_GREP) += grep.o
findutils_OBJ:= $(patsubst %,$(objdir)/%,$(FINDUTILS-y))
+$(findutils_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/findutils.a: $(findutils_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/findutils.a
+
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/init
-objdir=$(top_builddir)/init
+srcdir:=$(top_srcdir)/init
+objdir:=$(top_builddir)/init
INIT-$(CONFIG_HALT) += halt.o
INIT-$(CONFIG_INIT) += init.o
init_OBJ:= $(patsubst %,$(objdir)/%,$(INIT-y))
+$(init_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/init.a: $(init_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/init.a
+
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/libbb
-objdir=$(top_builddir)/libbb
+srcdir:=$(top_srcdir)/libbb
+objdir:=$(top_builddir)/libbb
LIBBB-n:=
LIBBB-y:= \
$(LIBBB_MOBJ6:.osm=.om): $(LIBBB_MSRC6)
endif
+$(libbb_OBJ.os): $(objdir)/%.os: $(srcdir)/%.c
+$(libbb_OBJ.o): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/libbb.a: $(libbb_OBJ$(os)) $(libbb_MOBJ$(os))
+libraries-y:=$(libraries-y) $(objdir)/libbb.a
+
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/libpwdgrp
-objdir=$(top_builddir)/libpwdgrp
+srcdir:=$(top_srcdir)/libpwdgrp
+objdir:=$(top_builddir)/libpwdgrp
LIBPWDGRP_MSRC0:=$(srcdir)/pwd_grp.c
LIBPWDGRP_M0-$(CONFIG_USE_BB_PWD_GRP):= fgetpwent_r fgetgrent_r \
$(LIBPWDGRP_MOBJ0:.osm=.om): $(LIBPWDGRP_MSRC0)
$(LIBPWDGRP_MOBJ1:.osm=.om): $(LIBPWDGRP_MSRC1)
endif
+
+$(objdir)/libpwdgrp.a: $(libpwdgrp_MOBJ$(os))
+libraries-y:=$(libraries-y) $(objdir)/libpwdgrp.a
+
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/loginutils
-objdir=$(top_builddir)/loginutils
+srcdir:=$(top_srcdir)/loginutils
+objdir:=$(top_builddir)/loginutils
LOGINUTILS-$(CONFIG_ADDGROUP) += addgroup.o
LOGINUTILS-$(CONFIG_ADDUSER) += adduser.o
loginutils_OBJ:= $(patsubst %,$(objdir)/%,$(LOGINUTILS-y))
+$(loginutils_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/loginutils.a: $(loginutils_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/loginutils.a
+
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/miscutils
-objdir=$(top_builddir)/miscutils
+srcdir:=$(top_srcdir)/miscutils
+objdir:=$(top_builddir)/miscutils
MISCUTILS-$(CONFIG_ADJTIMEX) += adjtimex.o
MISCUTILS-$(CONFIG_CROND) += crond.o
miscutils_OBJ:= $(patsubst %,$(objdir)/%,$(MISCUTILS-y))
+$(miscutils_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/miscutils.a: $(miscutils_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/miscutils.a
+
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/modutils
-objdir=$(top_builddir)/modutils
+srcdir:=$(top_srcdir)/modutils
+objdir:=$(top_builddir)/modutils
MODUTILS-$(CONFIG_INSMOD) += insmod.o
MODUTILS-$(CONFIG_LSMOD) += lsmod.o
modutils_OBJ:= $(patsubst %,$(objdir)/%,$(MODUTILS-y))
+$(modutils_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/modutils.a: $(modutils_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/modutils.a
+
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/networking
-objdir=$(top_builddir)/networking
+srcdir:=$(top_srcdir)/networking
+objdir:=$(top_builddir)/networking
NETWORKING-$(CONFIG_ARPING) += arping.o
NETWORKING-$(CONFIG_DNSD) += dnsd.o
networking_OBJ:= $(patsubst %,$(objdir)/%,$(NETWORKING-y))
+$(networking_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/networking.a: $(networking_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/networking.a
+
# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
#
# Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
-#
-srcdir=$(top_srcdir)/networking/libiproute
-objdir=$(top_builddir)/networking/libiproute
+srcdir:=$(top_srcdir)/networking/libiproute
+objdir:=$(top_builddir)/networking/libiproute
LIBIPROUTE-$(CONFIG_IP) += \
ip_parse_common_args \
networking_libiproute_OBJ$(os):=$(patsubst %,$(objdir)/%$(os),$(LIBIPROUTE-y))
+$(networking_libiproute_OBJ$(os)): $(objdir)/%$(os): $(srcdir)/%.c
+$(objdir)/networking.a: $(networking_libiproute_OBJ$(os))
+libraries-y:=$(libraries-y) $(objdir)/networking.a
+
#
# Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/networking/udhcp
-objdir=$(top_builddir)/networking/udhcp
+srcdir:=$(top_srcdir)/networking/udhcp
+objdir:=$(top_builddir)/networking/udhcp
#ok, so I forgot how to do an or, but this is a quick and dirty hack
ifeq ($(strip $(CONFIG_UDHCPC)),y)
networking_udhcp_OBJ:=$(patsubst %.c,$(objdir)/%.o,$(UDHCP-y))
+$(networking_udhcp_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/udhcp.a: $(networking_udhcp_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/udhcp.a
+
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/procps
-objdir=$(top_builddir)/procps
+srcdir:=$(top_srcdir)/procps
+objdir:=$(top_builddir)/procps
PROCPS-$(CONFIG_FREE) += free.o
PROCPS-$(CONFIG_KILL) += kill.o
procps_OBJ:= $(patsubst %,$(objdir)/%,$(PROCPS-y))
+$(procps_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/procps.a: $(procps_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/procps.a
+
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/shell
-objdir=$(top_builddir)/shell
+srcdir:=$(top_srcdir)/shell
+objdir:=$(top_builddir)/shell
SHELL-$(CONFIG_ASH) += ash.o
SHELL-$(CONFIG_HUSH) += hush.o
shell_OBJ:= $(patsubst %,$(objdir)/%,$(SHELL-y))
+$(shell_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/shell.a: $(shell_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/shell.a
+
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/sysklogd
-objdir=$(top_builddir)/sysklogd
+srcdir:=$(top_srcdir)/sysklogd
+objdir:=$(top_builddir)/sysklogd
SYSKLOGD-$(CONFIG_KLOGD) += klogd.o
SYSKLOGD-$(CONFIG_LOGGER) += logger.o
sysklogd_OBJ:= $(patsubst %,$(objdir)/%,$(SYSKLOGD-y))
+$(sysklogd_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/sysklogd.a: $(sysklogd_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/sysklogd.a
+
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
-srcdir=$(top_srcdir)/util-linux
-objdir=$(top_builddir)/util-linux
+srcdir:=$(top_srcdir)/util-linux
+objdir:=$(top_builddir)/util-linux
UTIL-LINUX-$(CONFIG_DMESG) +=dmesg.o
UTIL-LINUX-$(CONFIG_FBSET) +=fbset.o
util-linux_OBJ:= $(patsubst %,$(objdir)/%,$(UTIL-LINUX-y))
+$(util-linux_OBJ): $(objdir)/%.o: $(srcdir)/%.c
+$(objdir)/util-linux.a: $(util-linux_OBJ)
+libraries-y:=$(libraries-y) $(objdir)/util-linux.a
+