From 6f5afbdf82698ab0f91d5a36e7f171dd2829ec10 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Thu, 12 Jan 2017 16:53:28 -0800 Subject: Allow 'make V=1' to see the commands. Signed-off-by: Alexey Neyman --- kconfig/Makefile | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) (limited to 'kconfig') diff --git a/kconfig/Makefile b/kconfig/Makefile index ee838aa3..4a33ac8f 100644 --- a/kconfig/Makefile +++ b/kconfig/Makefile @@ -2,7 +2,12 @@ # Hmmm! Cheesy build! # Or: where I can unveil my make-fu... :-] -all: conf mconf nconf +__silent = $(if $(V),,@printf ' %-7s %s\n' '$1' '$(if $2,$2,$(strip $<))' && ) +__silent_rm = $(call __silent,RM,$1)rm -f $1 + +PROGS = conf mconf nconf + +all: $(PROGS) @true # Just be silent, you fscking son of a fscking beach... # Build flags @@ -64,8 +69,7 @@ DEPS += $(nconf_DEP) # Build the dependency for C files %.dep: %.c - @echo " DEP '$@'" - @$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MM $< |$(sed) -r -e 's|([^:]+.o)( *:+)|$(<:.c=.o) $@\2|;' >$@ + $(call __silent,DEP,$@)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MM $< |$(sed) -r -e 's|([^:]+.o)( *:+)|$(<:.c=.o) $@\2|;' >$@ # Generate the grammar parser zconf.tab.o: zconf.tab.c zconf.hash.c zconf.lex.c @@ -73,39 +77,39 @@ zconf.tab.dep: zconf.tab.c zconf.hash.c zconf.lex.c .PRECIOUS: zconf.tab.c zconf.tab.c: zconf.y - @echo " BISON '$@'" - @bison -l -b zconf -p zconf $< + $(call __silent,BISON)bison -l -b zconf -p zconf $< zconf.hash.c: zconf.gperf - @echo " GPERF '$@'" - @$(gperf) -C < $< > $@ + $(call __silent,GPERF)$(gperf) -C < $< > $@ zconf.lex.c: zconf.l - @echo " LEX '$@'" - @flex -L -Pzconf -o$@ $< + $(call __silent,LEX)flex -L -Pzconf -o$@ $< # Build C files %.o: %.c - @echo " CC '$@'" - @$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $< + $(call __silent,CC)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $< # Actual link mconf: $(COMMON_OBJ) $(LX_OBJ) $(mconf_OBJ) - @echo " LD '$@'" - @$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) + $(call __silent,LD,$@)$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) nconf: $(COMMON_OBJ) $(nconf_OBJ) - @echo " LD '$@'" - @$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) + $(call __silent,LD,$@)$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) conf: $(COMMON_OBJ) $(conf_OBJ) - @echo " LD '$@'" - @$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) + $(call __silent,LD,$@)$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) + +#----------------------------------------------------------- +# Installation +install: $(patsubst %,install-%,$(PROGS)) install-kconfig.mk + +install-%: % + $(call __silent,INSTALL,$<)install $< $(DESTDIR)/$< #----------------------------------------------------------- # Cleaning up the mess... clean: - @echo " RM 'kconfig'" - @rm -f conf mconf nconf $(ALL_OBJS) $(ALL_DEPS) - @rm -f rm -f zconf.tab.c zconf.hash.c zconf.lex.c lex.backup + $(call __silent,RM,objs)rm -f $(ALL_OBJS) $(ALL_DEPS) + $(call __silent_rm,$(PROGS)) + $(call __silent_rm,zconf.tab.c zconf.hash.c zconf.lex.c lex.backup) -- cgit v1.2.3 From c9dad337289153ee70d4ed264cf628f22f6ec2bb Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sat, 22 Apr 2017 23:33:36 -0700 Subject: Use config from the install location ... no need to create a local symlink. Signed-off-by: Alexey Neyman --- config/config.mk | 27 --------------------------- ct-ng.in | 1 - kconfig/kconfig.mk | 15 ++++++++------- samples/samples.mk | 14 +++++++------- scripts/saveSample.sh.in | 2 +- 5 files changed, 16 insertions(+), 43 deletions(-) delete mode 100644 config/config.mk (limited to 'kconfig') diff --git a/config/config.mk b/config/config.mk deleted file mode 100644 index e0ca3d23..00000000 --- a/config/config.mk +++ /dev/null @@ -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 diff --git a/ct-ng.in b/ct-ng.in index 12049088..09ba89ca 100644 --- a/ct-ng.in +++ b/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 diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk index 3d330b48..955ae0bb 100644 --- a/kconfig/kconfig.mk +++ b/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 diff --git a/samples/samples.mk b/samples/samples.mk index 5c8f130e..ce7e7c98 100644 --- a/samples/samples.mk +++ b/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) diff --git a/scripts/saveSample.sh.in b/scripts/saveSample.sh.in index 2e413bd0..2eb1f40a 100644 --- a/scripts/saveSample.sh.in +++ b/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 -- cgit v1.2.3 From 2f286ce5ab5f9938e504549726bf25acc5bdfe4b Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sat, 22 Apr 2017 23:51:05 -0700 Subject: Retire BACKEND stuff ... it is possible to just not set it in the configuration, why force it? It just increases the complexity in Kconfig. Signed-off-by: Alexey Neyman --- config/backend.in | 26 ---------------------- config/binutils/binutils.in | 1 - config/config.in | 1 - config/debug/duma.in | 1 - config/debug/gdb.in.native | 1 - config/debug/ltrace.in | 2 -- config/debug/strace.in | 2 -- config/global/build-behave.in | 19 +++++----------- config/global/ct-behave.in | 1 - config/global/paths.in | 14 +++++------- config/toolchain.in | 4 ++-- kconfig/kconfig.mk | 5 ----- maintainer/gen-kconfig.sh | 52 +++++++++++++------------------------------ 13 files changed, 29 insertions(+), 100 deletions(-) delete mode 100644 config/backend.in (limited to 'kconfig') diff --git a/config/backend.in b/config/backend.in deleted file mode 100644 index 12d278b1..00000000 --- a/config/backend.in +++ /dev/null @@ -1,26 +0,0 @@ -# Options specific to crosstool-NG acting as a backend - -config IS_A_BACKEND - string - option env="CT_IS_A_BACKEND" - -config BACKEND - bool - depends on OBSOLETE - default y if IS_A_BACKEND = "y" || IS_A_BACKEND = "Y" - -if BACKEND - -config BACKEND_ARCH - string - option env="CT_BACKEND_ARCH" - -config BACKEND_KERNEL - string - option env="CT_BACKEND_KERNEL" - -config BACKEND_LIBC - string - option env="CT_BACKEND_LIBC" - -endif #if BACKEND diff --git a/config/binutils/binutils.in b/config/binutils/binutils.in index 1bb674e6..c83cbb1a 100644 --- a/config/binutils/binutils.in +++ b/config/binutils/binutils.in @@ -314,7 +314,6 @@ config BINUTILS_FOR_TARGET bool prompt "binutils libraries for the target" depends on ! BARE_METAL - depends on ! BACKEND help Some utilities may need binutils libraries to be available on the target, eg. oprofile. diff --git a/config/config.in b/config/config.in index 885f7222..21b0c7ea 100644 --- a/config/config.in +++ b/config/config.in @@ -1,5 +1,4 @@ source "config/configure.in" -source "config/backend.in" source "config/global.in" source "config/target.in" source "config/toolchain.in" diff --git a/config/debug/duma.in b/config/debug/duma.in index 9947ca29..170a6945 100644 --- a/config/debug/duma.in +++ b/config/debug/duma.in @@ -1,6 +1,5 @@ # D.U.M.A. - Detect Unintended Memory Access - Memory checker -## depends on ! BACKEND ## depends on ! BARE_METAL ## help D.U.M.A. - Detect Unintended Memory Access diff --git a/config/debug/gdb.in.native b/config/debug/gdb.in.native index 8684c05f..e856b5da 100644 --- a/config/debug/gdb.in.native +++ b/config/debug/gdb.in.native @@ -4,7 +4,6 @@ config GDB_NATIVE bool prompt "Native gdb" depends on ! BARE_METAL - depends on ! BACKEND select EXPAT_TARGET select NCURSES_TARGET help diff --git a/config/debug/ltrace.in b/config/debug/ltrace.in index fc5822d2..4c626764 100644 --- a/config/debug/ltrace.in +++ b/config/debug/ltrace.in @@ -1,7 +1,5 @@ # ltrace -## depends on ! BACKEND -## ## select LIBELF_TARGET ## ## help ltrace is a program that simply runs the specified command until it exits. diff --git a/config/debug/strace.in b/config/debug/strace.in index 4cf69801..38dd96fd 100644 --- a/config/debug/strace.in +++ b/config/debug/strace.in @@ -1,7 +1,5 @@ # strace -## depends on ! BACKEND - choice bool prompt "strace version" diff --git a/config/global/build-behave.in b/config/global/build-behave.in index 9ad54384..d3298eaa 100644 --- a/config/global/build-behave.in +++ b/config/global/build-behave.in @@ -2,12 +2,9 @@ comment "Build behavior" -comment "Build options hiden" - depends on BACKEND - config PARALLEL_JOBS int - prompt "Number of parallel jobs" if ! BACKEND + prompt "Number of parallel jobs" default 0 help Number of jobs make will be allowed to run concurently. @@ -20,7 +17,7 @@ config PARALLEL_JOBS config LOAD string - prompt "Maximum allowed load" if ! BACKEND + prompt "Maximum allowed load" default "" help Specifies that no new jobs should be started if there are others jobs @@ -33,7 +30,7 @@ config LOAD config USE_PIPES bool - prompt "Use -pipe" if ! BACKEND + prompt "Use -pipe" default y help Use gcc's option -pipe to use pipes rather than temp files when building @@ -83,7 +80,6 @@ choice bool prompt "Shell to use as CONFIG_SHELL" default CONFIG_SHELL_BASH - depends on ! BACKEND config CONFIG_SHELL_SH bool @@ -141,13 +137,10 @@ config CONFIG_SHELL_CUSTOM endchoice -# Do not put this into the choice above, because the choice -# is not available in BACKEND-mode, while we do want this to -# be set even in BACKEND-mode. config CONFIG_SHELL_CUSTOM_PATH string - prompt "Path to custom shell" if ! BACKEND - depends on CONFIG_SHELL_CUSTOM || BACKEND + prompt "Path to custom shell" + depends on CONFIG_SHELL_CUSTOM default "/bin/sh" # Ditto. @@ -157,4 +150,4 @@ config CONFIG_SHELL default "/bin/sh" if CONFIG_SHELL_SH default "/bin/ash" if CONFIG_SHELL_ASH default "${bash}" if CONFIG_SHELL_BASH - default CONFIG_SHELL_CUSTOM_PATH if CONFIG_SHELL_CUSTOM || BACKEND + default CONFIG_SHELL_CUSTOM_PATH if CONFIG_SHELL_CUSTOM diff --git a/config/global/ct-behave.in b/config/global/ct-behave.in index a57c7984..42171e4d 100644 --- a/config/global/ct-behave.in +++ b/config/global/ct-behave.in @@ -63,7 +63,6 @@ config ALLOW_BUILD_AS_ROOT_SURE config DEBUG_CT bool prompt "Debug crosstool-NG" - depends on ! BACKEND help Say 'y' here to get some options regarding debugging crosstool-NG. diff --git a/config/global/paths.in b/config/global/paths.in index 5313d0d0..39e15f35 100644 --- a/config/global/paths.in +++ b/config/global/paths.in @@ -4,7 +4,7 @@ comment "Paths" config LOCAL_TARBALLS_DIR string - prompt "Local tarballs directory" if ! BACKEND + prompt "Local tarballs directory" default "${HOME}/src" help If you have previously downloaded the tarballs, enter the PATH where @@ -12,8 +12,8 @@ config LOCAL_TARBALLS_DIR config SAVE_TARBALLS bool - prompt "Save new tarballs" if ! BACKEND - depends on LOCAL_TARBALLS_DIR != "" || BACKEND + prompt "Save new tarballs" + depends on LOCAL_TARBALLS_DIR != "" default y help If you say 'y' here, new downloaded tarballs will be saved in the @@ -21,7 +21,7 @@ config SAVE_TARBALLS config WORK_DIR string - prompt "Working directory" if ! BACKEND + prompt "Working directory" default "${CT_TOP_DIR}/.build" help Set this to the directory where all build actions will be done. @@ -46,7 +46,7 @@ config BUILD_TOP_DIR config PREFIX_DIR string - prompt "Prefix directory" if ! BACKEND + prompt "Prefix directory" default "${CT_PREFIX:-${HOME}/x-tools}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}" help This is the path the toolchain will run from. @@ -55,7 +55,6 @@ config RM_RF_PREFIX_DIR bool prompt "| Remove the prefix dir prior to building" default y - depends on !BACKEND help If you say 'y' here, then PREFIX_DIR (above) will be eradicated prior to the toolchain is built. @@ -69,9 +68,6 @@ config RM_RF_PREFIX_DIR it into a directory with pre-install, unrelated programs, it would be damageable to remove that directory. In this case, you may want to say 'n' here. - - Note that when acting as a backend, this option is not available, and - is forced to 'n'. config REMOVE_DOCS bool diff --git a/config/toolchain.in b/config/toolchain.in index c712f395..1b2a289e 100644 --- a/config/toolchain.in +++ b/config/toolchain.in @@ -20,7 +20,7 @@ config USE_SYSROOT config SYSROOT_NAME string - prompt "sysroot directory name" if ! BACKEND + prompt "sysroot directory name" depends on USE_SYSROOT default "sysroot" help @@ -33,7 +33,7 @@ config SYSROOT_NAME config SYSROOT_DIR_PREFIX string - prompt "sysroot prefix dir (READ HELP)" if ! BACKEND + prompt "sysroot prefix dir (READ HELP)" depends on USE_SYSROOT default "" help diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk index 955ae0bb..c82e5022 100644 --- a/kconfig/kconfig.mk +++ b/kconfig/kconfig.mk @@ -8,11 +8,6 @@ # 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) -export CT_BACKEND_KERNEL:=$(CT_BACKEND_KERNEL) -export CT_BACKEND_LIBC:=$(CT_BACKEND_LIBC) - # We need CONF for savedefconfig in scripts/saveSample.sh export CONF := $(CT_LIB_DIR)/kconfig/conf MCONF := $(CT_LIB_DIR)/kconfig/mconf diff --git a/maintainer/gen-kconfig.sh b/maintainer/gen-kconfig.sh index 4cb65678..364844d9 100755 --- a/maintainer/gen-kconfig.sh +++ b/maintainer/gen-kconfig.sh @@ -10,12 +10,10 @@ grep=${GREP:-grep} # # Usage: # generate a choice: -# gen_choice