summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2005-02-10 03:06:39 +0000
committerEric Andersen <andersen@codepoet.org>2005-02-10 03:06:39 +0000
commitd06645d8eddce3a22144a9ef8961a8f7599d319e (patch)
tree526cac83ded3499b57032bb118ffbab0b72222d4
parent040f60b3ea53947675333e60e14838ddd9944abd (diff)
downloadbuildroot-novena-d06645d8eddce3a22144a9ef8961a8f7599d319e.tar.gz
buildroot-novena-d06645d8eddce3a22144a9ef8961a8f7599d319e.zip
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 3b263de31..e6eb5cca9 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 35b824a7c..8897ff67e 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 30dbd840a..000000000
--- 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 ff9251085..ce1ba315e 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 0dd3de627..000000000
--- 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 dc4788f0d..31ba69dde 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 aa94d8405..000000000
--- 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 64f40d7be..d25b1558e 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 ca6146c76..000000000
--- 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 bc9b3472a..2602079d9 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 d67c078ba..000000000
--- 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 84d8723f5..d9ec72fde 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 74684d797..000000000
--- 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 4fd32c613..9ea27b8e2 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 563605295..000000000
--- 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 9cf9f330a..32743c26d 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 a8efafb8b..000000000
--- 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 ae9abf133..497aa76a0 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 1672e2d30..000000000
--- 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 6b595e2ed..c6eeb019a 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 7b114d9dd..000000000
--- 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 addf1b981..000000000
--- 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 e087f5039..000000000
--- 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 df07a0885..a51e37785 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 5a07dc777..000000000
--- 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 d6c99407b..ed50f8f3a 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 e66a24e46..000000000
--- 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 d014bd7db..b1e10cc1c 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 37996b93f..000000000
--- 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 6f74b7071..b8abde533 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 179a182b5..000000000
--- 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 c56b69e58..0c24de909 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 36548bd2b..000000000
--- 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 b1848c6aa..7df21fe3b 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 87247fcee..000000000
--- 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 26c9b1783..de0fcdeb9 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 47005f5e2..000000000
--- 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 a028c3d62..3c49e0fb2 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 07d8457f7..000000000
--- 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 dba6dee2d..b31b126f0 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 07776d8a4..000000000
--- 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 8f88ddea3..70e72bd56 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 62a8cfb4a..000000000
--- 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 9819a1ef4..a16ce78dc 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 8e3cb1429..000000000
--- 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 6379fd922..6474b3126 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 ceb28205e..000000000
--- 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 d209ab1f0..aadba5ec0 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 39aa8ae27..000000000
--- 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 c9c78ff91..89b011dd0 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 25a134cc6..000000000
--- 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 6e909c9a8..4b443ac36 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 4c6f3c339..000000000
--- 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 0c1b21b9c..4646be8a8 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 2b65d710f..000000000
--- 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 3583f7eb8..5bb79fe2f 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 69b1f4a3d..000000000
--- 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 293bf6228..74ffc8603 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 e99850fbb..000000000
--- 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 daa9b7935..889cef385 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 5be894b9a..000000000
--- 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 f053f1e33..2b7e8072c 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 87705f733..000000000
--- 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 9b4f5ff48..8f0a0dbf8 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 f6145d7d7..000000000
--- 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 af36c1ee6..858c82fc2 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 d8fcc3768..000000000
--- 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 4cea02bb8..ed666344d 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 81cb47c74..000000000
--- 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 587399cf9..34041cba0 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 400f2c9ad..000000000
--- 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 1504512e1..758f7c546 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 f158d9d32..000000000
--- 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 53ec7f09f..104fbad1c 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 f4dfc9f02..000000000
--- 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 4e3bb8e9f..55862e17b 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 37f77548f..000000000
--- 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 2978ac09b..1758268c4 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 98670eede..000000000
--- 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 a5875d166..c13812ab5 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 3b62d24c1..000000000
--- 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 72de336c0..a22a3b9eb 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 42109c0fb..000000000
--- 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 dfbfbe78a..6f10900e0 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 10dbd1c53..000000000
--- 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 8aeef838f..a7e6a63cc 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 04610a996..000000000
--- 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 6aa93f61a..31db73ba6 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 1647526f8..000000000
--- 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 cb5de1d0c..9c99e5020 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 c7c2eed8c..000000000
--- 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 229e8ca54..8e28f9b6f 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 333158956..000000000
--- 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 b50c456c1..a65ae8195 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 b7653dc4d..000000000
--- 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 4878ba9a3..0de393c83 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 298e9eee5..000000000
--- 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 3702ef429..6496e1a44 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 9d32c6270..000000000
--- 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 7ecb1f9e5..c4a53e20c 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 8266482d1..000000000
--- 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 906407a35..af0621448 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 1e3af27cd..000000000
--- 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 f64e51be0..c03125b39 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 e3410ec1d..000000000
--- 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 1ffea8148..26df7537d 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 d8c9cd7aa..000000000
--- 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 ea1cf31f1..f0a230240 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 90d1e1832..000000000
--- 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 66f17fe2e..c6e5f67b5 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 3e8f71801..000000000
--- 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 6a4d43c43..b2b1f2f86 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 518466075..000000000
--- 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 daeaa5e56..78565f6c6 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 9ee5564cf..000000000
--- 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 cf58edb48..07f82739b 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 e749f710d..000000000
--- 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 68470dc34..494d58a41 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 34eb301ec..000000000
--- 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 6efc12900..7f72f3381 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 8b04e06b1..000000000
--- 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 30bea0026..8ad5b8047 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 6dbcdd1e8..000000000
--- 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 fc1d001a3..54ad325d7 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 408263540..000000000
--- 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 52ef28ba0..0b2dee6a0 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 e98932143..000000000
--- 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 1dcdb8b46..3f3f7d588 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 4f4fd79c9..000000000
--- 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 b7501bb1c..0c66999f1 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 f080d8ceb..000000000
--- 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 40ffb119b..86017e197 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 eb501d6d4..000000000
--- 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 8ffaaf68b..31efd5c9b 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 c9f03e518..000000000
--- 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 7634832b9..7677920ad 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 5628cb9d4..000000000
--- 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 6a2e7d56b..2fc70d74a 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 0335e3f75..000000000
--- 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 36d4a64ff..ea772dd83 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 4d35051fa..000000000
--- 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 bc3994121..0309d5713 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 ded82d842..000000000
--- 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 322221989..995c6aa9a 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 7e4d53bda..000000000
--- 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 183cad421..cbf27dea7 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 63e9acf67..000000000
--- 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 b66125e94..735ce3a0e 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 bb6ff664d..000000000
--- 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 df324ddfe..47afb6756 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 6738e4f24..000000000
--- 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 5154c1f79..615628c7a 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 f89f608a8..000000000
--- 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 01261393a..aa098dfdd 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 a478a18a4..000000000
--- 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 43c4bcaaa..92c29b4b1 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 25df8b42a..000000000
--- 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 37df0e7c7..5dd22ccd5 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 d81fc0c93..000000000
--- 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 3fd4520fa..ead0fbcbd 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 ce5a63468..000000000
--- 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 138c5a065..23f938c5b 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 eb0a85c63..000000000
--- 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 13d9c44ed..579251582 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 e80c8c0c7..000000000
--- 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 2174888ea..29514db03 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 0b80bd6ed..000000000
--- 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 24845455d..3f7d5328f 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 4e7fedf96..000000000
--- 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 611359f54..5002874b8 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 413101c74..000000000
--- 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 7ff5f6315..d6aa0644d 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 395004b41..000000000
--- 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 7360b9cfc..33f05fdc8 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 2d2b3e9d9..000000000
--- 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 8cdce9690..df73c4b27 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 c0555f79b..000000000
--- 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 520071a4c..8b8ca044b 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 cc944dd7b..000000000
--- 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 128fd70e7..365b020c0 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 9c8f8fceb..000000000
--- 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 915b163b8..85765c886 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 b115ce31f..000000000
--- 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 0450cc11f..5cb05766c 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 397970092..000000000
--- 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 1d1043768..4644526f4 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 8f31a5869..000000000
--- 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 627d11bc0..bb308e043 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 45d9b67ce..000000000
--- 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 a00af6c17..e4766cfad 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 990407718..000000000
--- 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 8dfa513e1..2d80999fe 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 31452eba8..000000000
--- 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 3e64a62d5..0dad3f416 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 2278d720c..000000000
--- 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 e120172ba..5a4536fed 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 d5f130899..000000000
--- 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 a7627bf40..e85030b97 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 5b2d7f213..bc2d26dfb 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 c6838bb05..000000000
--- 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 afbb63ac3..900060d33 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 fe859da30..000000000
--- 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 e2fdd71cc..71dfcde69 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 e1fb6fec3..c89eb4227 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 50828d86f..000000000
--- 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 7c3c8deaa..e8212e93f 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 d02613a02..000000000
--- 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 f5640a472..abb6e5389 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)))
+#"
+