################################################################################
# Macro to update back the custom (def)config file
+# Must only be called if $(PKG)_KCONFIG_FILE is set and $(PKG)_KCONFIG_DEFCONFIG)
+# is not set.
# $(1): file to copy from
define kconfig-package-update-config
@$(if $($(PKG)_KCONFIG_FRAGMENT_FILES), \
echo "Unable to perform $(@) when fragment files are set"; exit 1)
- @$(if $($(PKG)_KCONFIG_DEFCONFIG), \
- echo "Unable to perform $(@) when using a defconfig rule"; exit 1)
$(Q)if [ -d $($(PKG)_KCONFIG_FILE) ]; then \
echo "Unable to perform $(@) when $($(PKG)_KCONFIG_FILE) is a directory"; \
exit 1; \
$$(call kconfig-package-savedefconfig,$(2))
endif
+ifeq ($$($(2)_KCONFIG_DEFCONFIG),)
# Target to copy back the configuration to the source configuration file
# Even though we could use 'cp --preserve-timestamps' here, the separate
# cp and 'touch --reference' is used for symmetry with $(1)-update-defconfig.
+.PHONY: $(1)-update-config
$(1)-update-config: PKG=$(2)
$(1)-update-config: $(1)-check-configuration-done
$$(call kconfig-package-update-config,$$($(2)_KCONFIG_DOTCONFIG))
$$(call kconfig-package-update-config,defconfig)
endif
+endif
+
# Target to output differences between the configuration obtained via the
# defconfig + fragments (if any) and the current configuration.
# Note: it preserves the timestamp of the current configuration when moving it
endif # package enabled
.PHONY: \
- $(1)-update-config \
$(1)-diff-config \
$(1)-check-configuration-done \
$$($(2)_DIR)/.kconfig_editor_% \