@echo "# This file should not be altered manually" >> "$(CONFIG_FILE)-default"
@echo "# Overrides should be stored in file $(notdir $(CONFIG_FILE))" >> "$(CONFIG_FILE)-default"
@echo >> "$(CONFIG_FILE)-default"
+ @echo > $(OUTPUT_DIR)/Kconfig
@$(MAKE) $(NO_PRINT_DIRECTORY) -C $(OUTPUT_DIR) \
RELATIVE_DIR="" SOURCES_DIR=$(OUTPUT_DIR) \
-f $(OUTPUT_DIR)/Makefile default-config-pass
@echo "# Config for $(RELATIVE_DIR)" >> "$(CONFIG_FILE)-default"
@$(foreach x, $(default_CONFIG), echo '$(x)' | \
sed -e 's/^[^=]*=x$$/#\0/' >> "$(CONFIG_FILE)-default" ; )
-
+ @$(foreach x, $(default_CONFIG), $(call gen_kconfig,$(x)))
+
+config_name = $(shell x='$(1)'; xx=$${x%%\=*}; echo $${xx\#CONFIG_})
+config_val = $(shell x='$(1)'; echo $${x\#*=})
+
+define gen_kconfig
+$(if $(patsubst %=x,,$(1)),\
+ ( echo config $(config_name); \
+ echo " bool \"$(config_name) in $(RELATIVE_DIR)"; \
+ echo " default $(config_val)"; \
+ echo \
+ ) >> $(OUTPUT_DIR)/Kconfig; )
+endef
omkize:
$(Q)if ! grep -q MAKERULES_DIR Makefile; then \