aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Eric Andersen <andersen@codepoet.org>2005-02-10 03:06:39 +0000
committerGravatar Eric Andersen <andersen@codepoet.org>2005-02-10 03:06:39 +0000
commitd06645d8eddce3a22144a9ef8961a8f7599d319e (patch)
tree526cac83ded3499b57032bb118ffbab0b72222d4
parent040f60b3ea53947675333e60e14838ddd9944abd (diff)
downloadbuildroot-d06645d8eddce3a22144a9ef8961a8f7599d319e.tar.gz
buildroot-d06645d8eddce3a22144a9ef8961a8f7599d319e.tar.bz2
There is no need to have a separate 'Makefile.in' file in the
general case, therefore, combine the toplevel Makefile options such as setting TARGETS into the per-package *.mk file
-rw-r--r--Makefile14
-rw-r--r--docs/buildroot-documentation.html63
-rw-r--r--package/autoconf/Makefile.in3
-rw-r--r--package/autoconf/autoconf.mk8
-rw-r--r--package/automake/Makefile.in3
-rw-r--r--package/automake/automake.mk8
-rw-r--r--package/bash/Makefile.in3
-rw-r--r--package/bash/bash.mk8
-rw-r--r--package/berkeleydb/Makefile.in3
-rw-r--r--package/berkeleydb/berkeleydb.mk8
-rw-r--r--package/bison/Makefile.in3
-rw-r--r--package/bison/bison.mk8
-rw-r--r--package/boa/Makefile.in3
-rw-r--r--package/boa/boa.mk8
-rw-r--r--package/bridge/Makefile.in3
-rw-r--r--package/bridge/bridge.mk8
-rw-r--r--package/busybox/Makefile.in3
-rw-r--r--package/busybox/busybox.mk8
-rw-r--r--package/bzip2/Makefile.in3
-rw-r--r--package/bzip2/bzip2.mk8
-rw-r--r--package/config/Config.in8
-rw-r--r--package/config/Makefile.in3
-rw-r--r--package/coreutils/Makefile.in3
-rw-r--r--package/coreutils/coreutils.mk8
-rw-r--r--package/customize/Makefile.in3
-rw-r--r--package/customize/customize.mk8
-rw-r--r--package/dhcp_relay/Makefile.in3
-rw-r--r--package/dhcp_relay/dhcp_relay.mk8
-rw-r--r--package/diffutils/Makefile.in3
-rw-r--r--package/diffutils/diffutils.mk8
-rw-r--r--package/distcc/Makefile.in3
-rw-r--r--package/distcc/distcc.mk8
-rw-r--r--package/dnsmasq/Makefile.in3
-rw-r--r--package/dnsmasq/dnsmasq.mk8
-rw-r--r--package/dropbear_sshd/Makefile.in3
-rw-r--r--package/dropbear_sshd/dropbear_sshd.mk8
-rw-r--r--package/ed/Makefile.in3
-rw-r--r--package/ed/ed.mk8
-rw-r--r--package/fakeroot/Makefile.in3
-rw-r--r--package/fakeroot/fakeroot.mk8
-rw-r--r--package/file/Makefile.in3
-rw-r--r--package/file/file.mk8
-rw-r--r--package/findutils/Makefile.in3
-rw-r--r--package/findutils/findutils.mk8
-rw-r--r--package/flex/Makefile.in3
-rw-r--r--package/flex/flex.mk8
-rw-r--r--package/gawk/Makefile.in3
-rw-r--r--package/gawk/gawk.mk8
-rw-r--r--package/gettext/Makefile.in3
-rw-r--r--package/gettext/gettext.mk8
-rw-r--r--package/grep/Makefile.in3
-rw-r--r--package/grep/grep.mk8
-rw-r--r--package/gzip/Makefile.in3
-rw-r--r--package/gzip/gzip.mk8
-rw-r--r--package/hostap/Makefile.in3
-rw-r--r--package/hostap/hostap.mk8
-rw-r--r--package/hotplug/Makefile.in3
-rw-r--r--package/hotplug/hotplug.mk8
-rw-r--r--package/iproute2/Makefile.in3
-rw-r--r--package/iproute2/iproute2.mk8
-rw-r--r--package/iptables/Makefile.in3
-rw-r--r--package/iptables/iptables.mk8
-rw-r--r--package/jpeg/Makefile.in3
-rw-r--r--package/jpeg/jpeg.mk8
-rw-r--r--package/less/Makefile.in3
-rw-r--r--package/less/less.mk8
-rw-r--r--package/libfloat/Makefile.in3
-rw-r--r--package/libfloat/libfloat.mk8
-rw-r--r--package/libglib12/Makefile.in3
-rw-r--r--package/libglib12/libglib12.mk8
-rw-r--r--package/libmad/Makefile.in3
-rw-r--r--package/libmad/libmad.mk8
-rw-r--r--package/libpcap/Makefile.in3
-rw-r--r--package/libpcap/libpcap.mk8
-rw-r--r--package/libpng/Makefile.in3
-rw-r--r--package/libpng/libpng.mk8
-rw-r--r--package/libtool/Makefile.in3
-rw-r--r--package/libtool/libtool.mk8
-rw-r--r--package/links/Makefile.in3
-rw-r--r--package/links/links.mk8
-rw-r--r--package/linux/Makefile.in3
-rw-r--r--package/linux/linux.mk8
-rw-r--r--package/lrzsz/Makefile.in3
-rw-r--r--package/lrzsz/lrzsz.mk8
-rw-r--r--package/ltp-testsuite/Makefile.in3
-rw-r--r--package/ltp-testsuite/ltp-testsuite.mk8
-rw-r--r--package/ltrace/Makefile.in3
-rw-r--r--package/ltrace/ltrace.mk8
-rw-r--r--package/lzo/Makefile.in3
-rw-r--r--package/lzo/lzo.mk8
-rw-r--r--package/m4/Makefile.in3
-rw-r--r--package/m4/m4.mk8
-rw-r--r--package/make/Makefile.in3
-rw-r--r--package/make/make.mk8
-rw-r--r--package/microcom/Makefile.in3
-rw-r--r--package/microcom/microcom.mk8
-rw-r--r--package/microwin/Makefile.in3
-rw-r--r--package/microwin/microwin.mk8
-rw-r--r--package/mkdosfs/Makefile.in3
-rw-r--r--package/mkdosfs/mkdosfs.mk8
-rw-r--r--package/mke2fs/Makefile.in3
-rw-r--r--package/mke2fs/mke2fs.mk8
-rw-r--r--package/mpg123/Makefile.in3
-rw-r--r--package/mpg123/mpg123.mk8
-rw-r--r--package/mrouted/Makefile.in3
-rw-r--r--package/mrouted/mrouted.mk8
-rw-r--r--package/mtd/Makefile.in3
-rw-r--r--package/mtd/mtd.mk8
-rw-r--r--package/nano/Makefile.in3
-rw-r--r--package/nano/nano.mk8
-rw-r--r--package/ncurses/Makefile.in3
-rw-r--r--package/ncurses/ncurses.mk8
-rw-r--r--package/netkitbase/Makefile.in3
-rw-r--r--package/netkitbase/netkitbase.mk8
-rw-r--r--package/netkittelnet/Makefile.in3
-rw-r--r--package/netkittelnet/netkittelnet.mk8
-rw-r--r--package/netsnmp/Makefile.in3
-rw-r--r--package/netsnmp/netsnmp.mk8
-rw-r--r--package/newt/Makefile.in3
-rw-r--r--package/newt/newt.mk8
-rw-r--r--package/ntp/Makefile.in3
-rw-r--r--package/ntp/ntp.mk8
-rw-r--r--package/openssh/Makefile.in3
-rw-r--r--package/openssh/openssh.mk8
-rw-r--r--package/openssl/Makefile.in3
-rw-r--r--package/openssl/openssl.mk8
-rw-r--r--package/openvpn/Makefile.in3
-rw-r--r--package/openvpn/openvpn.mk8
-rw-r--r--package/patch/Makefile.in3
-rw-r--r--package/patch/patch.mk8
-rw-r--r--package/pciutils/Makefile.in3
-rw-r--r--package/pciutils/pciutils.mk8
-rw-r--r--package/pcmcia/Makefile.in3
-rw-r--r--package/pcmcia/pcmcia.mk8
-rw-r--r--package/portage/Makefile.in3
-rw-r--r--package/portage/portage.mk8
-rw-r--r--package/portmap/Makefile.in3
-rw-r--r--package/portmap/portmap.mk8
-rw-r--r--package/pppd/Makefile.in3
-rw-r--r--package/pppd/pppd.mk8
-rw-r--r--package/procps/Makefile.in3
-rw-r--r--package/procps/procps.mk8
-rw-r--r--package/python/Makefile.in3
-rw-r--r--package/python/python.mk8
-rw-r--r--package/raidtools/Makefile.in3
-rw-r--r--package/raidtools/raidtools.mk8
-rw-r--r--package/rsync/Makefile.in3
-rw-r--r--package/rsync/rsync.mk8
-rw-r--r--package/rxvt/Makefile.in3
-rw-r--r--package/rxvt/rxvt.mk8
-rw-r--r--package/sed/Makefile.in3
-rw-r--r--package/sed/sed.mk8
-rw-r--r--package/sfdisk/Makefile.in3
-rw-r--r--package/sfdisk/sfdisk.mk8
-rw-r--r--package/slang/Makefile.in3
-rw-r--r--package/slang/slang.mk8
-rw-r--r--package/socat/Makefile.in3
-rw-r--r--package/socat/socat.mk8
-rw-r--r--package/strace/Makefile.in3
-rw-r--r--package/strace/strace.mk8
-rw-r--r--package/tar/Makefile.in3
-rw-r--r--package/tar/tar.mk8
-rw-r--r--package/tcpdump/Makefile.in3
-rw-r--r--package/tcpdump/tcpdump.mk8
-rw-r--r--package/tinylogin/Makefile.in3
-rw-r--r--package/tinylogin/tinylogin.mk8
-rw-r--r--package/tinyx/Makefile.in3
-rw-r--r--package/tinyx/tinyx.mk8
-rw-r--r--package/tn5250/Makefile.in3
-rw-r--r--package/tn5250/tn5250.mk8
-rw-r--r--package/ttcp/Makefile.in3
-rw-r--r--package/ttcp/ttcp.mk8
-rw-r--r--package/udhcp/Makefile.in3
-rw-r--r--package/udhcp/udhcp.mk8
-rw-r--r--package/util-linux/Makefile.in3
-rw-r--r--package/util-linux/util-linux.mk8
-rw-r--r--package/valgrind/Makefile.in3
-rw-r--r--package/valgrind/valgrind.mk8
-rw-r--r--package/vtun/Makefile.in3
-rw-r--r--package/vtun/vtun.mk8
-rw-r--r--package/wget/Makefile.in3
-rw-r--r--package/wget/wget.mk8
-rw-r--r--package/which/Makefile.in3
-rw-r--r--package/which/which.mk8
-rw-r--r--package/wtools/Makefile.in3
-rw-r--r--package/wtools/wtools.mk8
-rw-r--r--package/zlib/Makefile.in3
-rw-r--r--package/zlib/zlib.mk8
-rw-r--r--target/cramfs/Makefile.in3
-rw-r--r--target/cramfs/cramfs.mk8
-rw-r--r--target/ext2/Makefile.in3
-rw-r--r--target/ext2/ext2root.mk8
-rw-r--r--target/jffs2/Makefile.in3
-rw-r--r--target/jffs2/jffs2root.mk10
-rw-r--r--target/squashfs/Makefile.in3
-rw-r--r--target/squashfs/squashfsroot.mk8
-rw-r--r--target/tar/Makefile.in3
-rw-r--r--target/tar/tarroot.mk9
-rw-r--r--toolchain/Makefile.in3
-rw-r--r--toolchain/binutils/Makefile.in1
-rw-r--r--toolchain/binutils/binutils.mk6
-rw-r--r--toolchain/ccache/Makefile.in6
-rw-r--r--toolchain/ccache/ccache.mk11
-rw-r--r--toolchain/gcc/Makefile.in6
-rw-r--r--toolchain/gdb/Makefile.in14
-rw-r--r--toolchain/gdb/gdb.mk19
-rw-r--r--toolchain/kernel-headers/Makefile.in3
-rw-r--r--toolchain/kernel-headers/kernel-headers.mk8
208 files changed, 868 insertions, 367 deletions
diff --git a/Makefile b/Makefile
index 3b263de310..e6eb5cca9a 100644
--- a/Makefile
+++ b/Makefile
@@ -51,11 +51,8 @@ ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
##############################################################
TARGETS:=host-sed kernel-headers uclibc-configured binutils gcc uclibc-target-utils
include toolchain/Makefile.in
-include toolchain/*/Makefile.in
include package/Makefile.in
-include package/*/Makefile.in
include target/Makefile.in
-include target/*/Makefile.in
#############################################################
#
@@ -71,6 +68,13 @@ all: world
# In this section, we need .config
include .config.cmd
+# We also need the various per-package makefiles, which also add
+# each selected package to TARGETS if that package was selected
+# in the .config file.
+include toolchain/*/*.mk
+include package/*/*.mk
+include target/*/*.mk
+
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS))
TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
@@ -81,10 +85,6 @@ world: $(DL_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) $(TARGETS)
$(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \
$(DL_DIR) $(BUILD_DIR) $(TOOL_BUILD_DIR) $(STAGING_DIR)
-include toolchain/*/*.mk
-include package/*/*.mk
-include target/*/*.mk
-
#############################################################
#
# staging and target directories do NOT list these as
diff --git a/docs/buildroot-documentation.html b/docs/buildroot-documentation.html
index 35b824a7c5..8897ff67ea 100644
--- a/docs/buildroot-documentation.html
+++ b/docs/buildroot-documentation.html
@@ -292,7 +292,7 @@
skeleton.</li>
</ul>
- <p>Each directory contains at least 3 files :</p>
+ <p>Each directory contains at least 2 files :</p>
<ul>
<li><code>something.mk</code> is the Makefile that downloads, configures,
@@ -302,10 +302,6 @@
description file. It describes the option related to the current
software.</li>
- <li><code>Makefile.in</code> is a part of Makefile that sets various
- variables according to the configuration given through the configuration
- tool. For most tools it simply involves adding the name of the tool to
- the <code>TARGETS</code> variable.</li>
</ul>
<p>The main Makefile do the job through the following steps (once the
@@ -343,9 +339,10 @@
<code>target/default/target_skeleton</code> and then removes useless
<code>CVS/</code> directories.</li>
- <li>Make the <code>TARGETS</code> dependency. This is where all the job
- is done : all <code>Makefile.in</code> files "subscribe" targets into
- this global variable, so that the needed tools gets compiled.</li>
+ <li>Add the <code>TARGETS</code> dependency. This should generally check
+ if the configuration option for this package is enabled, and if so then
+ "subscribe" this package to be compiled by adding it to the TARGETS
+ global variable.</li>
</ol>
<h2><a name="using_toolchain" id="using_toolchain"></a>Using the
@@ -441,26 +438,6 @@ config BR2_PACKAGE_FOO
<p>Of course, you can add other options to configure particular
things in your software.</p>
- <h3><code>Makefile.in</code> file</h3>
-
- <p>Then, write a <code>Makefile.in</code> file. Basically, this is
- a very short <i>Makefile</i> that adds the name of the software to
- the list of <code>TARGETS</code> that Buildroot will generate. In
- fact, the name of the software is the the identifier of the target
- inside the real <i>Makefile</i> that will do everything (download,
- compile, install), and that we study below. Back to
- <code>Makefile.in</code>, here is an example :</p>
-
-<pre>
-ifeq ($(strip $(BR2_PACKAGE_FOO)),y)
-TARGETS+=foo
-endif
-</pre>
-
- <p>As you can see, this short <i>Makefile</i> simply adds the
- target <code>foo</code> to the list of targets handled by Buildroot
- if software <i>foo</i> was selected using the configuration tool.</p>
-
<h3>The real <i>Makefile</i></h3>
<p>Finally, here's the hardest part. Create a file named
@@ -520,6 +497,15 @@ endif
48 foo-dirclean:
49 rm -rf $(FOO_DIR)
50
+ 51 #############################################################
+ 52 #
+ 53 # Toplevel Makefile options
+ 54 #
+ 55 #############################################################
+ 56 ifeq ($(strip $(BR2_PACKAGE_FOO)),y)
+ 57 TARGETS+=foo
+ 58 endif
+
</pre>
<p>First of all, this <i>Makefile</i> example works for a single
@@ -602,11 +588,13 @@ endif
removed to save space.</p>
<p>Line 40 defines the main target of the software, the one
- referenced in the <code>Makefile.in</code> file. This targets
- should first of all depends on the dependecies of the software (in
- our example, <i>uclibc</i> and <i>ncurses</i>), and then to the
+ that will be eventually be used by the top level
+ <code>Makefile</code> to download, compile, and then install
+ this package. This target should first of all depends on all
+ needed dependecies of the software (in our example,
+ <i>uclibc</i> and <i>ncurses</i>), and also depend on the
final binary. This last dependency will call all previous
- dependencies in the right order. </p>
+ dependencies in the correct order. </p>
<p>Line 42 defines a simple target that only downloads the code
source. This is not used during normal operation of Buildroot, but
@@ -619,6 +607,17 @@ endif
directory in which the software was uncompressed, configured and
compiled.</p>
+ <p>Lines 51-58 adds the target <code>foo</code> to the list
+ of targets to be compiled by Buildroot by first checking if
+ the configuration option for this package has been enabled
+ using the configuration tool, and if so then "subscribes"
+ this package to be compiled by adding it to the TARGETS
+ global variable. The name added to the TARGETS global
+ variable is the name of this package's target, as defined on
+ line 40, which is used by Buildroot to download, compile, and
+ then install this package.</p>
+
+
<h3>Conclusion</h3>
<p>As you can see, adding a software to buildroot is simply a
diff --git a/package/autoconf/Makefile.in b/package/autoconf/Makefile.in
deleted file mode 100644
index 30dbd840ae..0000000000
--- a/package/autoconf/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_AUTOCONF)),y)
-TARGETS+=autoconf
-endif
diff --git a/package/autoconf/autoconf.mk b/package/autoconf/autoconf.mk
index ff9251085e..ce1ba315e9 100644
--- a/package/autoconf/autoconf.mk
+++ b/package/autoconf/autoconf.mk
@@ -70,3 +70,11 @@ autoconf-clean:
autoconf-dirclean:
rm -rf $(AUTOCONF_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_AUTOCONF)),y)
+TARGETS+=autoconf
+endif
diff --git a/package/automake/Makefile.in b/package/automake/Makefile.in
deleted file mode 100644
index 0dd3de627f..0000000000
--- a/package/automake/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_AUTOMAKE)),y)
-TARGETS+=automake
-endif
diff --git a/package/automake/automake.mk b/package/automake/automake.mk
index dc4788f0de..31ba69dde5 100644
--- a/package/automake/automake.mk
+++ b/package/automake/automake.mk
@@ -74,3 +74,11 @@ automake-clean:
automake-dirclean:
rm -rf $(AUTOMAKE_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_AUTOMAKE)),y)
+TARGETS+=automake
+endif
diff --git a/package/bash/Makefile.in b/package/bash/Makefile.in
deleted file mode 100644
index aa94d84051..0000000000
--- a/package/bash/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_BASH)),y)
-TARGETS+=bash
-endif
diff --git a/package/bash/bash.mk b/package/bash/bash.mk
index 64f40d7be2..d25b1558e8 100644
--- a/package/bash/bash.mk
+++ b/package/bash/bash.mk
@@ -78,3 +78,11 @@ bash-clean:
bash-dirclean:
rm -rf $(BASH_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_BASH)),y)
+TARGETS+=bash
+endif
diff --git a/package/berkeleydb/Makefile.in b/package/berkeleydb/Makefile.in
deleted file mode 100644
index ca6146c768..0000000000
--- a/package/berkeleydb/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_BERKELEYDB)),y)
-TARGETS+=berkeleydb
-endif
diff --git a/package/berkeleydb/berkeleydb.mk b/package/berkeleydb/berkeleydb.mk
index bc9b3472a0..2602079d9c 100644
--- a/package/berkeleydb/berkeleydb.mk
+++ b/package/berkeleydb/berkeleydb.mk
@@ -92,3 +92,11 @@ berkeleydb-dirclean:
berkeleydb: uclibc $(TARGET_DIR)/lib/$(DB_SHARLIB)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_BERKELEYDB)),y)
+TARGETS+=berkeleydb
+endif
diff --git a/package/bison/Makefile.in b/package/bison/Makefile.in
deleted file mode 100644
index d67c078ba7..0000000000
--- a/package/bison/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_BISON)),y)
-TARGETS+=bison
-endif
diff --git a/package/bison/bison.mk b/package/bison/bison.mk
index 84d8723f5f..d9ec72fdea 100644
--- a/package/bison/bison.mk
+++ b/package/bison/bison.mk
@@ -60,3 +60,11 @@ bison-clean:
bison-dirclean:
rm -rf $(BISON_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_BISON)),y)
+TARGETS+=bison
+endif
diff --git a/package/boa/Makefile.in b/package/boa/Makefile.in
deleted file mode 100644
index 74684d7974..0000000000
--- a/package/boa/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_BOA)),y)
-TARGETS+=boa
-endif
diff --git a/package/boa/boa.mk b/package/boa/boa.mk
index 4fd32c6139..9ea27b8e2d 100644
--- a/package/boa/boa.mk
+++ b/package/boa/boa.mk
@@ -74,3 +74,11 @@ boa-clean:
boa-dirclean:
rm -rf $(BOA_DIR) $(BOA_WORKDIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_BOA)),y)
+TARGETS+=boa
+endif
diff --git a/package/bridge/Makefile.in b/package/bridge/Makefile.in
deleted file mode 100644
index 5636052953..0000000000
--- a/package/bridge/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_BRIDGE)),y)
-TARGETS+=bridge
-endif
diff --git a/package/bridge/bridge.mk b/package/bridge/bridge.mk
index 9cf9f330ae..32743c26df 100644
--- a/package/bridge/bridge.mk
+++ b/package/bridge/bridge.mk
@@ -59,3 +59,11 @@ bridge-clean:
bridge-dirclean:
rm -rf $(BRIDGE_BUILD_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_BRIDGE)),y)
+TARGETS+=bridge
+endif
diff --git a/package/busybox/Makefile.in b/package/busybox/Makefile.in
deleted file mode 100644
index a8efafb8b4..0000000000
--- a/package/busybox/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_BUSYBOX)),y)
-TARGETS+=busybox
-endif
diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index ae9abf1332..497aa76a04 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -60,3 +60,11 @@ busybox-clean:
busybox-dirclean:
rm -rf $(BUSYBOX_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_BUSYBOX)),y)
+TARGETS+=busybox
+endif
diff --git a/package/bzip2/Makefile.in b/package/bzip2/Makefile.in
deleted file mode 100644
index 1672e2d308..0000000000
--- a/package/bzip2/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_BZIP2)),y)
-TARGETS+=bzip2
-endif
diff --git a/package/bzip2/bzip2.mk b/package/bzip2/bzip2.mk
index 6b595e2ed6..c6eeb019a0 100644
--- a/package/bzip2/bzip2.mk
+++ b/package/bzip2/bzip2.mk
@@ -86,3 +86,11 @@ bzip2-clean:
bzip2-dirclean:
rm -rf $(BZIP2_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_BZIP2)),y)
+TARGETS+=bzip2
+endif
diff --git a/package/config/Config.in b/package/config/Config.in
deleted file mode 100644
index 7b114d9dd5..0000000000
--- a/package/config/Config.in
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-
-config BR2_PACKAGE_CONFIG
- bool"config"
- default n
- help
- Add help text here.
-
diff --git a/package/config/Makefile.in b/package/config/Makefile.in
deleted file mode 100644
index addf1b9819..0000000000
--- a/package/config/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_CONFIG)),y)
-TARGETS+=config
-endif
diff --git a/package/coreutils/Makefile.in b/package/coreutils/Makefile.in
deleted file mode 100644
index e087f50396..0000000000
--- a/package/coreutils/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_COREUTILS)),y)
-TARGETS+=coreutils
-endif
diff --git a/package/coreutils/coreutils.mk b/package/coreutils/coreutils.mk
index df07a08850..a51e37785e 100644
--- a/package/coreutils/coreutils.mk
+++ b/package/coreutils/coreutils.mk
@@ -88,3 +88,11 @@ coreutils-clean:
coreutils-dirclean:
rm -rf $(COREUTILS_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_COREUTILS)),y)
+TARGETS+=coreutils
+endif
diff --git a/package/customize/Makefile.in b/package/customize/Makefile.in
deleted file mode 100644
index 5a07dc7772..0000000000
--- a/package/customize/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_CUSTOMIZE)),y)
-TARGETS+=customize
-endif
diff --git a/package/customize/customize.mk b/package/customize/customize.mk
index d6c99407ba..ed50f8f3a1 100644
--- a/package/customize/customize.mk
+++ b/package/customize/customize.mk
@@ -7,3 +7,11 @@ CUST_DIR:=package/customize/source
customize:
-cp -af $(CUST_DIR)/* $(TARGET_DIR)/
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_CUSTOMIZE)),y)
+TARGETS+=customize
+endif
diff --git a/package/dhcp_relay/Makefile.in b/package/dhcp_relay/Makefile.in
deleted file mode 100644
index e66a24e463..0000000000
--- a/package/dhcp_relay/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_DHCP_RELAY)),y)
-TARGETS+=dhcp_relay
-endif
diff --git a/package/dhcp_relay/dhcp_relay.mk b/package/dhcp_relay/dhcp_relay.mk
index d014bd7dbc..b1e10cc1c6 100644
--- a/package/dhcp_relay/dhcp_relay.mk
+++ b/package/dhcp_relay/dhcp_relay.mk
@@ -45,3 +45,11 @@ dhcp_relay-clean:
dhcp_relay-dirclean:
rm -rf $(DHCP_RELAY_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_DHCP_RELAY)),y)
+TARGETS+=dhcp_relay
+endif
diff --git a/package/diffutils/Makefile.in b/package/diffutils/Makefile.in
deleted file mode 100644
index 37996b93ff..0000000000
--- a/package/diffutils/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_DIFFUTILS)),y)
-TARGETS+=diffutils
-endif
diff --git a/package/diffutils/diffutils.mk b/package/diffutils/diffutils.mk
index 6f74b7071a..b8abde5333 100644
--- a/package/diffutils/diffutils.mk
+++ b/package/diffutils/diffutils.mk
@@ -59,3 +59,11 @@ diffutils-clean:
diffutils-dirclean:
rm -rf $(DIFFUTILS_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_DIFFUTILS)),y)
+TARGETS+=diffutils
+endif
diff --git a/package/distcc/Makefile.in b/package/distcc/Makefile.in
deleted file mode 100644
index 179a182b5f..0000000000
--- a/package/distcc/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_DISTCC)),y)
-TARGETS+=distcc
-endif
diff --git a/package/distcc/distcc.mk b/package/distcc/distcc.mk
index c56b69e58b..0c24de9091 100644
--- a/package/distcc/distcc.mk
+++ b/package/distcc/distcc.mk
@@ -56,3 +56,11 @@ distcc-clean:
distcc-dirclean:
rm -rf $(DISTCC_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_DISTCC)),y)
+TARGETS+=distcc
+endif
diff --git a/package/dnsmasq/Makefile.in b/package/dnsmasq/Makefile.in
deleted file mode 100644
index 36548bd2b1..0000000000
--- a/package/dnsmasq/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_DNSMASQ)),y)
-TARGETS+=dnsmasq
-endif
diff --git a/package/dnsmasq/dnsmasq.mk b/package/dnsmasq/dnsmasq.mk
index b1848c6aa8..7df21fe3b0 100644
--- a/package/dnsmasq/dnsmasq.mk
+++ b/package/dnsmasq/dnsmasq.mk
@@ -48,3 +48,11 @@ dnsmasq-clean:
dnsmasq-dirclean:
rm -rf $(DNSMASQ_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_DNSMASQ)),y)
+TARGETS+=dnsmasq
+endif
diff --git a/package/dropbear_sshd/Makefile.in b/package/dropbear_sshd/Makefile.in
deleted file mode 100644
index 87247fcee5..0000000000
--- a/package/dropbear_sshd/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_DROPBEAR_SSHD)),y)
-TARGETS+=dropbear_sshd
-endif
diff --git a/package/dropbear_sshd/dropbear_sshd.mk b/package/dropbear_sshd/dropbear_sshd.mk
index 26c9b17830..de0fcdeb90 100644
--- a/package/dropbear_sshd/dropbear_sshd.mk
+++ b/package/dropbear_sshd/dropbear_sshd.mk
@@ -77,3 +77,11 @@ dropbear_sshd-clean:
dropbear_sshd-dirclean:
rm -rf $(DROPBEAR_SSHD_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_DROPBEAR_SSHD)),y)
+TARGETS+=dropbear_sshd
+endif
diff --git a/package/ed/Makefile.in b/package/ed/Makefile.in
deleted file mode 100644
index 47005f5e27..0000000000
--- a/package/ed/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_ED)),y)
-TARGETS+=ed
-endif
diff --git a/package/ed/ed.mk b/package/ed/ed.mk
index a028c3d62b..3c49e0fb2b 100644
--- a/package/ed/ed.mk
+++ b/package/ed/ed.mk
@@ -53,3 +53,11 @@ ed-clean:
ed-dirclean:
rm -rf $(ED_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_ED)),y)
+TARGETS+=ed
+endif
diff --git a/package/fakeroot/Makefile.in b/package/fakeroot/Makefile.in
deleted file mode 100644
index 07d8457f77..0000000000
--- a/package/fakeroot/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_FAKEROOT)),y)
-TARGETS+=fakeroot
-endif
diff --git a/package/fakeroot/fakeroot.mk b/package/fakeroot/fakeroot.mk
index dba6dee2d5..b31b126f06 100644
--- a/package/fakeroot/fakeroot.mk
+++ b/package/fakeroot/fakeroot.mk
@@ -62,3 +62,11 @@ fakeroot-dirclean:
rm -rf $(FAKEROOT_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_FAKEROOT)),y)
+TARGETS+=fakeroot
+endif
diff --git a/package/file/Makefile.in b/package/file/Makefile.in
deleted file mode 100644
index 07776d8a43..0000000000
--- a/package/file/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_FILE)),y)
-TARGETS+=file
-endif
diff --git a/package/file/file.mk b/package/file/file.mk
index 8f88ddea35..70e72bd56b 100644
--- a/package/file/file.mk
+++ b/package/file/file.mk
@@ -64,3 +64,11 @@ file-clean:
file-dirclean:
rm -rf $(FILE_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_FILE)),y)
+TARGETS+=file
+endif
diff --git a/package/findutils/Makefile.in b/package/findutils/Makefile.in
deleted file mode 100644
index 62a8cfb4ae..0000000000
--- a/package/findutils/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_FINDUTILS)),y)
-TARGETS+=findutils
-endif
diff --git a/package/findutils/findutils.mk b/package/findutils/findutils.mk
index 9819a1ef47..a16ce78dcd 100644
--- a/package/findutils/findutils.mk
+++ b/package/findutils/findutils.mk
@@ -68,3 +68,11 @@ findutils-clean:
findutils-dirclean:
rm -rf $(FINDUTILS_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_FINDUTILS)),y)
+TARGETS+=findutils
+endif
diff --git a/package/flex/Makefile.in b/package/flex/Makefile.in
deleted file mode 100644
index 8e3cb14291..0000000000
--- a/package/flex/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_FLEX)),y)
-TARGETS+=flex
-endif
diff --git a/package/flex/flex.mk b/package/flex/flex.mk
index 6379fd922e..6474b3126b 100644
--- a/package/flex/flex.mk
+++ b/package/flex/flex.mk
@@ -94,3 +94,11 @@ flex-clean:
flex-dirclean:
rm -rf $(FLEX_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_FLEX)),y)
+TARGETS+=flex
+endif
diff --git a/package/gawk/Makefile.in b/package/gawk/Makefile.in
deleted file mode 100644
index ceb28205e3..0000000000
--- a/package/gawk/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_GAWK)),y)
-TARGETS+=gawk
-endif
diff --git a/package/gawk/gawk.mk b/package/gawk/gawk.mk
index d209ab1f0b..aadba5ec0b 100644
--- a/package/gawk/gawk.mk
+++ b/package/gawk/gawk.mk
@@ -64,3 +64,11 @@ gawk-clean:
gawk-dirclean:
rm -rf $(GAWK_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_GAWK)),y)
+TARGETS+=gawk
+endif
diff --git a/package/gettext/Makefile.in b/package/gettext/Makefile.in
deleted file mode 100644
index 39aa8ae271..0000000000
--- a/package/gettext/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_GETTEXT)),y)
-TARGETS+=gettext
-endif
diff --git a/package/gettext/gettext.mk b/package/gettext/gettext.mk
index c9c78ff91d..89b011dd08 100644
--- a/package/gettext/gettext.mk
+++ b/package/gettext/gettext.mk
@@ -59,3 +59,11 @@ gettext-clean:
gettext-dirclean:
rm -rf $(GETTEXT_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_GETTEXT)),y)
+TARGETS+=gettext
+endif
diff --git a/package/grep/Makefile.in b/package/grep/Makefile.in
deleted file mode 100644
index 25a134cc61..0000000000
--- a/package/grep/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_GREP)),y)
-TARGETS+=grep
-endif
diff --git a/package/grep/grep.mk b/package/grep/grep.mk
index 6e909c9a8f..4b443ac36a 100644
--- a/package/grep/grep.mk
+++ b/package/grep/grep.mk
@@ -71,3 +71,11 @@ grep-clean:
grep-dirclean:
rm -rf $(GNUGREP_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_GREP)),y)
+TARGETS+=grep
+endif
diff --git a/package/gzip/Makefile.in b/package/gzip/Makefile.in
deleted file mode 100644
index 4c6f3c339a..0000000000
--- a/package/gzip/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_GZIP)),y)
-TARGETS+=gzip
-endif
diff --git a/package/gzip/gzip.mk b/package/gzip/gzip.mk
index 0c1b21b9c6..4646be8a8b 100644
--- a/package/gzip/gzip.mk
+++ b/package/gzip/gzip.mk
@@ -70,3 +70,11 @@ gzip-clean:
gzip-dirclean:
rm -rf $(GZIP_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_GZIP)),y)
+TARGETS+=gzip
+endif
diff --git a/package/hostap/Makefile.in b/package/hostap/Makefile.in
deleted file mode 100644
index 2b65d710f0..0000000000
--- a/package/hostap/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_HOSTAP)),y)
-TARGETS+=hostap
-endif
diff --git a/package/hostap/hostap.mk b/package/hostap/hostap.mk
index 3583f7eb80..5bb79fe2fb 100644
--- a/package/hostap/hostap.mk
+++ b/package/hostap/hostap.mk
@@ -51,3 +51,11 @@ hostap-clean:
hostap-dirclean:
rm -rf $(HOSTAP_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_HOSTAP)),y)
+TARGETS+=hostap
+endif
diff --git a/package/hotplug/Makefile.in b/package/hotplug/Makefile.in
deleted file mode 100644
index 69b1f4a3dd..0000000000
--- a/package/hotplug/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_HOTPLUG)),y)
-TARGETS+=hotplug
-endif
diff --git a/package/hotplug/hotplug.mk b/package/hotplug/hotplug.mk
index 293bf62284..74ffc86039 100644
--- a/package/hotplug/hotplug.mk
+++ b/package/hotplug/hotplug.mk
@@ -36,3 +36,11 @@ hotplug-clean:
hotplug-dirclean:
rm -rf $(HOTPLUG_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_HOTPLUG)),y)
+TARGETS+=hotplug
+endif
diff --git a/package/iproute2/Makefile.in b/package/iproute2/Makefile.in
deleted file mode 100644
index e99850fbb9..0000000000
--- a/package/iproute2/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_IPROUTE2)),y)
-TARGETS+=iproute2
-endif
diff --git a/package/iproute2/iproute2.mk b/package/iproute2/iproute2.mk
index daa9b79353..889cef3859 100644
--- a/package/iproute2/iproute2.mk
+++ b/package/iproute2/iproute2.mk
@@ -47,3 +47,11 @@ iproute2-clean:
iproute2-dirclean:
rm -rf $(IPROUTE2_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_IPROUTE2)),y)
+TARGETS+=iproute2
+endif
diff --git a/package/iptables/Makefile.in b/package/iptables/Makefile.in
deleted file mode 100644
index 5be894b9a6..0000000000
--- a/package/iptables/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_IPTABLES)),y)
-TARGETS+=iptables
-endif
diff --git a/package/iptables/iptables.mk b/package/iptables/iptables.mk
index f053f1e33d..2b7e8072c5 100644
--- a/package/iptables/iptables.mk
+++ b/package/iptables/iptables.mk
@@ -49,3 +49,11 @@ iptables-clean:
iptables-dirclean:
rm -rf $(IPTABLES_BUILD_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_IPTABLES)),y)
+TARGETS+=iptables
+endif
diff --git a/package/jpeg/Makefile.in b/package/jpeg/Makefile.in
deleted file mode 100644
index 87705f7339..0000000000
--- a/package/jpeg/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_JPEG)),y)
-TARGETS+=jpeg
-endif
diff --git a/package/jpeg/jpeg.mk b/package/jpeg/jpeg.mk
index 9b4f5ff482..8f0a0dbf87 100644
--- a/package/jpeg/jpeg.mk
+++ b/package/jpeg/jpeg.mk
@@ -72,3 +72,11 @@ jpeg: uclibc $(TARGET_DIR)/usr/lib/libjpeg.so.62.0.0
jpeg-clean:
-$(MAKE) -C $(JPEG_DIR) clean
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_JPEG)),y)
+TARGETS+=jpeg
+endif
diff --git a/package/less/Makefile.in b/package/less/Makefile.in
deleted file mode 100644
index f6145d7d7b..0000000000
--- a/package/less/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_LESS)),y)
-TARGETS+=less
-endif
diff --git a/package/less/less.mk b/package/less/less.mk
index af36c1ee63..858c82fc21 100644
--- a/package/less/less.mk
+++ b/package/less/less.mk
@@ -48,3 +48,11 @@ less-clean:
less-dirclean:
rm -rf $(LESS_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_LESS)),y)
+TARGETS+=less
+endif
diff --git a/package/libfloat/Makefile.in b/package/libfloat/Makefile.in
deleted file mode 100644
index d8fcc3768e..0000000000
--- a/package/libfloat/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-#ifeq ($(strip $(BR2_PACKAGE_LIBFLOAT)),y)
-#TARGETS+=libfloat
-#endif
diff --git a/package/libfloat/libfloat.mk b/package/libfloat/libfloat.mk
index 4cea02bb8e..ed666344db 100644
--- a/package/libfloat/libfloat.mk
+++ b/package/libfloat/libfloat.mk
@@ -55,3 +55,11 @@ libfloat-clean:
libfloat-dirclean:
rm -rf $(LIBFLOAT_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+#ifeq ($(strip $(BR2_PACKAGE_LIBFLOAT)),y)
+#TARGETS+=libfloat
+#endif
diff --git a/package/libglib12/Makefile.in b/package/libglib12/Makefile.in
deleted file mode 100644
index 81cb47c746..0000000000
--- a/package/libglib12/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_LIBGLIB12)),y)
-TARGETS+=libglib12
-endif
diff --git a/package/libglib12/libglib12.mk b/package/libglib12/libglib12.mk
index 587399cf98..34041cba02 100644
--- a/package/libglib12/libglib12.mk
+++ b/package/libglib12/libglib12.mk
@@ -76,3 +76,11 @@ libglib12-clean:
libglib12-dirclean:
rm -rf $(LIBGLIB12_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_LIBGLIB12)),y)
+TARGETS+=libglib12
+endif
diff --git a/package/libmad/Makefile.in b/package/libmad/Makefile.in
deleted file mode 100644
index 400f2c9ad7..0000000000
--- a/package/libmad/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_LIBMAD)),y)
-TARGETS+=libmad
-endif
diff --git a/package/libmad/libmad.mk b/package/libmad/libmad.mk
index 1504512e1f..758f7c5469 100644
--- a/package/libmad/libmad.mk
+++ b/package/libmad/libmad.mk
@@ -50,3 +50,11 @@ libmad-clean:
libmad-dirclean:
rm -rf $(LIBMAD_DIR) $(LIBMAD_WORKDIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_LIBMAD)),y)
+TARGETS+=libmad
+endif
diff --git a/package/libpcap/Makefile.in b/package/libpcap/Makefile.in
deleted file mode 100644
index f158d9d324..0000000000
--- a/package/libpcap/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_LIBPCAP)),y)
-TARGETS+=libpcap
-endif
diff --git a/package/libpcap/libpcap.mk b/package/libpcap/libpcap.mk
index 53ec7f09fb..104fbad1c7 100644
--- a/package/libpcap/libpcap.mk
+++ b/package/libpcap/libpcap.mk
@@ -77,3 +77,11 @@ libpcap-clean:
libpcap-dirclean:
rm -rf $(LIBPCAP_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_LIBPCAP)),y)
+TARGETS+=libpcap
+endif
diff --git a/package/libpng/Makefile.in b/package/libpng/Makefile.in
deleted file mode 100644
index f4dfc9f028..0000000000
--- a/package/libpng/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_LIBPNG)),y)
-TARGETS+=libpng
-endif
diff --git a/package/libpng/libpng.mk b/package/libpng/libpng.mk
index 4e3bb8e9fc..55862e17bb 100644
--- a/package/libpng/libpng.mk
+++ b/package/libpng/libpng.mk
@@ -69,3 +69,11 @@ libpng: uclibc zlib $(TARGET_DIR)/usr/lib/libpng.so
libpng-clean:
-$(MAKE) -C $(LIBPNG_DIR) clean
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_LIBPNG)),y)
+TARGETS+=libpng
+endif
diff --git a/package/libtool/Makefile.in b/package/libtool/Makefile.in
deleted file mode 100644
index 37f77548fd..0000000000
--- a/package/libtool/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_LIBTOOL)),y)
-TARGETS+=libtool
-endif
diff --git a/package/libtool/libtool.mk b/package/libtool/libtool.mk
index 2978ac09bd..1758268c41 100644
--- a/package/libtool/libtool.mk
+++ b/package/libtool/libtool.mk
@@ -75,3 +75,11 @@ libtool-clean:
libtool-dirclean:
rm -rf $(LIBTOOL_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_LIBTOOL)),y)
+TARGETS+=libtool
+endif
diff --git a/package/links/Makefile.in b/package/links/Makefile.in
deleted file mode 100644
index 98670eede7..0000000000
--- a/package/links/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_LINKS)),y)
-TARGETS+=links
-endif
diff --git a/package/links/links.mk b/package/links/links.mk
index a5875d1660..c13812ab50 100644
--- a/package/links/links.mk
+++ b/package/links/links.mk
@@ -53,3 +53,11 @@ links-dirclean:
links: uclibc $(TARGET_DIR)/usr/bin/links
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_LINKS)),y)
+TARGETS+=links
+endif
diff --git a/package/linux/Makefile.in b/package/linux/Makefile.in
deleted file mode 100644
index 3b62d24c1d..0000000000
--- a/package/linux/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_LINUX)),y)
-TARGETS+=linux
-endif
diff --git a/package/linux/linux.mk b/package/linux/linux.mk
index 72de336c01..a22a3b9ebc 100644
--- a/package/linux/linux.mk
+++ b/package/linux/linux.mk
@@ -111,3 +111,11 @@ linux-dirclean:
rm -rf $(LINUX_DIR)
endif
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_LINUX)),y)
+TARGETS+=linux
+endif
diff --git a/package/lrzsz/Makefile.in b/package/lrzsz/Makefile.in
deleted file mode 100644
index 42109c0fb8..0000000000
--- a/package/lrzsz/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_LRZSZ)),y)
-TARGETS+=lrzsz
-endif
diff --git a/package/lrzsz/lrzsz.mk b/package/lrzsz/lrzsz.mk
index dfbfbe78aa..6f10900e06 100644
--- a/package/lrzsz/lrzsz.mk
+++ b/package/lrzsz/lrzsz.mk
@@ -74,3 +74,11 @@ lrzsz-clean:
lrzsz-dirclean:
rm -rf $(LRZSZ_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_LRZSZ)),y)
+TARGETS+=lrzsz
+endif
diff --git a/package/ltp-testsuite/Makefile.in b/package/ltp-testsuite/Makefile.in
deleted file mode 100644
index 10dbd1c530..0000000000
--- a/package/ltp-testsuite/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_LTP-TESTSUITE)),y)
-TARGETS+=ltp-testsuite
-endif
diff --git a/package/ltp-testsuite/ltp-testsuite.mk b/package/ltp-testsuite/ltp-testsuite.mk
index 8aeef838f4..a7e6a63cc0 100644
--- a/package/ltp-testsuite/ltp-testsuite.mk
+++ b/package/ltp-testsuite/ltp-testsuite.mk
@@ -36,3 +36,11 @@ ltp-testsuite-dirclean:
rm -rf $(LTP_TESTSUITE_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_LTP-TESTSUITE)),y)
+TARGETS+=ltp-testsuite
+endif
diff --git a/package/ltrace/Makefile.in b/package/ltrace/Makefile.in
deleted file mode 100644
index 04610a9965..0000000000
--- a/package/ltrace/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_LTRACE)),y)
-TARGETS+=ltrace
-endif
diff --git a/package/ltrace/ltrace.mk b/package/ltrace/ltrace.mk
index 6aa93f61a9..31db73ba6f 100644
--- a/package/ltrace/ltrace.mk
+++ b/package/ltrace/ltrace.mk
@@ -53,3 +53,11 @@ ltrace-clean:
ltrace-dirclean:
rm -rf $(LTRACE_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_LTRACE)),y)
+TARGETS+=ltrace
+endif
diff --git a/package/lzo/Makefile.in b/package/lzo/Makefile.in
deleted file mode 100644
index 1647526f88..0000000000
--- a/package/lzo/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_LZO)),y)
-TARGETS+=lzo
-endif
diff --git a/package/lzo/lzo.mk b/package/lzo/lzo.mk
index cb5de1d0cb..9c99e50207 100644
--- a/package/lzo/lzo.mk
+++ b/package/lzo/lzo.mk
@@ -57,3 +57,11 @@ lzo-clean:
lzo-dirclean:
rm -rf $(LZO_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_LZO)),y)
+TARGETS+=lzo
+endif
diff --git a/package/m4/Makefile.in b/package/m4/Makefile.in
deleted file mode 100644
index c7c2eed8c7..0000000000
--- a/package/m4/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_M4)),y)
-TARGETS+=m4
-endif
diff --git a/package/m4/m4.mk b/package/m4/m4.mk
index 229e8ca541..8e28f9b6fa 100644
--- a/package/m4/m4.mk
+++ b/package/m4/m4.mk
@@ -64,3 +64,11 @@ m4-clean:
m4-dirclean:
rm -rf $(M4_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_M4)),y)
+TARGETS+=m4
+endif
diff --git a/package/make/Makefile.in b/package/make/Makefile.in
deleted file mode 100644
index 3331589561..0000000000
--- a/package/make/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_MAKE)),y)
-TARGETS+=make
-endif
diff --git a/package/make/make.mk b/package/make/make.mk
index b50c456c17..a65ae81956 100644
--- a/package/make/make.mk
+++ b/package/make/make.mk
@@ -59,3 +59,11 @@ make-clean:
make-dirclean:
rm -rf $(GNUMAKE_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_MAKE)),y)
+TARGETS+=make
+endif
diff --git a/package/microcom/Makefile.in b/package/microcom/Makefile.in
deleted file mode 100644
index b7653dc4dc..0000000000
--- a/package/microcom/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_MICROCOM)),y)
-TARGETS+=microcom
-endif
diff --git a/package/microcom/microcom.mk b/package/microcom/microcom.mk
index 4878ba9a3e..0de393c831 100644
--- a/package/microcom/microcom.mk
+++ b/package/microcom/microcom.mk
@@ -57,3 +57,11 @@ microcom-dirclean:
microcom: uclibc $(TARGET_DIR)/usr/bin/microcom
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_MICROCOM)),y)
+TARGETS+=microcom
+endif
diff --git a/package/microwin/Makefile.in b/package/microwin/Makefile.in
deleted file mode 100644
index 298e9eee5b..0000000000
--- a/package/microwin/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-#ifeq ($(strip $(BR2_PACKAGE_MICROWIN)),y)
-#TARGETS+=microwin
-#endif
diff --git a/package/microwin/microwin.mk b/package/microwin/microwin.mk
index 3702ef429a..6496e1a447 100644
--- a/package/microwin/microwin.mk
+++ b/package/microwin/microwin.mk
@@ -44,3 +44,11 @@ microwin-clean:
microwin-dirclean:
rm -rf $(MICROWIN_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+#ifeq ($(strip $(BR2_PACKAGE_MICROWIN)),y)
+#TARGETS+=microwin
+#endif
diff --git a/package/mkdosfs/Makefile.in b/package/mkdosfs/Makefile.in
deleted file mode 100644
index 9d32c62700..0000000000
--- a/package/mkdosfs/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_MKDOSFS)),y)
-TARGETS+=mkdosfs
-endif
diff --git a/package/mkdosfs/mkdosfs.mk b/package/mkdosfs/mkdosfs.mk
index 7ecb1f9e5c..c4a53e20cf 100644
--- a/package/mkdosfs/mkdosfs.mk
+++ b/package/mkdosfs/mkdosfs.mk
@@ -42,3 +42,11 @@ mkdosfs-clean:
mkdosfs-dirclean:
rm -rf $(MKDOSFS_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_MKDOSFS)),y)
+TARGETS+=mkdosfs
+endif
diff --git a/package/mke2fs/Makefile.in b/package/mke2fs/Makefile.in
deleted file mode 100644
index 8266482d1c..0000000000
--- a/package/mke2fs/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_MKE2FS)),y)
-TARGETS+=mke2fs
-endif
diff --git a/package/mke2fs/mke2fs.mk b/package/mke2fs/mke2fs.mk
index 906407a351..af0621448f 100644
--- a/package/mke2fs/mke2fs.mk
+++ b/package/mke2fs/mke2fs.mk
@@ -72,3 +72,11 @@ mke2fs-clean:
mke2fs-dirclean:
rm -rf $(MKE2FS_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_MKE2FS)),y)
+TARGETS+=mke2fs
+endif
diff --git a/package/mpg123/Makefile.in b/package/mpg123/Makefile.in
deleted file mode 100644
index 1e3af27cdb..0000000000
--- a/package/mpg123/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_MPG123)),y)
-TARGETS+=mpg123
-endif
diff --git a/package/mpg123/mpg123.mk b/package/mpg123/mpg123.mk
index f64e51be05..c03125b39b 100644
--- a/package/mpg123/mpg123.mk
+++ b/package/mpg123/mpg123.mk
@@ -43,3 +43,11 @@ mpg123-clean:
mpg123-dirclean:
rm -rf $(MPG123_DIR) $(MPG123_WORKDIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_MPG123)),y)
+TARGETS+=mpg123
+endif
diff --git a/package/mrouted/Makefile.in b/package/mrouted/Makefile.in
deleted file mode 100644
index e3410ec1da..0000000000
--- a/package/mrouted/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_MROUTED)),y)
-TARGETS+=mrouted
-endif
diff --git a/package/mrouted/mrouted.mk b/package/mrouted/mrouted.mk
index 1ffea81489..26df7537d4 100644
--- a/package/mrouted/mrouted.mk
+++ b/package/mrouted/mrouted.mk
@@ -42,3 +42,11 @@ mrouted-clean:
mrouted-dirclean:
rm -rf $(MROUTED_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_MROUTED)),y)
+TARGETS+=mrouted
+endif
diff --git a/package/mtd/Makefile.in b/package/mtd/Makefile.in
deleted file mode 100644
index d8c9cd7aa1..0000000000
--- a/package/mtd/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_MTD)),y)
-TARGETS+=mtd
-endif
diff --git a/package/mtd/mtd.mk b/package/mtd/mtd.mk
index ea1cf31f15..f0a2302404 100644
--- a/package/mtd/mtd.mk
+++ b/package/mtd/mtd.mk
@@ -96,3 +96,11 @@ mtd-dirclean:
rm -rf $(MTD_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_MTD)),y)
+TARGETS+=mtd
+endif
diff --git a/package/nano/Makefile.in b/package/nano/Makefile.in
deleted file mode 100644
index 90d1e1832a..0000000000
--- a/package/nano/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_NANO)),y)
-TARGETS+=nano
-endif
diff --git a/package/nano/nano.mk b/package/nano/nano.mk
index 66f17fe2e2..c6e5f67b5a 100644
--- a/package/nano/nano.mk
+++ b/package/nano/nano.mk
@@ -46,3 +46,11 @@ nano-clean:
nano-dirclean:
rm -rf $(NANO_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_NANO)),y)
+TARGETS+=nano
+endif
diff --git a/package/ncurses/Makefile.in b/package/ncurses/Makefile.in
deleted file mode 100644
index 3e8f718011..0000000000
--- a/package/ncurses/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_NCURSES)),y)
-TARGETS+=ncurses
-endif
diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk
index 6a4d43c43f..b2b1f2f866 100644
--- a/package/ncurses/ncurses.mk
+++ b/package/ncurses/ncurses.mk
@@ -133,3 +133,11 @@ ncurses-clean:
ncurses-dirclean:
rm -rf $(NCURSES_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_NCURSES)),y)
+TARGETS+=ncurses
+endif
diff --git a/package/netkitbase/Makefile.in b/package/netkitbase/Makefile.in
deleted file mode 100644
index 5184660753..0000000000
--- a/package/netkitbase/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_NETKITBASE)),y)
-TARGETS+=netkitbase
-endif
diff --git a/package/netkitbase/netkitbase.mk b/package/netkitbase/netkitbase.mk
index daeaa5e56c..78565f6c63 100644
--- a/package/netkitbase/netkitbase.mk
+++ b/package/netkitbase/netkitbase.mk
@@ -55,3 +55,11 @@ netkitbase-clean:
netkitbase-dirclean:
rm -rf $(NETKITBASE_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_NETKITBASE)),y)
+TARGETS+=netkitbase
+endif
diff --git a/package/netkittelnet/Makefile.in b/package/netkittelnet/Makefile.in
deleted file mode 100644
index 9ee5564cf0..0000000000
--- a/package/netkittelnet/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_NETKITTELNET)),y)
-TARGETS+=netkittelnet
-endif
diff --git a/package/netkittelnet/netkittelnet.mk b/package/netkittelnet/netkittelnet.mk
index cf58edb483..07f82739b6 100644
--- a/package/netkittelnet/netkittelnet.mk
+++ b/package/netkittelnet/netkittelnet.mk
@@ -56,3 +56,11 @@ netkittelnet-clean:
netkittelnet-dirclean:
rm -rf $(NETKITTELNET_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_NETKITTELNET)),y)
+TARGETS+=netkittelnet
+endif
diff --git a/package/netsnmp/Makefile.in b/package/netsnmp/Makefile.in
deleted file mode 100644
index e749f710d2..0000000000
--- a/package/netsnmp/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_NETSNMP)),y)
-TARGETS+=netsnmp
-endif
diff --git a/package/netsnmp/netsnmp.mk b/package/netsnmp/netsnmp.mk
index 68470dc342..494d58a413 100644
--- a/package/netsnmp/netsnmp.mk
+++ b/package/netsnmp/netsnmp.mk
@@ -102,3 +102,11 @@ netsnmp-clean:
netsnmp-dirclean:
rm -rf $(NETSNMP_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_NETSNMP)),y)
+TARGETS+=netsnmp
+endif
diff --git a/package/newt/Makefile.in b/package/newt/Makefile.in
deleted file mode 100644
index 34eb301ec3..0000000000
--- a/package/newt/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_NEWT)),y)
-TARGETS+=newt
-endif
diff --git a/package/newt/newt.mk b/package/newt/newt.mk
index 6efc12900c..7f72f33812 100644
--- a/package/newt/newt.mk
+++ b/package/newt/newt.mk
@@ -70,3 +70,11 @@ newt-clean:
newt-dirclean: slang-dirclean
rm -rf $(NEWT_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_NEWT)),y)
+TARGETS+=newt
+endif
diff --git a/package/ntp/Makefile.in b/package/ntp/Makefile.in
deleted file mode 100644
index 8b04e06b16..0000000000
--- a/package/ntp/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_NTP)),y)
-TARGETS+=ntp
-endif
diff --git a/package/ntp/ntp.mk b/package/ntp/ntp.mk
index 30bea00264..8ad5b8047e 100644
--- a/package/ntp/ntp.mk
+++ b/package/ntp/ntp.mk
@@ -63,3 +63,11 @@ ntp-clean:
ntp-dirclean:
rm -rf $(NTP_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_NTP)),y)
+TARGETS+=ntp
+endif
diff --git a/package/openssh/Makefile.in b/package/openssh/Makefile.in
deleted file mode 100644
index 6dbcdd1e8b..0000000000
--- a/package/openssh/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_OPENSSH)),y)
-TARGETS+=openssh
-endif
diff --git a/package/openssh/openssh.mk b/package/openssh/openssh.mk
index fc1d001a30..54ad325d7b 100644
--- a/package/openssh/openssh.mk
+++ b/package/openssh/openssh.mk
@@ -74,3 +74,11 @@ openssh-clean:
openssh-dirclean:
rm -rf $(OPENSSH_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_OPENSSH)),y)
+TARGETS+=openssh
+endif
diff --git a/package/openssl/Makefile.in b/package/openssl/Makefile.in
deleted file mode 100644
index 4082635406..0000000000
--- a/package/openssl/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_OPENSSL)),y)
-TARGETS+=openssl
-endif
diff --git a/package/openssl/openssl.mk b/package/openssl/openssl.mk
index 52ef28ba02..0b2dee6a0a 100644
--- a/package/openssl/openssl.mk
+++ b/package/openssl/openssl.mk
@@ -77,3 +77,11 @@ openssl-clean:
openssl-dirclean:
rm -rf $(OPENSSL_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_OPENSSL)),y)
+TARGETS+=openssl
+endif
diff --git a/package/openvpn/Makefile.in b/package/openvpn/Makefile.in
deleted file mode 100644
index e989321431..0000000000
--- a/package/openvpn/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_OPENVPN)),y)
-TARGETS+=openvpn
-endif
diff --git a/package/openvpn/openvpn.mk b/package/openvpn/openvpn.mk
index 1dcdb8b46e..3f3f7d5889 100644
--- a/package/openvpn/openvpn.mk
+++ b/package/openvpn/openvpn.mk
@@ -64,3 +64,11 @@ openvpn-clean:
openvpn-dirclean:
rm -rf $(OPENVPN_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_OPENVPN)),y)
+TARGETS+=openvpn
+endif
diff --git a/package/patch/Makefile.in b/package/patch/Makefile.in
deleted file mode 100644
index 4f4fd79c91..0000000000
--- a/package/patch/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_PATCH)),y)
-TARGETS+=patch
-endif
diff --git a/package/patch/patch.mk b/package/patch/patch.mk
index b7501bb1c3..0c66999f12 100644
--- a/package/patch/patch.mk
+++ b/package/patch/patch.mk
@@ -58,3 +58,11 @@ patch-clean:
patch-dirclean:
rm -rf $(GNUPATCH_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_PATCH)),y)
+TARGETS+=patch
+endif
diff --git a/package/pciutils/Makefile.in b/package/pciutils/Makefile.in
deleted file mode 100644
index f080d8ceb2..0000000000
--- a/package/pciutils/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_PCIUTILS)),y)
-TARGETS+=pciutils
-endif
diff --git a/package/pciutils/pciutils.mk b/package/pciutils/pciutils.mk
index 40ffb119b6..86017e1975 100644
--- a/package/pciutils/pciutils.mk
+++ b/package/pciutils/pciutils.mk
@@ -50,3 +50,11 @@ pciutils-clean:
pciutils-dirclean:
rm -rf $(PCIUTILS_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_PCIUTILS)),y)
+TARGETS+=pciutils
+endif
diff --git a/package/pcmcia/Makefile.in b/package/pcmcia/Makefile.in
deleted file mode 100644
index eb501d6d45..0000000000
--- a/package/pcmcia/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_PCMCIA)),y)
-TARGETS+=pcmcia
-endif
diff --git a/package/pcmcia/pcmcia.mk b/package/pcmcia/pcmcia.mk
index 8ffaaf68b3..31efd5c9bb 100644
--- a/package/pcmcia/pcmcia.mk
+++ b/package/pcmcia/pcmcia.mk
@@ -105,3 +105,11 @@ pcmcia-clean:
pcmcia-dirclean:
rm -rf $(PCMCIA_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_PCMCIA)),y)
+TARGETS+=pcmcia
+endif
diff --git a/package/portage/Makefile.in b/package/portage/Makefile.in
deleted file mode 100644
index c9f03e5181..0000000000
--- a/package/portage/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_PORTAGE)),y)
-TARGETS+=portage
-endif
diff --git a/package/portage/portage.mk b/package/portage/portage.mk
index 7634832b95..7677920adb 100644
--- a/package/portage/portage.mk
+++ b/package/portage/portage.mk
@@ -104,3 +104,11 @@ portage-clean:
portage-dirclean:
rm -rf $(PORTAGE_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_PORTAGE)),y)
+TARGETS+=portage
+endif
diff --git a/package/portmap/Makefile.in b/package/portmap/Makefile.in
deleted file mode 100644
index 5628cb9d45..0000000000
--- a/package/portmap/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_PORTMAP)),y)
-TARGETS+=portmap
-endif
diff --git a/package/portmap/portmap.mk b/package/portmap/portmap.mk
index 6a2e7d56b0..2fc70d74a4 100644
--- a/package/portmap/portmap.mk
+++ b/package/portmap/portmap.mk
@@ -33,3 +33,11 @@ portmap-clean:
portmap-dirclean:
rm -rf $(PORTMAP_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_PORTMAP)),y)
+TARGETS+=portmap
+endif
diff --git a/package/pppd/Makefile.in b/package/pppd/Makefile.in
deleted file mode 100644
index 0335e3f75f..0000000000
--- a/package/pppd/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_PPPD)),y)
-TARGETS+=pppd
-endif
diff --git a/package/pppd/pppd.mk b/package/pppd/pppd.mk
index 36d4a64ff0..ea772dd83c 100644
--- a/package/pppd/pppd.mk
+++ b/package/pppd/pppd.mk
@@ -66,3 +66,11 @@ pppd-dirclean:
rm -rf $(PPPD_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_PPPD)),y)
+TARGETS+=pppd
+endif
diff --git a/package/procps/Makefile.in b/package/procps/Makefile.in
deleted file mode 100644
index 4d35051fa1..0000000000
--- a/package/procps/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_PROCPS)),y)
-TARGETS+=procps
-endif
diff --git a/package/procps/procps.mk b/package/procps/procps.mk
index bc39941215..0309d57134 100644
--- a/package/procps/procps.mk
+++ b/package/procps/procps.mk
@@ -45,3 +45,11 @@ procps-clean:
procps-dirclean:
rm -rf $(PROCPS_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_PROCPS)),y)
+TARGETS+=procps
+endif
diff --git a/package/python/Makefile.in b/package/python/Makefile.in
deleted file mode 100644
index ded82d8424..0000000000
--- a/package/python/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_PYTHON)),y)
-TARGETS+=python
-endif
diff --git a/package/python/python.mk b/package/python/python.mk
index 3222219896..995c6aa9a9 100644
--- a/package/python/python.mk
+++ b/package/python/python.mk
@@ -81,3 +81,11 @@ python-clean:
python-dirclean:
rm -rf $(PYTHON_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_PYTHON)),y)
+TARGETS+=python
+endif
diff --git a/package/raidtools/Makefile.in b/package/raidtools/Makefile.in
deleted file mode 100644
index 7e4d53bda1..0000000000
--- a/package/raidtools/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_RAIDTOOLS)),y)
-TARGETS+=raidtools
-endif
diff --git a/package/raidtools/raidtools.mk b/package/raidtools/raidtools.mk
index 183cad421f..cbf27dea78 100644
--- a/package/raidtools/raidtools.mk
+++ b/package/raidtools/raidtools.mk
@@ -57,3 +57,11 @@ raidtools2-clean:
raidtools2-dirclean:
rm -rf $(RAIDTOOLS2_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_RAIDTOOLS)),y)
+TARGETS+=raidtools
+endif
diff --git a/package/rsync/Makefile.in b/package/rsync/Makefile.in
deleted file mode 100644
index 63e9acf677..0000000000
--- a/package/rsync/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_RSYNC)),y)
-TARGETS+=rsync
-endif
diff --git a/package/rsync/rsync.mk b/package/rsync/rsync.mk
index b66125e944..735ce3a0e2 100644
--- a/package/rsync/rsync.mk
+++ b/package/rsync/rsync.mk
@@ -46,3 +46,11 @@ rsync-clean:
rsync-dirclean:
rm -rf $(RSYNC_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_RSYNC)),y)
+TARGETS+=rsync
+endif
diff --git a/package/rxvt/Makefile.in b/package/rxvt/Makefile.in
deleted file mode 100644
index bb6ff664d4..0000000000
--- a/package/rxvt/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_RXVT)),y)
-TARGETS+=rxvt
-endif
diff --git a/package/rxvt/rxvt.mk b/package/rxvt/rxvt.mk
index df324ddfef..47afb6756f 100644
--- a/package/rxvt/rxvt.mk
+++ b/package/rxvt/rxvt.mk
@@ -67,3 +67,11 @@ rxvt-clean:
rxvt-dirclean:
rm -rf $(RXVT_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_RXVT)),y)
+TARGETS+=rxvt
+endif
diff --git a/package/sed/Makefile.in b/package/sed/Makefile.in
deleted file mode 100644
index 6738e4f246..0000000000
--- a/package/sed/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_SED)),y)
-TARGETS+=sed
-endif
diff --git a/package/sed/sed.mk b/package/sed/sed.mk
index 5154c1f795..615628c7ad 100644
--- a/package/sed/sed.mk
+++ b/package/sed/sed.mk
@@ -134,3 +134,11 @@ sed-dirclean:
rm -rf $(SED_DIR2)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_SED)),y)
+TARGETS+=sed
+endif
diff --git a/package/sfdisk/Makefile.in b/package/sfdisk/Makefile.in
deleted file mode 100644
index f89f608a84..0000000000
--- a/package/sfdisk/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_SFDISK)),y)
-TARGETS+=sfdisk
-endif
diff --git a/package/sfdisk/sfdisk.mk b/package/sfdisk/sfdisk.mk
index 01261393a3..aa098dfdd9 100644
--- a/package/sfdisk/sfdisk.mk
+++ b/package/sfdisk/sfdisk.mk
@@ -34,3 +34,11 @@ sfdisk-clean:
sfdisk-dirclean:
rm -rf $(SFDISK_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_SFDISK)),y)
+TARGETS+=sfdisk
+endif
diff --git a/package/slang/Makefile.in b/package/slang/Makefile.in
deleted file mode 100644
index a478a18a48..0000000000
--- a/package/slang/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_SLANG)),y)
-TARGETS+=slang
-endif
diff --git a/package/slang/slang.mk b/package/slang/slang.mk
index 43c4bcaaa6..92c29b4b16 100644
--- a/package/slang/slang.mk
+++ b/package/slang/slang.mk
@@ -46,3 +46,11 @@ slang-dirclean:
rm -rf $(SLANG_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_SLANG)),y)
+TARGETS+=slang
+endif
diff --git a/package/socat/Makefile.in b/package/socat/Makefile.in
deleted file mode 100644
index 25df8b42aa..0000000000
--- a/package/socat/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_SOCAT)),y)
-TARGETS+=socat
-endif
diff --git a/package/socat/socat.mk b/package/socat/socat.mk
index 37df0e7c74..5dd22ccd5c 100644
--- a/package/socat/socat.mk
+++ b/package/socat/socat.mk
@@ -67,3 +67,11 @@ socat-clean:
socat-dirclean:
rm -rf $(SOCAT_DIR) $(SOCAT_WORKDIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_SOCAT)),y)
+TARGETS+=socat
+endif
diff --git a/package/strace/Makefile.in b/package/strace/Makefile.in
deleted file mode 100644
index d81fc0c930..0000000000
--- a/package/strace/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_STRACE)),y)
-TARGETS+=strace
-endif
diff --git a/package/strace/strace.mk b/package/strace/strace.mk
index 3fd4520fa6..ead0fbcbdc 100644
--- a/package/strace/strace.mk
+++ b/package/strace/strace.mk
@@ -58,3 +58,11 @@ strace-dirclean:
rm -rf $(STRACE_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_STRACE)),y)
+TARGETS+=strace
+endif
diff --git a/package/tar/Makefile.in b/package/tar/Makefile.in
deleted file mode 100644
index ce5a634686..0000000000
--- a/package/tar/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_TAR)),y)
-TARGETS+=tar
-endif
diff --git a/package/tar/tar.mk b/package/tar/tar.mk
index 138c5a065e..23f938c5b7 100644
--- a/package/tar/tar.mk
+++ b/package/tar/tar.mk
@@ -66,3 +66,11 @@ tar-clean:
tar-dirclean:
rm -rf $(GNUTAR_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_TAR)),y)
+TARGETS+=tar
+endif
diff --git a/package/tcpdump/Makefile.in b/package/tcpdump/Makefile.in
deleted file mode 100644
index eb0a85c63c..0000000000
--- a/package/tcpdump/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_TCPDUMP)),y)
-TARGETS+=tcpdump
-endif
diff --git a/package/tcpdump/tcpdump.mk b/package/tcpdump/tcpdump.mk
index 13d9c44ed2..5792515828 100644
--- a/package/tcpdump/tcpdump.mk
+++ b/package/tcpdump/tcpdump.mk
@@ -73,3 +73,11 @@ tcpdump-clean:
tcpdump-dirclean:
rm -rf $(TCPDUMP_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_TCPDUMP)),y)
+TARGETS+=tcpdump
+endif
diff --git a/package/tinylogin/Makefile.in b/package/tinylogin/Makefile.in
deleted file mode 100644
index e80c8c0c79..0000000000
--- a/package/tinylogin/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_TINYLOGIN)),y)
-TARGETS+=tinylogin
-endif
diff --git a/package/tinylogin/tinylogin.mk b/package/tinylogin/tinylogin.mk
index 2174888ea7..29514db036 100644
--- a/package/tinylogin/tinylogin.mk
+++ b/package/tinylogin/tinylogin.mk
@@ -50,3 +50,11 @@ tinylogin-clean:
tinylogin-dirclean:
rm -rf $(TINYLOGIN_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_TINYLOGIN)),y)
+TARGETS+=tinylogin
+endif
diff --git a/package/tinyx/Makefile.in b/package/tinyx/Makefile.in
deleted file mode 100644
index 0b80bd6edc..0000000000
--- a/package/tinyx/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_TINYX)),y)
-TARGETS+=tinyx
-endif
diff --git a/package/tinyx/tinyx.mk b/package/tinyx/tinyx.mk
index 24845455d8..3f7d5328fd 100644
--- a/package/tinyx/tinyx.mk
+++ b/package/tinyx/tinyx.mk
@@ -125,3 +125,11 @@ tinyx-clean:
tinyx-dirclean:
-rm -rf $(TINYX_DIR)
-rm -rf $(TARGET_DIR)/usr/X11R6
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_TINYX)),y)
+TARGETS+=tinyx
+endif
diff --git a/package/tn5250/Makefile.in b/package/tn5250/Makefile.in
deleted file mode 100644
index 4e7fedf969..0000000000
--- a/package/tn5250/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_TN5250)),y)
-TARGETS+=tn5250
-endif
diff --git a/package/tn5250/tn5250.mk b/package/tn5250/tn5250.mk
index 611359f543..5002874b8d 100644
--- a/package/tn5250/tn5250.mk
+++ b/package/tn5250/tn5250.mk
@@ -49,3 +49,11 @@ tn5250-dirclean:
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_TN5250)),y)
+TARGETS+=tn5250
+endif
diff --git a/package/ttcp/Makefile.in b/package/ttcp/Makefile.in
deleted file mode 100644
index 413101c749..0000000000
--- a/package/ttcp/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_TTCP)),y)
-TARGETS+=ttcp
-endif
diff --git a/package/ttcp/ttcp.mk b/package/ttcp/ttcp.mk
index 7ff5f63158..d6aa0644de 100644
--- a/package/ttcp/ttcp.mk
+++ b/package/ttcp/ttcp.mk
@@ -35,3 +35,11 @@ ttcp-clean:
ttcp-dirclean:
rm -rf $(TTCP_BUILD_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_TTCP)),y)
+TARGETS+=ttcp
+endif
diff --git a/package/udhcp/Makefile.in b/package/udhcp/Makefile.in
deleted file mode 100644
index 395004b41c..0000000000
--- a/package/udhcp/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_UDHCP)),y)
-TARGETS+=udhcp
-endif
diff --git a/package/udhcp/udhcp.mk b/package/udhcp/udhcp.mk
index 7360b9cfcb..33f05fdc8b 100644
--- a/package/udhcp/udhcp.mk
+++ b/package/udhcp/udhcp.mk
@@ -63,3 +63,11 @@ udhcp-clean:
udhcp-dirclean:
rm -rf $(UDHCP_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_UDHCP)),y)
+TARGETS+=udhcp
+endif
diff --git a/package/util-linux/Makefile.in b/package/util-linux/Makefile.in
deleted file mode 100644
index 2d2b3e9d9d..0000000000
--- a/package/util-linux/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_UTIL-LINUX)),y)
-TARGETS+=util-linux
-endif
diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk
index 8cdce96906..df73c4b279 100644
--- a/package/util-linux/util-linux.mk
+++ b/package/util-linux/util-linux.mk
@@ -80,3 +80,11 @@ util-linux-dirclean:
rm -rf $(UTIL-LINUX_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_UTIL-LINUX)),y)
+TARGETS+=util-linux
+endif
diff --git a/package/valgrind/Makefile.in b/package/valgrind/Makefile.in
deleted file mode 100644
index c0555f79b6..0000000000
--- a/package/valgrind/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_VALGRIND)),y)
-TARGETS+=valgrind
-endif
diff --git a/package/valgrind/valgrind.mk b/package/valgrind/valgrind.mk
index 520071a4cf..8b8ca044b5 100644
--- a/package/valgrind/valgrind.mk
+++ b/package/valgrind/valgrind.mk
@@ -85,3 +85,11 @@ valgrind-clean:
valgrind-dirclean:
rm -rf $(VALGRIND_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_VALGRIND)),y)
+TARGETS+=valgrind
+endif
diff --git a/package/vtun/Makefile.in b/package/vtun/Makefile.in
deleted file mode 100644
index cc944dd7b0..0000000000
--- a/package/vtun/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_VTUN)),y)
-TARGETS+=vtun
-endif
diff --git a/package/vtun/vtun.mk b/package/vtun/vtun.mk
index 128fd70e79..365b020c03 100644
--- a/package/vtun/vtun.mk
+++ b/package/vtun/vtun.mk
@@ -64,3 +64,11 @@ vtun-clean:
vtun-dirclean:
rm -rf $(VTUN_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_VTUN)),y)
+TARGETS+=vtun
+endif
diff --git a/package/wget/Makefile.in b/package/wget/Makefile.in
deleted file mode 100644
index 9c8f8fcebc..0000000000
--- a/package/wget/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_WGET)),y)
-TARGETS+=wget
-endif
diff --git a/package/wget/wget.mk b/package/wget/wget.mk
index 915b163b80..85765c8861 100644
--- a/package/wget/wget.mk
+++ b/package/wget/wget.mk
@@ -47,3 +47,11 @@ wget-clean:
wget-dirclean:
rm -rf $(WGET_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_WGET)),y)
+TARGETS+=wget
+endif
diff --git a/package/which/Makefile.in b/package/which/Makefile.in
deleted file mode 100644
index b115ce31f6..0000000000
--- a/package/which/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_WHICH)),y)
-TARGETS+=which
-endif
diff --git a/package/which/which.mk b/package/which/which.mk
index 0450cc11f6..5cb05766c0 100644
--- a/package/which/which.mk
+++ b/package/which/which.mk
@@ -44,3 +44,11 @@ which-clean:
which-dirclean:
rm -rf $(WHICH_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_WHICH)),y)
+TARGETS+=which
+endif
diff --git a/package/wtools/Makefile.in b/package/wtools/Makefile.in
deleted file mode 100644
index 3979700929..0000000000
--- a/package/wtools/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_WTOOLS)),y)
-TARGETS+=wtools
-endif
diff --git a/package/wtools/wtools.mk b/package/wtools/wtools.mk
index 1d1043768a..4644526f43 100644
--- a/package/wtools/wtools.mk
+++ b/package/wtools/wtools.mk
@@ -47,3 +47,11 @@ wtools-clean:
wtools-dirclean:
rm -rf $(WTOOLS_BUILD_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_WTOOLS)),y)
+TARGETS+=wtools
+endif
diff --git a/package/zlib/Makefile.in b/package/zlib/Makefile.in
deleted file mode 100644
index 8f31a5869b..0000000000
--- a/package/zlib/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_PACKAGE_ZLIB)),y)
-TARGETS+=zlib
-endif
diff --git a/package/zlib/zlib.mk b/package/zlib/zlib.mk
index 627d11bc05..bb308e0437 100644
--- a/package/zlib/zlib.mk
+++ b/package/zlib/zlib.mk
@@ -71,3 +71,11 @@ zlib-clean:
zlib-dirclean:
rm -rf $(ZLIB_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_ZLIB)),y)
+TARGETS+=zlib
+endif
diff --git a/target/cramfs/Makefile.in b/target/cramfs/Makefile.in
deleted file mode 100644
index 45d9b67ce6..0000000000
--- a/target/cramfs/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_TARGET_ROOTFS_CRAMFS)),y)
-TARGETS+=cramfsroot
-endif
diff --git a/target/cramfs/cramfs.mk b/target/cramfs/cramfs.mk
index a00af6c175..e4766cfad7 100644
--- a/target/cramfs/cramfs.mk
+++ b/target/cramfs/cramfs.mk
@@ -49,3 +49,11 @@ cramfsroot-clean:
cramfsroot-dirclean:
rm -rf $(CRAMFS_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_TARGET_ROOTFS_CRAMFS)),y)
+TARGETS+=cramfsroot
+endif
diff --git a/target/ext2/Makefile.in b/target/ext2/Makefile.in
deleted file mode 100644
index 990407718d..0000000000
--- a/target/ext2/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2)),y)
-TARGETS+=ext2root
-endif
diff --git a/target/ext2/ext2root.mk b/target/ext2/ext2root.mk
index 8dfa513e14..2d80999fef 100644
--- a/target/ext2/ext2root.mk
+++ b/target/ext2/ext2root.mk
@@ -111,3 +111,11 @@ ext2root-clean:
ext2root-dirclean:
rm -rf $(GENEXT2_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2)),y)
+TARGETS+=ext2root
+endif
diff --git a/target/jffs2/Makefile.in b/target/jffs2/Makefile.in
deleted file mode 100644
index 31452eba8d..0000000000
--- a/target/jffs2/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_TARGET_ROOTFS_JFFS2)),y)
-TARGETS+=jffs2root
-endif
diff --git a/target/jffs2/jffs2root.mk b/target/jffs2/jffs2root.mk
index 3e64a62d59..0dad3f416e 100644
--- a/target/jffs2/jffs2root.mk
+++ b/target/jffs2/jffs2root.mk
@@ -64,5 +64,11 @@ jffs2root-clean: mtd-host-clean
jffs2root-dirclean: mtd-host-dirclean
-rm -f $(JFFS2_TARGET)
-
-
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_TARGET_ROOTFS_JFFS2)),y)
+TARGETS+=jffs2root
+endif
diff --git a/target/squashfs/Makefile.in b/target/squashfs/Makefile.in
deleted file mode 100644
index 2278d720cd..0000000000
--- a/target/squashfs/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_TARGET_ROOTFS_SQUASHFS)),y)
-TARGETS+=squashfsroot
-endif
diff --git a/target/squashfs/squashfsroot.mk b/target/squashfs/squashfsroot.mk
index e120172baa..5a4536fed6 100644
--- a/target/squashfs/squashfsroot.mk
+++ b/target/squashfs/squashfsroot.mk
@@ -49,3 +49,11 @@ squashfsroot-clean:
squashfsroot-dirclean:
rm -rf $(SQUASHFS_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_TARGET_ROOTFS_SQUASHFS)),y)
+TARGETS+=squashfsroot
+endif
diff --git a/target/tar/Makefile.in b/target/tar/Makefile.in
deleted file mode 100644
index d5f1308990..0000000000
--- a/target/tar/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(strip $(BR2_TARGET_ROOTFS_TAR)),y)
-TARGETS+=tarroot
-endif
diff --git a/target/tar/tarroot.mk b/target/tar/tarroot.mk
index a7627bf40f..e85030b979 100644
--- a/target/tar/tarroot.mk
+++ b/target/tar/tarroot.mk
@@ -23,3 +23,12 @@ tarroot-source:
tarroot-clean:
tarroot-dirclean:
+
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_TARGET_ROOTFS_TAR)),y)
+TARGETS+=tarroot
+endif
diff --git a/toolchain/Makefile.in b/toolchain/Makefile.in
index 5b2d7f213d..bc2d26dfb2 100644
--- a/toolchain/Makefile.in
+++ b/toolchain/Makefile.in
@@ -5,3 +5,6 @@ endif
# FIXME -- this is temporary
OPTIMIZE_FOR_CPU=$(ARCH)
+
+# gcc has a bunch of needed stuff....
+include toolchain/gcc/Makefile.in
diff --git a/toolchain/binutils/Makefile.in b/toolchain/binutils/Makefile.in
deleted file mode 100644
index c6838bb053..0000000000
--- a/toolchain/binutils/Makefile.in
+++ /dev/null
@@ -1 +0,0 @@
-BINUTILS_VERSION:=$(strip $(subst ",, $(BR2_BINUTILS_VERSION)))
diff --git a/toolchain/binutils/binutils.mk b/toolchain/binutils/binutils.mk
index afbb63ac3e..900060d334 100644
--- a/toolchain/binutils/binutils.mk
+++ b/toolchain/binutils/binutils.mk
@@ -132,3 +132,9 @@ binutils_target-clean:
binutils_target-dirclean:
rm -rf $(BINUTILS_DIR2)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+BINUTILS_VERSION:=$(strip $(subst ",, $(BR2_BINUTILS_VERSION)))
diff --git a/toolchain/ccache/Makefile.in b/toolchain/ccache/Makefile.in
deleted file mode 100644
index fe859da303..0000000000
--- a/toolchain/ccache/Makefile.in
+++ /dev/null
@@ -1,6 +0,0 @@
-ifeq ($(strip $(BR2_CCACHE)),y)
-TARGETS+=ccache
-endif
-ifeq ($(strip $(BR2_PACKAGE_CCACHE_TARGET)),y)
-TARGETS+=ccache_target
-endif
diff --git a/toolchain/ccache/ccache.mk b/toolchain/ccache/ccache.mk
index e2fdd71cc1..71dfcde697 100644
--- a/toolchain/ccache/ccache.mk
+++ b/toolchain/ccache/ccache.mk
@@ -149,3 +149,14 @@ ccache_target-clean:
ccache_target-dirclean:
rm -rf $(CCACHE_DIR2)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_CCACHE)),y)
+TARGETS+=ccache
+endif
+ifeq ($(strip $(BR2_PACKAGE_CCACHE_TARGET)),y)
+TARGETS+=ccache_target
+endif
diff --git a/toolchain/gcc/Makefile.in b/toolchain/gcc/Makefile.in
index e1fb6fec38..c89eb42273 100644
--- a/toolchain/gcc/Makefile.in
+++ b/toolchain/gcc/Makefile.in
@@ -1,3 +1,9 @@
+# gcc has a bunch of options that need to be shared with
+# both gcc-uclibc-2.95.mk and gcc-uclibc-3.x.mk, and are
+# use by other packages... So include them in this file
+# and arrange to include it soon after invoking make from
+# the top level.
+
GCC_VERSION:=$(strip $(subst ",, $(BR2_GCC_VERSION)))
#"
GCC_USE_SJLJ_EXCEPTIONS:=$(strip $(subst ",, $(BR2_GCC_USE_SJLJ_EXCEPTIONS)))
diff --git a/toolchain/gdb/Makefile.in b/toolchain/gdb/Makefile.in
deleted file mode 100644
index 50828d86fb..0000000000
--- a/toolchain/gdb/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-GDB_VERSION:=$(strip $(subst ",, $(BR2_GDB_VERSION)))
-#"
-
-ifeq ($(strip $(BR2_PACKAGE_GDB)),y)
-TARGETS+=gdb_target
-endif
-
-ifeq ($(strip $(BR2_PACKAGE_GDB_SERVER)),y)
-TARGETS+=gdbserver
-endif
-
-ifeq ($(strip $(BR2_PACKAGE_GDB_CLIENT)),y)
-TARGETS+=gdbclient
-endif
diff --git a/toolchain/gdb/gdb.mk b/toolchain/gdb/gdb.mk
index 7c3c8deaa7..e8212e93f5 100644
--- a/toolchain/gdb/gdb.mk
+++ b/toolchain/gdb/gdb.mk
@@ -187,3 +187,22 @@ gdbclient-dirclean:
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+GDB_VERSION:=$(strip $(subst ",, $(BR2_GDB_VERSION)))
+#"
+
+ifeq ($(strip $(BR2_PACKAGE_GDB)),y)
+TARGETS+=gdb_target
+endif
+
+ifeq ($(strip $(BR2_PACKAGE_GDB_SERVER)),y)
+TARGETS+=gdbserver
+endif
+
+ifeq ($(strip $(BR2_PACKAGE_GDB_CLIENT)),y)
+TARGETS+=gdbclient
+endif
diff --git a/toolchain/kernel-headers/Makefile.in b/toolchain/kernel-headers/Makefile.in
deleted file mode 100644
index d02613a022..0000000000
--- a/toolchain/kernel-headers/Makefile.in
+++ /dev/null
@@ -1,3 +0,0 @@
-DEFAULT_KERNEL_HEADERS:=$(strip $(subst ",, $(BR2_DEFAULT_KERNEL_HEADERS)))
-#"
-
diff --git a/toolchain/kernel-headers/kernel-headers.mk b/toolchain/kernel-headers/kernel-headers.mk
index f5640a4721..abb6e53897 100644
--- a/toolchain/kernel-headers/kernel-headers.mk
+++ b/toolchain/kernel-headers/kernel-headers.mk
@@ -143,3 +143,11 @@ kernel-headers-dirclean:
rm -rf $(LINUX_HEADERS_DIR)
endif
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+DEFAULT_KERNEL_HEADERS:=$(strip $(subst ",, $(BR2_DEFAULT_KERNEL_HEADERS)))
+#"
+