From 843468608500ab25d5229b8d983b440996574db2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 12 Jul 2015 22:37:09 +0200 Subject: [PATCH] build: implicitly configure board and subtarget options The file targets/$GLUON_TARGET/config becomes optional, as many targets only used it to set the board and subtarget. Also fix targets without subtarget. --- Makefile | 9 +++++++-- docs/dev/hardware.rst | 10 +++++----- targets/ar71xx-generic/config | 1 - targets/ar71xx-nand/config | 2 -- targets/brcm2708-bcm2708/config | 2 -- targets/brcm2708-bcm2709/config | 2 -- targets/mpc85xx-generic/config | 1 - targets/ramips-rt305x/config | 2 -- targets/x86-64/config | 2 -- targets/x86-generic/config | 1 - targets/x86-kvm_guest/config | 2 -- 11 files changed, 12 insertions(+), 22 deletions(-) delete mode 100644 targets/ar71xx-nand/config delete mode 100644 targets/brcm2708-bcm2708/config delete mode 100644 targets/brcm2708-bcm2709/config delete mode 100644 targets/mpc85xx-generic/config delete mode 100644 targets/ramips-rt305x/config delete mode 100644 targets/x86-kvm_guest/config diff --git a/Makefile b/Makefile index 6d21119c..187a5acb 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ include $(GLUONDIR)/include/toplevel.mk include $(GLUONDIR)/targets/targets.mk -CheckTarget := [ -n '$(GLUON_TARGET)' -a -n '$(GLUON_TARGET_$(GLUON_TARGET)_BOARD)' -a -n '$(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET)' ] \ +CheckTarget := [ -n '$(GLUON_TARGET)' -a -n '$(GLUON_TARGET_$(GLUON_TARGET)_BOARD)' ] \ || (echo -e 'Please set GLUON_TARGET to a valid target. Gluon supports the following targets:$(subst $(space),\n * ,$(GLUON_TARGETS))'; false) @@ -209,7 +209,12 @@ config: FORCE +$(NO_TRACE_MAKE) scripts/config/conf OPENWRT_BUILD= QUIET=0 +$(GLUONMAKE) prepare-tmpinfo ( \ - cat $(GLUONDIR)/include/config $(GLUONDIR)/targets/$(GLUON_TARGET)/config; \ + cat $(GLUONDIR)/include/config; \ + echo 'CONFIG_TARGET_$(GLUON_TARGET_$(GLUON_TARGET)_BOARD)=y'; \ + $(if $(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET), \ + echo 'CONFIG_TARGET_$(GLUON_TARGET_$(GLUON_TARGET)_BOARD)_$(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET)=y'; \ + ) \ + cat $(GLUONDIR)/targets/$(GLUON_TARGET)/config 2>/dev/null; \ echo 'CONFIG_BUILD_SUFFIX="gluon-$(GLUON_TARGET)"'; \ echo '$(patsubst %,CONFIG_PACKAGE_%=m,$(sort $(filter-out -%,$(GLUON_DEFAULT_PACKAGES) $(GLUON_SITE_PACKAGES) $(PROFILE_PACKAGES))))' \ | sed -e 's/ /\n/g'; \ diff --git a/docs/dev/hardware.rst b/docs/dev/hardware.rst index a1a7f31c..d2f3424a 100644 --- a/docs/dev/hardware.rst +++ b/docs/dev/hardware.rst @@ -73,14 +73,14 @@ won't run correctly without some adjustments, so better double check that everyt Add support to the build system ''''''''''''''''''''''''''''''' A directory for the new target must be created under ``targets``, and it must be added -to ``targets/targets.mk``. In the new target directory, three files must be created: +to ``targets/targets.mk``. In the new target directory, the following files must be created: -* config * profiles.mk * vermagic +* config (optional) -The file ``config`` can be used to add additional, target-specific options to the OpenWrt config. It -must at least select the correct target and subtarget. For ``profiles.mk``, see :ref:`hardware-adding-profiles`. +For ``profiles.mk``, see :ref:`hardware-adding-profiles`. +The file ``config`` can be used to add additional, target-specific options to the OpenWrt config. The files ``vermagic`` must have the correct content so kernel modules from the upstream repositories can be installed without dependency issues. The OpenWrt version a Gluon release is based on is defined by the upstream package repo URL in ``include/gluon.mk`` @@ -92,4 +92,4 @@ The content is a hash which is part of the version number of the kernel package. As the kernel package is called ``kernel_3.10.49-1-0114c71ed85677c9c1e4911437af4743_ar71xx.ipk``, the correct ``vermagic`` string is ``0114c71ed85677c9c1e4911437af4743``. -After this, is should be sufficient to call ``make GLUON_TARGET=-`` to build the images for the new target. +After this, is should be sufficient to call ``make GLUON_TARGET=`` to build the images for the new target. diff --git a/targets/ar71xx-generic/config b/targets/ar71xx-generic/config index 4a04ed86..acf4627a 100644 --- a/targets/ar71xx-generic/config +++ b/targets/ar71xx-generic/config @@ -1,2 +1 @@ -CONFIG_TARGET_ar71xx=y # CONFIG_PACKAGE_uboot-ar71xx-nbg460n_550n_550nh is not set diff --git a/targets/ar71xx-nand/config b/targets/ar71xx-nand/config deleted file mode 100644 index f6afe36f..00000000 --- a/targets/ar71xx-nand/config +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_TARGET_ar71xx=y -CONFIG_TARGET_ar71xx_nand=y diff --git a/targets/brcm2708-bcm2708/config b/targets/brcm2708-bcm2708/config deleted file mode 100644 index 5187248e..00000000 --- a/targets/brcm2708-bcm2708/config +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_TARGET_brcm2708=y -CONFIG_TARGET_brcm2708_bcm2708=y diff --git a/targets/brcm2708-bcm2709/config b/targets/brcm2708-bcm2709/config deleted file mode 100644 index 681d3586..00000000 --- a/targets/brcm2708-bcm2709/config +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_TARGET_brcm2708=y -CONFIG_TARGET_brcm2708_bcm2709=y diff --git a/targets/mpc85xx-generic/config b/targets/mpc85xx-generic/config deleted file mode 100644 index 83737ebe..00000000 --- a/targets/mpc85xx-generic/config +++ /dev/null @@ -1 +0,0 @@ -CONFIG_TARGET_mpc85xx=y diff --git a/targets/ramips-rt305x/config b/targets/ramips-rt305x/config deleted file mode 100644 index 8e9365fa..00000000 --- a/targets/ramips-rt305x/config +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_TARGET_ramips=y -CONFIG_TARGET_ramips_rt305x=y diff --git a/targets/x86-64/config b/targets/x86-64/config index f00279eb..85016e81 100644 --- a/targets/x86-64/config +++ b/targets/x86-64/config @@ -1,4 +1,2 @@ -CONFIG_TARGET_x86=y -CONFIG_TARGET_x86_64=y CONFIG_VDI_IMAGES=y CONFIG_VMDK_IMAGES=y diff --git a/targets/x86-generic/config b/targets/x86-generic/config index e70b7455..85016e81 100644 --- a/targets/x86-generic/config +++ b/targets/x86-generic/config @@ -1,3 +1,2 @@ -CONFIG_TARGET_x86=y CONFIG_VDI_IMAGES=y CONFIG_VMDK_IMAGES=y diff --git a/targets/x86-kvm_guest/config b/targets/x86-kvm_guest/config deleted file mode 100644 index a92fa472..00000000 --- a/targets/x86-kvm_guest/config +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_TARGET_x86=y -CONFIG_TARGET_x86_kvm_guest=y