build: remove image prefix from kernel files in KDIR

This allows the image builder to change EXTRA_IMAGE_NAME at a later
point in time without breaking the build

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2016-07-21 17:49:19 +02:00
parent 9945a1dca5
commit b47f438d98

View File

@ -335,6 +335,7 @@ else
endif endif
define Device/Check define Device/Check
KDIR_KERNEL_IMAGE := $(KDIR)/$(1)$$(KERNEL_SUFFIX)
_PROFILE_SET = $$(strip $$(foreach profile,$$(PROFILES) DEVICE_$(1),$$(call DEVICE_CHECK_PROFILE,$$(profile)))) _PROFILE_SET = $$(strip $$(foreach profile,$$(PROFILES) DEVICE_$(1),$$(call DEVICE_CHECK_PROFILE,$$(profile))))
_TARGET := $$(if $$(_PROFILE_SET),install-images,install-disabled) _TARGET := $$(if $$(_PROFILE_SET),install-images,install-disabled)
ifndef IB ifndef IB
@ -373,17 +374,17 @@ define Device/Build/compile
endef endef
define Device/Build/kernel define Device/Build/kernel
_KERNEL_IMAGES += $(KDIR)/$$(KERNEL_NAME) _KERNEL_IMAGES += $$(KDIR_KERNEL_NAME)
$(KDIR)/$$(KERNEL_NAME):: image_prepare $(KDIR)/$$(KERNEL_NAME):: image_prepare
$$(_TARGET): $$(if $$(KERNEL_INSTALL),$(BIN_DIR)/$$(KERNEL_IMAGE)) $$(_TARGET): $$(if $$(KERNEL_INSTALL),$(BIN_DIR)/$$(KERNEL_IMAGE))
$(call Device/Export,$(KDIR)/$$(KERNEL_IMAGE),$(1)) $(call Device/Export,$$(KDIR_KERNEL_IMAGE),$(1))
$(BIN_DIR)/$$(KERNEL_IMAGE): $(KDIR)/$$(KERNEL_IMAGE) $(BIN_DIR)/$$(KERNEL_IMAGE): $$(KDIR_KERNEL_IMAGE)
cp $$^ $$@ cp $$^ $$@
ifndef IB ifndef IB
ifdef CONFIG_IB ifdef CONFIG_IB
install: $(KDIR)/$$(KERNEL_IMAGE) install: $$(KDIR_KERNEL_IMAGE)
endif endif
$(KDIR)/$$(KERNEL_IMAGE): $(KDIR)/$$(KERNEL_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS) $$(KDIR_KERNEL_IMAGE): $(KDIR)/$$(KERNEL_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS)
@rm -f $$@ @rm -f $$@
$$(call concat_cmd,$$(KERNEL)) $$(call concat_cmd,$$(KERNEL))
$$(if $$(KERNEL_SIZE),$$(call Device/Build/check_size,$$(KERNEL_SIZE))) $$(if $$(KERNEL_SIZE),$$(call Device/Build/check_size,$$(KERNEL_SIZE)))
@ -393,7 +394,7 @@ endef
define Device/Build/image define Device/Build/image
$$(_TARGET): $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)) $$(_TARGET): $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))
$(eval $(call Device/Export,$(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)),$(1))) $(eval $(call Device/Export,$(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)),$(1)))
$(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)): $(KDIR)/$$(KERNEL_IMAGE) $(KDIR)/root.$(1)$$(if $$(FS_OPTIONS/$(1)),+fs=$$(call param_mangle,$$(FS_OPTIONS/$(1)))) $(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)): $$(KDIR_KERNEL_IMAGE) $(KDIR)/root.$(1)$$(if $$(FS_OPTIONS/$(1)),+fs=$$(call param_mangle,$$(FS_OPTIONS/$(1))))
@rm -f $$@ @rm -f $$@
[ -f $$(word 1,$$^) -a -f $$(word 2,$$^) ] [ -f $$(word 1,$$^) -a -f $$(word 2,$$^) ]
$$(call concat_cmd,$(if $(IMAGE/$(2)/$(1)),$(IMAGE/$(2)/$(1)),$(IMAGE/$(2)))) $$(call concat_cmd,$(if $(IMAGE/$(2)/$(1)),$(IMAGE/$(2)/$(1)),$(IMAGE/$(2))))