Browse Source

Use config from the install location

... no need to create a local symlink.

Signed-off-by: Alexey Neyman <stilor@att.net>
dev-linux
Alexey Neyman 6 years ago
parent
commit
c9dad33728
  1. 27
      config/config.mk
  2. 1
      ct-ng.in
  3. 15
      kconfig/kconfig.mk
  4. 14
      samples/samples.mk
  5. 2
      scripts/saveSample.sh.in

27
config/config.mk

@ -1,27 +0,0 @@
#-----------------------------------------------------------
# List all config files
# The top-level config file to be used be configurators
# We need it to savedefconfig in scripts/saveSample.sh
export KCONFIG_TOP = config/config.in
# Build the list of all source config files
STATIC_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(shell find $(CT_LIB_DIR)/config -type f \( -name '*.in' -o -name '*.in.2' \) 2>/dev/null))
# ... and how to access them:
$(STATIC_CONFIG_FILES): config
# Helper entry for the configurators
PHONY += config_files
config_files: $(STATIC_CONFIG_FILES) $(GEN_CONFIG_FILES)
# Where to access to the source config files from
config:
@$(CT_ECHO) " LN config"
$(SILENT)ln -s $(CT_LIB_DIR)/config config
#-----------------------------------------------------------
# Cleaning up the mess...
clean::
@$(CT_ECHO) " CLEAN config"
$(SILENT)rm -f config 2>/dev/null || true

1
ct-ng.in

@ -111,7 +111,6 @@ help-clean::
@echo ' clean - Remove generated files'
@echo ' distclean - Remove generated files, configuration and build directories'
include $(CT_LIB_DIR)/config/config.mk
include $(CT_LIB_DIR)/kconfig/kconfig.mk
include $(CT_LIB_DIR)/steps.mk
include $(CT_LIB_DIR)/samples/samples.mk

15
kconfig/kconfig.mk

@ -5,10 +5,8 @@
#-----------------------------------------------------------
# The configurators rules
configurators = menuconfig nconfig oldconfig savedefconfig defconfig
PHONY += $(configurators)
$(configurators): config_files
# Top file of crosstool-NG configuration
export KCONFIG_TOP = $(CT_LIB_DIR)/config/config.in
export CT_IS_A_BACKEND:=$(CT_IS_A_BACKEND)
export CT_BACKEND_ARCH:=$(CT_BACKEND_ARCH)
@ -20,16 +18,19 @@ export CONF := $(CT_LIB_DIR)/kconfig/conf
MCONF := $(CT_LIB_DIR)/kconfig/mconf
NCONF := $(CT_LIB_DIR)/kconfig/nconf
# Used by conf/mconf/nconf to find the .in files
export srctree=$(CT_LIB_DIR)
menuconfig:
@$(CT_ECHO) " CONF $(KCONFIG_TOP)"
@$(CT_ECHO) " CONF $@"
$(SILENT)$(MCONF) $(KCONFIG_TOP)
nconfig:
@$(CT_ECHO) " CONF $(KCONFIG_TOP)"
@$(CT_ECHO) " CONF $@"
$(SILENT)$(NCONF) $(KCONFIG_TOP)
oldconfig: .config
@$(CT_ECHO) " CONF $(KCONFIG_TOP)"
@$(CT_ECHO) " CONF $@"
$(SILENT)$(CONF) --silent$@ $(KCONFIG_TOP)
savedefconfig: .config

14
samples/samples.mk

@ -48,7 +48,7 @@ show-config: .config
# Prints the details of a sample
PHONY += $(patsubst %,show-%,$(CT_SAMPLES))
$(patsubst %,show-%,$(CT_SAMPLES)): show-%: config_files
$(patsubst %,show-%,$(CT_SAMPLES)): show-%:
@KCONFIG_CONFIG=$$(pwd)/.config.sample \
$(CONF) --defconfig=$(call sample_dir,$*)/crosstool.config \
$(KCONFIG_TOP) >/dev/null
@ -72,7 +72,7 @@ list-samples-pre: FORCE
@echo 'Status Sample name'
PHONY += $(patsubst %,list-%,$(CT_SAMPLES))
$(patsubst %,list-%,$(CT_SAMPLES)): list-%: config_files
$(patsubst %,list-%,$(CT_SAMPLES)): list-%:
@KCONFIG_CONFIG=$$(pwd)/.config.sample \
$(CONF) --defconfig=$(call sample_dir,$*)/crosstool.config \
$(KCONFIG_TOP) >/dev/null
@ -87,7 +87,7 @@ list-samples-short: FORCE
# Check one sample
PHONY += $(patsubst %,check-%,$(CT_SAMPLES))
$(patsubst %,check-%,$(CT_SAMPLES)): check-%: config_files
$(patsubst %,check-%,$(CT_SAMPLES)): check-%:
@export KCONFIG_CONFIG=$$(pwd)/.config.sample; \
CT_NG_SAMPLE=$(call sample_dir,$*)/crosstool.config; \
$(CONF) -s --defconfig=$${CT_NG_SAMPLE} $(KCONFIG_TOP) &>/dev/null; \
@ -119,7 +119,7 @@ wiki-samples-pre: FORCE
wiki-samples-post: FORCE
$(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -W $(CT_SAMPLES)
$(patsubst %,wiki-%,$(CT_SAMPLES)): wiki-%: config_files
$(patsubst %,wiki-%,$(CT_SAMPLES)): wiki-%:
$(SILENT)KCONFIG_CONFIG=$$(pwd)/.config.sample \
$(CONF) --defconfig=$(call sample_dir,$*)/crosstool.config \
$(KCONFIG_TOP) >/dev/null
@ -146,8 +146,8 @@ endef
# How we do recall one sample
PHONY += $(CT_SAMPLES)
$(CT_SAMPLES): config_files
@$(CT_ECHO) " CONF $(KCONFIG_TOP)"
$(CT_SAMPLES):
@$(CT_ECHO) " CONF $@"
$(SILENT)$(CONF) --defconfig=$(call sample_dir,$@)/crosstool.config $(KCONFIG_TOP)
@echo
@echo '***********************************************************'
@ -225,7 +225,7 @@ endif # MAKECMDGOALS contains a build sample rule
endif # MAKECMDGOALS != ""
# Build a single sample
$(patsubst %,build-%,$(CT_SAMPLES)): build-%: config_files
$(patsubst %,build-%,$(CT_SAMPLES)): build-%:
$(call build_sample,$*)
# Cross samples (build==host)

2
scripts/saveSample.sh.in

@ -86,7 +86,7 @@ fi
# Now, actually save the defconfig
export KCONFIG_CONFIG="$(pwd)/.defconfig"
${CONF} --savedefconfig="${samp_dir}/crosstool.config" "${KCONFIG_TOP}"
srctree="${CT_LIB_DIR}" ${CONF} --savedefconfig="${samp_dir}/crosstool.config" "${KCONFIG_TOP}"
rm -f .defconfig
# Fill-in the reported-by info

Loading…
Cancel
Save