image.mk: do not emit multiple target definitions for kernel images
authorFelix Fietkau <nbd@openwrt.org>
Sat, 18 Apr 2015 21:35:22 +0000 (21:35 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 18 Apr 2015 21:35:22 +0000 (21:35 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 45498

include/image.mk

index ebeec5ebb569955065aee662e87e2d1d39de95c8..bd6a88af61f2948947df79693d978680452ca11c 100644 (file)
@@ -380,8 +380,8 @@ define Device/Build/check_size
 endef
 
 define Device/Build/kernel
+  _KERNEL_IMAGES += $(KDIR)/$$(KERNEL_NAME)
   $(KDIR)/$$(KERNEL_NAME): image_prepare
-       touch $$@
   $$(_TARGET): $$(if $$(KERNEL_INSTALL),$(BIN_DIR)/$$(KERNEL_IMAGE))
   $(BIN_DIR)/$$(KERNEL_IMAGE): $(KDIR)/$$(KERNEL_IMAGE)
        cp $$^ $$@
@@ -456,6 +456,9 @@ define BuildImage
   $(foreach device,$(TARGET_DEVICES),$(call Device,$(device)))
   $(foreach fs,$(TARGET_FILESYSTEMS) $(fs-subtypes-y),$(call BuildImage/mkfs,$(fs)))
 
+  $$(sort $$(_KERNEL_IMAGES)):
+       @touch $$@
+
   install: kernel_prepare
        $(foreach fs,$(TARGET_FILESYSTEMS),
                $(call Image/Build,$(fs))