include: autotools.mk: do not fail in patch-libtool fixup if patch is already applied
[openwrt/openwrt.git] / include / target.mk
index 676b983271b29220cb74dab61170b978c0792ec9..af3230925c8a85ba79bc6121e50664ef8df56094 100644 (file)
@@ -17,9 +17,6 @@ DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg hotplug2
 DEFAULT_PACKAGES.router:=dnsmasq iptables ppp ppp-mod-pppoe kmod-ipt-nathelper firewall
 DEFAULT_PACKAGES.bootloader:=
 
-# Add device specific packages
-DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE))
-
 ifneq ($(DUMP),)
   all: dumpinfo
 endif
@@ -30,6 +27,9 @@ ifeq ($(DUMP),)
   SUBTARGET:=$(strip $(foreach subdir,$(patsubst $(PLATFORM_DIR)/%/target.mk,%,$(wildcard $(PLATFORM_DIR)/*/target.mk)),$(if $(CONFIG_TARGET_$(call target_conf,$(BOARD)_$(subdir))),$(subdir))))
 else
   PLATFORM_DIR:=${CURDIR}
+  ifeq ($(SUBTARGETS),)
+    SUBTARGETS:=$(strip $(patsubst $(PLATFORM_DIR)/%/target.mk,%,$(wildcard $(PLATFORM_DIR)/*/target.mk)))
+  endif
 endif
 
 TARGETID:=$(BOARD)$(if $(SUBTARGET),/$(SUBTARGET))
@@ -48,6 +48,9 @@ else
   endif
 endif
 
+# Add device specific packages (here below to allow device type set from subtarget)
+DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE))
+
 define Profile/Default
   NAME:=
   PACKAGES:=
@@ -212,6 +215,7 @@ define BuildTargets/DumpCurrent
         echo 'Linux-Version: $(LINUX_VERSION)'; \
         echo 'Linux-Release: $(LINUX_RELEASE)'; \
         echo 'Linux-Kernel-Arch: $(LINUX_KARCH)'; \
+       $(if $(SUBTARGET),,$(if $(DEFAULT_SUBTARGET), echo 'Default-Subtarget: $(DEFAULT_SUBTARGET)'; ))
         echo 'Target-Description:'; \
         $(SH_FUNC) getvar $(call shvar,Target/Description); \
         echo '@@'; \