kconfig: install compiled frontends
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Jan 14 18:22:06 2012 +0100 (2012-01-14)
changeset 28350a2fa748727e
parent 2834 0a0410dd0cb0
child 2836 1c4f3be68a6d
kconfig: install compiled frontends

The kconfig frontends are currently instaleld as source files. This is
a remnant of the early times, when I wanted a single installation of
crosstool-NG to be shared across multiple machines, potentially of
different architectures.

This does not really make sense, and it's been a long time since it
was las tpossible in practice.

So, just build the kconfig frontends at make-time, and install them
as we do for all other crosstool-NG dependent files.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Makefile.in
configure.ac
kconfig/Makefile
kconfig/kconfig.mk
     1.1 --- a/Makefile.in	Mon Nov 07 22:28:40 2011 +0100
     1.2 +++ b/Makefile.in	Sat Jan 14 18:22:06 2012 +0100
     1.3 @@ -39,29 +39,37 @@
     1.4  # Configuration variables
     1.5  
     1.6  # Stuff found by ./configure
     1.7 -DATE            := @DATE@
     1.8 -LOCAL           := @enable_local@
     1.9 -PROG_SED        := @program_transform_name@
    1.10 -PACKAGE_TARNAME := @PACKAGE_TARNAME@
    1.11 -VERSION         := @PACKAGE_VERSION@
    1.12 -prefix          := @prefix@
    1.13 -exec_prefix     := @exec_prefix@
    1.14 -bindir          := @bindir@
    1.15 -libdir          := @libdir@@sublibdir@
    1.16 -docdir          := @docdir@@subdocdir@
    1.17 -datarootdir     := @datarootdir@
    1.18 -mandir          := @mandir@
    1.19 -install         := @INSTALL@
    1.20 -bash            := @_BASH@
    1.21 -grep            := @EGREP@
    1.22 -make            := @MAKE@
    1.23 -sed             := @SED@
    1.24 -libtool         := @LIBTOOL@
    1.25 -libtoolize      := @LIBTOOLIZE@
    1.26 -objcopy         := @OBJCOPY@
    1.27 -objdump         := @OBJDUMP@
    1.28 -readelf         := @READELF@
    1.29 -patch           := @PATCH@
    1.30 +export DATE            := @DATE@
    1.31 +export LOCAL           := @enable_local@
    1.32 +export PROG_SED        := @program_transform_name@
    1.33 +export PACKAGE_TARNAME := @PACKAGE_TARNAME@
    1.34 +export VERSION         := @PACKAGE_VERSION@
    1.35 +export prefix          := @prefix@
    1.36 +export exec_prefix     := @exec_prefix@
    1.37 +export bindir          := @bindir@
    1.38 +export libdir          := @libdir@@sublibdir@
    1.39 +export docdir          := @docdir@@subdocdir@
    1.40 +export mandir          := @mandir@
    1.41 +export datarootdir     := @datarootdir@
    1.42 +export install         := @INSTALL@
    1.43 +export bash            := @_BASH@
    1.44 +export grep            := @EGREP@
    1.45 +export make            := @MAKE@
    1.46 +export sed             := @SED@
    1.47 +export libtool         := @LIBTOOL@
    1.48 +export libtoolize      := @LIBTOOLIZE@
    1.49 +export objcopy         := @OBJCOPY@
    1.50 +export objdump         := @OBJDUMP@
    1.51 +export readelf         := @READELF@
    1.52 +export patch           := @PATCH@
    1.53 +export CC              := @CC@
    1.54 +export CPP             := @CPP@
    1.55 +export CPPFLAGS        := @CPPFLAGS@
    1.56 +export CFLAGS          := @CFLAGS@
    1.57 +export LDFLAGS         := @LDFLAGS@
    1.58 +export LIBS            := @LIBS@
    1.59 +export curses_hdr      := @ac_ct_curses_hdr@
    1.60 +export gettext         := @gettext@
    1.61  
    1.62  # config options to push down to kconfig
    1.63  KCONFIG:= @kconfig_options@
    1.64 @@ -113,7 +121,7 @@
    1.65  else
    1.66  # There were no additional MAKEFLAGS to add, do the job
    1.67  
    1.68 -TARGETS := bin lib doc man
    1.69 +TARGETS := bin lib lib-kconfig doc man
    1.70  
    1.71  build: $(patsubst %,build-%,$(TARGETS))
    1.72  
    1.73 @@ -137,10 +145,17 @@
    1.74  #--------------------------------------
    1.75  # Build rules
    1.76  
    1.77 -build-bin: $(PROG_NAME) scripts/crosstool-NG.sh scripts/saveSample.sh scripts/showTuple.sh
    1.78 +build-bin: $(PROG_NAME)             \
    1.79 +           scripts/crosstool-NG.sh  \
    1.80 +           scripts/saveSample.sh    \
    1.81 +           scripts/showTuple.sh
    1.82  	@chmod 755 $^
    1.83  
    1.84 -build-lib: paths.mk config/configure.in
    1.85 +build-lib: paths.mk             \
    1.86 +           config/configure.in
    1.87 +
    1.88 +build-lib-kconfig:
    1.89 +	@$(MAKE) -C kconfig
    1.90  
    1.91  build-doc:
    1.92  
    1.93 @@ -229,6 +244,9 @@
    1.94  	@echo "  RM     'config/configure.in'"
    1.95  	@rm -f config/configure.in
    1.96  
    1.97 +clean-lib-kconfig:
    1.98 +	@$(MAKE) -C kconfig clean
    1.99 +
   1.100  clean-doc:
   1.101  
   1.102  clean-man:
   1.103 @@ -263,9 +281,12 @@
   1.104  # installations of the same VERSION, thus the patches must be removed prior
   1.105  # to being installed. It is simpler to remove the whole lib/ directory, as it
   1.106  # is the goal of the install-lib rule to install the lib/ directory...
   1.107 -install-lib: uninstall-lib $(DESTDIR)$(libdir) install-lib-main install-lib-samples
   1.108 +install-lib: uninstall-lib          \
   1.109 +             $(DESTDIR)$(libdir)    \
   1.110 +             install-lib-main       \
   1.111 +             install-lib-samples
   1.112  
   1.113 -LIB_SUB_DIR := config contrib kconfig patches scripts
   1.114 +LIB_SUB_DIR := config contrib patches scripts
   1.115  $(patsubst %,install-lib-%-copy,$(LIB_SUB_DIR)): $(DESTDIR)$(libdir)
   1.116  	@echo "  INSTDIR '$(patsubst install-lib-%-copy,%,$(@))/'"
   1.117  	@tar cf - --exclude='*.sh.in' $(patsubst install-lib-%-copy,%,$(@)) \
   1.118 @@ -306,6 +327,13 @@
   1.119  	 done
   1.120  	@$(install) -m 644 samples/samples.mk "$(DESTDIR)$(libdir)/samples/samples.mk"
   1.121  
   1.122 +KCONFIG_FILES := conf mconf nconf kconfig.mk
   1.123 +install-lib-kconfig: $(DESTDIR)$(libdir) install-lib-main
   1.124 +	@echo "  INST    'kconfig/'"
   1.125 +	@for f in $(KCONFIG_FILES); do                                      \
   1.126 +	    install -D "kconfig/$${f}" "$(DESTDIR)$(libdir)/kconfig/$${f}"; \
   1.127 +	 done
   1.128 +
   1.129  install-doc: $(DESTDIR)$(docdir)
   1.130  	@echo "  INST    'docs/*.txt'"
   1.131  	@for doc_file in docs/*.txt; do                              \
     2.1 --- a/configure.ac	Mon Nov 07 22:28:40 2011 +0100
     2.2 +++ b/configure.ac	Sat Jan 14 18:22:06 2012 +0100
     2.3 @@ -251,11 +251,27 @@
     2.4  AC_FUNC_MALLOC
     2.5  AC_FUNC_REALLOC
     2.6  AC_FUNC_ALLOCA
     2.7 +
     2.8 +#----------------------------------------
     2.9 +# Check for gettext, for the kconfig frontends
    2.10 +AC_SUBST([gettext])
    2.11 +AC_CHECK_HEADERS(
    2.12 +    [libintl.h],
    2.13 +    [ac_ct_gettext_hdr=$ac_header; break])
    2.14 +AS_IF(
    2.15 +    [test -n "$ac_ct_gettext_hdr"],
    2.16 +    [AC_CHECK_DECL(
    2.17 +        [gettext],gettext=y,,
    2.18 +        [#include <$ac_ct_gettext_hdr>])])
    2.19 +
    2.20 +#----------------------------------------
    2.21 +# Check for ncurses, for the kconfig frontends
    2.22 +AC_SUBST([ac_ct_curses_hdr])
    2.23  AC_CHECK_HEADERS(
    2.24      [ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h],
    2.25 -    [ac_ct_curses_hdr_found=yes; break])
    2.26 +    [ac_ct_curses_hdr=$ac_header; break])
    2.27  AS_IF(
    2.28 -    [test -z "$ac_ct_curses_hdr_found"],
    2.29 +    [test -z "$ac_ct_curses_hdr"],
    2.30      [AC_MSG_ERROR([could not find curses header, required for the kconfig frontends])])
    2.31  AC_SEARCH_LIBS(
    2.32      [initscr],
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/kconfig/Makefile	Sat Jan 14 18:22:06 2012 +0100
     3.3 @@ -0,0 +1,99 @@
     3.4 +#-----------------------------------------------------------
     3.5 +# Hmmm! Cheesy build!
     3.6 +# Or: where I can unveil my make-fu... :-]
     3.7 +
     3.8 +all: conf mconf nconf
     3.9 +	@true   # Just be silent, you fscking son of a fscking beach...
    3.10 +
    3.11 +# Build flags
    3.12 +CFLAGS = -DCONFIG_=\"CT_\" -DPACKAGE="\"crosstool-NG $(VERSION)\""
    3.13 +LDFLAGS =
    3.14 +
    3.15 +# Compiler flags to use gettext
    3.16 +ifeq ($(gettext),)
    3.17 +INTL_CFLAGS = -DKBUILD_NO_NLS
    3.18 +endif
    3.19 +
    3.20 +# Compiler and linker flags to use ncurses
    3.21 +NCURSES_CFLAGS = -DCURSES_LOC="\"$(curses_hdr)\""
    3.22 +NCURSES_LDFLAGS = $(LIBS)
    3.23 +
    3.24 +# Common source files
    3.25 +COMMON_SRC = zconf.tab.c
    3.26 +COMMON_OBJ = $(patsubst %.c,%.o,$(COMMON_SRC))
    3.27 +COMMON_DEP = $(patsubst %.o,%.dep,$(COMMON_OBJ))
    3.28 +$(COMMON_OBJ) $(COMMON_DEP): CFLAGS += $(INTL_CFLAGS)
    3.29 +
    3.30 +# lxdialog source files
    3.31 +LX_SRC = $(wildcard lxdialog/*.c)
    3.32 +LX_OBJ = $(patsubst %.c,%.o,$(LX_SRC))
    3.33 +LX_DEP = $(patsubst %.o,%.dep,$(LX_OBJ))
    3.34 +$(LX_OBJ) $(LX_DEP): CFLAGS += $(NCURSES_CFLAGS) $(INTL_CFLAGS)
    3.35 +
    3.36 +# What's needed to build 'conf'
    3.37 +conf_SRC = conf.c
    3.38 +conf_OBJ = $(patsubst %.c,%.o,$(conf_SRC))
    3.39 +conf_DEP = $(patsubst %.o,%.dep,$(conf_OBJ))
    3.40 +$(conf_OBJ) $(conf_DEP): CFLAGS += $(INTL_CFLAGS)
    3.41 +
    3.42 +# What's needed to build 'mconf'
    3.43 +mconf_SRC = mconf.c
    3.44 +mconf_OBJ = $(patsubst %.c,%.o,$(mconf_SRC))
    3.45 +mconf_DEP = $(patsubst %.c,%.dep,$(mconf_SRC))
    3.46 +$(mconf_OBJ) $(mconf_DEP): CFLAGS += $(NCURSES_CFLAGS) $(INTL_CFLAGS)
    3.47 +mconf: LDFLAGS += $(NCURSES_LDFLAGS)
    3.48 +
    3.49 +# What's needed to build 'nconf'
    3.50 +nconf_SRC = nconf.c nconf.gui.c
    3.51 +nconf_OBJ = $(patsubst %.c,%.o,$(nconf_SRC))
    3.52 +nconf_DEP = $(patsubst %.c,%.dep,$(nconf_SRC))
    3.53 +$(nconf_OBJ) $(nconf_DEP): CFLAGS += $(INTL_CFLAGS)
    3.54 +nconf: LDFLAGS += -lmenu -lpanel -lncurses
    3.55 +
    3.56 +# Under Cygwin, we need to auto-import some libs (which ones, exactly?)
    3.57 +# for mconf and nconf to lin properly.
    3.58 +ifeq ($(shell uname -o 2>/dev/null || echo unknown),Cygwin)
    3.59 +mconf: LDFLAGS += -Wl,--enable-auto-import
    3.60 +nconf: LDFLAGS += -Wl,--enable-auto-import
    3.61 +endif
    3.62 +
    3.63 +# These are generated files:
    3.64 +ALL_OBJS = $(sort $(COMMON_OBJ) $(LX_OBJ) $(conf_OBJ) $(mconf_OBJ) $(nconf_OBJ))
    3.65 +ALL_DEPS = $(sort $(COMMON_DEP) $(LX_DEP) $(conf_DEP) $(mconf_DEP) $(nconf_DEP))
    3.66 +
    3.67 +# Cheesy auto-dependencies
    3.68 +DEPS = $(COMMON_DEP)
    3.69 +DEPS += $(conf_DEP)
    3.70 +DEPS += $(mconf_DEP) $(LX_DEP)
    3.71 +DEPS += $(nconf_DEP)
    3.72 +-include $(DEPS)
    3.73 +
    3.74 +# Build the dependency for C files
    3.75 +%.dep: %.c
    3.76 +	@echo "  DEP    '$@'"
    3.77 +	@$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MM $< |$(sed) -r -e 's|([^:]+.o)( *:+)|$(<:.c=.o) $@\2|;' >$@
    3.78 +
    3.79 +# Build C files
    3.80 +%.o: %.c
    3.81 +	@echo "  CC     '$@'"
    3.82 +	@$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $<
    3.83 +
    3.84 +# Actual link
    3.85 +mconf: $(COMMON_OBJ) $(LX_OBJ) $(mconf_OBJ)
    3.86 +	@echo "  LD     '$@'"
    3.87 +	@$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
    3.88 +
    3.89 +nconf: $(COMMON_OBJ) $(nconf_OBJ)
    3.90 +	@echo "  LD     '$@'"
    3.91 +	@$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
    3.92 +
    3.93 +conf: $(COMMON_OBJ) $(conf_OBJ)
    3.94 +	@echo "  LD     '$@'"
    3.95 +	@$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
    3.96 +
    3.97 +#-----------------------------------------------------------
    3.98 +# Cleaning up the mess...
    3.99 +
   3.100 +clean:
   3.101 +	@echo "  RM     'kconfig'"
   3.102 +	@rm -f conf mconf nconf $(ALL_OBJS) $(ALL_DEPS)
     4.1 --- a/kconfig/kconfig.mk	Mon Nov 07 22:28:40 2011 +0100
     4.2 +++ b/kconfig/kconfig.mk	Sat Jan 14 18:22:06 2012 +0100
     4.3 @@ -2,9 +2,6 @@
     4.4  # crosstool-NG configuration targets
     4.5  # These targets are used from top-level makefile
     4.6  
     4.7 -# The place where the kconfig stuff lies
     4.8 -obj = kconfig
     4.9 -
    4.10  #-----------------------------------------------------------
    4.11  # The configurators rules
    4.12  
    4.13 @@ -13,17 +10,21 @@
    4.14  
    4.15  $(configurators): config_files
    4.16  
    4.17 -menuconfig: $(obj)/mconf
    4.18 +CONF  := $(CT_LIB_DIR)/kconfig/conf
    4.19 +MCONF := $(CT_LIB_DIR)/kconfig/mconf
    4.20 +NCONF := $(CT_LIB_DIR)/kconfig/nconf
    4.21 +
    4.22 +menuconfig:
    4.23  	@$(ECHO) "  CONF  $(KCONFIG_TOP)"
    4.24 -	$(SILENT)$< $(KCONFIG_TOP)
    4.25 +	$(SILENT)$(MCONF) $(KCONFIG_TOP)
    4.26  
    4.27 -nconfig: $(obj)/nconf
    4.28 +nconfig:
    4.29  	@$(ECHO) "  CONF  $(KCONFIG_TOP)"
    4.30 -	$(SILENT)$< $(KCONFIG_TOP)
    4.31 +	$(SILENT)$(NCONF) $(KCONFIG_TOP)
    4.32  
    4.33 -oldconfig: $(obj)/conf .config
    4.34 +oldconfig: .config
    4.35  	@$(ECHO) "  CONF  $(KCONFIG_TOP)"
    4.36 -	$(SILENT)$< --silent$@ $(KCONFIG_TOP)
    4.37 +	$(SILENT)$(CONF) --silent$@ $(KCONFIG_TOP)
    4.38  
    4.39  # Always be silent, the stdout an be >.config
    4.40  extractconfig:
    4.41 @@ -48,155 +49,3 @@
    4.42  	@echo  '  oldconfig          - Update current config using a provided .config as base'
    4.43  	@echo  '  extractconfig      - Extract to stdout the configuration items from a'
    4.44  	@echo  '                       build.log file piped to stdin'
    4.45 -
    4.46 -#-----------------------------------------------------------
    4.47 -# Hmmm! Cheesy build!
    4.48 -# Or: where I can unveil my make-fu... :-]
    4.49 -
    4.50 -# Oh! Files not here are there, in fact! :-)
    4.51 -vpath %.c $(CT_LIB_DIR)
    4.52 -vpath %.h $(CT_LIB_DIR)
    4.53 -
    4.54 -# What is the compiler?
    4.55 -HOST_CC ?= gcc -funsigned-char
    4.56 -HOST_LD ?= gcc
    4.57 -
    4.58 -# Helpers
    4.59 -check_gettext = $(CT_LIB_DIR)/kconfig/check.sh
    4.60 -check_lxdialog = $(CT_LIB_DIR)/kconfig/lxdialog/check-lxdialog.sh
    4.61 -
    4.62 -# Build flags
    4.63 -CFLAGS = -DCONFIG_=\"CT_\" -DPACKAGE="\"crosstool-NG $(CT_VERSION)\""
    4.64 -LDFLAGS =
    4.65 -
    4.66 -# Compiler flags to use gettext
    4.67 -INTL_CFLAGS = $(shell $(SHELL) $(check_gettext) $(HOST_CC) $(EXTRA_CFLAGS))
    4.68 -
    4.69 -# Compiler and linker flags to use ncurses
    4.70 -NCURSES_CFLAGS = $(shell $(SHELL) $(check_lxdialog) -ccflags)
    4.71 -NCURSES_LDFLAGS = $(shell $(SHELL) $(check_lxdialog) -ldflags $(HOST_CC))
    4.72 -
    4.73 -# Check that we have the required ncurses stuff installed for lxdialog (menuconfig)
    4.74 -dochecklxdialog:
    4.75 -	$(SILENT)$(SHELL) $(check_lxdialog) -check $(HOST_CC) $(NCURSES_CFLAGS) $(NCURSES_LDFLAGS)
    4.76 -
    4.77 -# Common source files
    4.78 -COMMON_SRC = kconfig/zconf.tab.c
    4.79 -COMMON_OBJ = $(patsubst %.c,%.o,$(COMMON_SRC))
    4.80 -COMMON_DEP = $(patsubst %.o,%.dep,$(COMMON_OBJ))
    4.81 -$(COMMON_OBJ) $(COMMON_DEP): CFLAGS += $(INTL_CFLAGS)
    4.82 -
    4.83 -# lxdialog source files
    4.84 -LX_SRC = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/kconfig/lxdialog/*.c))
    4.85 -LX_OBJ = $(patsubst %.c,%.o,$(LX_SRC))
    4.86 -LX_DEP = $(patsubst %.o,%.dep,$(LX_OBJ))
    4.87 -$(LX_OBJ) $(LX_DEP): CFLAGS += $(NCURSES_CFLAGS) $(INTL_CFLAGS)
    4.88 -
    4.89 -# What's needed to build 'conf'
    4.90 -conf_SRC = kconfig/conf.c
    4.91 -conf_OBJ = $(patsubst %.c,%.o,$(conf_SRC))
    4.92 -conf_DEP = $(patsubst %.o,%.dep,$(conf_OBJ))
    4.93 -$(conf_OBJ) $(conf_DEP): CFLAGS += $(INTL_CFLAGS)
    4.94 -
    4.95 -# What's needed to build 'mconf'
    4.96 -mconf_SRC = kconfig/mconf.c
    4.97 -mconf_OBJ = $(patsubst %.c,%.o,$(mconf_SRC))
    4.98 -mconf_DEP = $(patsubst %.c,%.dep,$(mconf_SRC))
    4.99 -$(mconf_OBJ) $(mconf_DEP): CFLAGS += $(NCURSES_CFLAGS) $(INTL_CFLAGS)
   4.100 -$(obj)/mconf: LDFLAGS += $(NCURSES_LDFLAGS)
   4.101 -
   4.102 -# What's needed to build 'nconf'
   4.103 -nconf_SRC = kconfig/nconf.c kconfig/nconf.gui.c
   4.104 -nconf_OBJ = $(patsubst %.c,%.o,$(nconf_SRC))
   4.105 -nconf_DEP = $(patsubst %.c,%.dep,$(nconf_SRC))
   4.106 -$(nconf_OBJ) $(nconf_DEP): CFLAGS += $(INTL_CFLAGS)
   4.107 -$(obj)/nconf: LDFLAGS += -lmenu -lpanel -lncurses
   4.108 -
   4.109 -# Under Cygwin, we need to auto-import some libs (which ones, exactly?)
   4.110 -# for mconf and nconf to lin properly.
   4.111 -ifeq ($(shell uname -o 2>/dev/null || echo unknown),Cygwin)
   4.112 -$(obj)/mconf: LDFLAGS += -Wl,--enable-auto-import
   4.113 -$(obj)/nconf: LDFLAGS += -Wl,--enable-auto-import
   4.114 -endif
   4.115 -
   4.116 -# These are generated files:
   4.117 -ALL_OBJS = $(sort $(COMMON_OBJ) $(LX_OBJ) $(conf_OBJ) $(mconf_OBJ) $(nconf_OBJ))
   4.118 -ALL_DEPS = $(sort $(COMMON_DEP) $(LX_DEP) $(conf_DEP) $(mconf_DEP) $(nconf_DEP))
   4.119 -
   4.120 -# Cheesy auto-dependencies
   4.121 -# Only parse the following if a configurator was called, to avoid building
   4.122 -# dependencies when not needed (eg. list-steps, list-samples...)
   4.123 -# We must be careful what we enclose, because we need some of the variable
   4.124 -# definitions for clean (and distclean) at least.
   4.125 -# Just protecting the "-include $(DEPS)" line should be sufficient.
   4.126 -# And in case we want menuconfig, we have to check that lxdialog
   4.127 -# can find a curses lib.
   4.128 -
   4.129 -ifneq ($(strip $(MAKECMDGOALS)),)
   4.130 -ifneq ($(strip $(filter $(configurators),$(MAKECMDGOALS))),)
   4.131 -
   4.132 -DEPS = $(COMMON_DEP)
   4.133 -ifneq ($(strip $(filter oldconfig,$(MAKECMDGOALS))),)
   4.134 -DEPS += $(conf_DEP)
   4.135 -endif
   4.136 -ifneq ($(strip $(filter menuconfig,$(MAKECMDGOALS))),)
   4.137 -DEPS += $(mconf_DEP) $(LX_DEP)
   4.138 -$(COMMON_OBJ) $(COMMON_DEP): |dochecklxdialog
   4.139 -$(LX_OBJ) $(LX_DEP): |dochecklxdialog
   4.140 -$(mconf_OBJ) $(mconf_DEP): |dochecklxdialog
   4.141 -endif
   4.142 -ifneq ($(strip $(filter nconfig,$(MAKECMDGOALS))),)
   4.143 -DEPS += $(nconf_DEP)
   4.144 -endif
   4.145 -
   4.146 --include $(DEPS)
   4.147 -
   4.148 -endif # MAKECMDGOALS contains a configurator rule
   4.149 -endif # MAKECMDGOALS != ""
   4.150 -
   4.151 -# Each .o or .dep *can not* directly depend on kconfig/, because kconfig can
   4.152 -# be touched during the build (who's touching it, btw?) so each .o or .dep
   4.153 -# would be re-built when it should not be.
   4.154 -# So manually check for presence of $(obj) (ie. kconfig), and only mkdir
   4.155 -# if needed. After all, that's not so bad...
   4.156 -# mkdir $(obj)/lxdialog, because we need it, and incidentally, that
   4.157 -# also creates $(obj).
   4.158 -define check_kconfig_dir
   4.159 -	$(SILENT)if [ ! -d $(obj)/lxdialog ]; then  \
   4.160 -	   $(ECHO) "  MKDIR $(obj)";           \
   4.161 -	   mkdir -p $(obj)/lxdialog;        \
   4.162 -	 fi
   4.163 -endef
   4.164 -
   4.165 -# Build the dependency for C files
   4.166 -%.dep: %.c $(CT_LIB_DIR)/kconfig/kconfig.mk
   4.167 -	$(check_kconfig_dir)
   4.168 -	@$(ECHO) "  DEP   $@"
   4.169 -	$(SILENT)$(HOST_CC) $(CFLAGS) $(EXTRA_CFLAGS) -MM $< |$(sed) -r -e 's|([^:]+.o)( *:+)|$(<:.c=.o) $@\2|;' >$@
   4.170 -
   4.171 -# Build C files
   4.172 -%.o: %.c $(CT_LIB_DIR)/kconfig/kconfig.mk
   4.173 -	$(check_kconfig_dir)
   4.174 -	@$(ECHO) "  CC    $@"
   4.175 -	$(SILENT)$(HOST_CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $<
   4.176 -
   4.177 -# Actual link
   4.178 -$(obj)/mconf: $(COMMON_OBJ) $(LX_OBJ) $(mconf_OBJ)
   4.179 -	@$(ECHO) '  LD    $@'
   4.180 -	$(SILENT)$(HOST_LD) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
   4.181 -
   4.182 -$(obj)/nconf: $(COMMON_OBJ) $(nconf_OBJ)
   4.183 -	@$(ECHO) '  LD    $@'
   4.184 -	$(SILENT)$(HOST_LD) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
   4.185 -
   4.186 -$(obj)/conf: $(COMMON_OBJ) $(conf_OBJ)
   4.187 -	@$(ECHO) '  LD    $@'
   4.188 -	$(SILENT)$(HOST_LD) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
   4.189 -
   4.190 -#-----------------------------------------------------------
   4.191 -# Cleaning up the mess...
   4.192 -
   4.193 -clean::
   4.194 -	@$(ECHO) "  CLEAN kconfig"
   4.195 -	$(SILENT)rm -f kconfig/{,m,n}conf{,.exe} $(ALL_OBJS) $(ALL_DEPS)
   4.196 -	$(SILENT)rmdir --ignore-fail-on-non-empty kconfig{/lxdialog,} 2>/dev/null || true