kconfig/Makefile
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue May 01 16:32:52 2007 +0000 (2007-05-01)
changeset 54 7498a8d4b6e5
parent 19 d80e6dedcc13
child 63 89b41dbffe8d
permissions -rw-r--r--
Remove the superfluous _config suffix to preconfigured targets (in "make help").
yann@1
     1
# ===========================================================================
yann@1
     2
# crosstool-ng configuration targets
yann@1
     3
# These targets are used from top-level makefile
yann@1
     4
yann@1
     5
KCONFIG_TOP = config/config.in
yann@1
     6
obj = ./kconfig
yann@1
     7
PHONY += clean help oldconfig menuconfig config silentoldconfig \
yann@1
     8
	randconfig allyesconfig allnoconfig allmodconfig defconfig
yann@1
     9
yann@19
    10
# Darwin (MacOS-X) does not have proper libintl support
yann@19
    11
ifeq ($(shell uname -s),Darwin)
yann@19
    12
KBUILD_NO_NLS:=1
yann@19
    13
endif
yann@19
    14
yann@18
    15
ifneq ($(KBUILD_NO_NLS),)
yann@18
    16
CFLAGS += -DKBUILD_NO_NLS
yann@18
    17
endif
yann@18
    18
yann@1
    19
menuconfig: $(obj)/mconf
yann@1
    20
	@$< $(KCONFIG_TOP)
yann@1
    21
yann@1
    22
config: $(obj)/conf
yann@1
    23
	@$< $(KCONFIG_TOP)
yann@1
    24
yann@1
    25
oldconfig: $(obj)/conf
yann@1
    26
	@$< -s $(KCONFIG_TOP)
yann@1
    27
yann@1
    28
# Build a list of all available samples
yann@1
    29
SAMPLES = $(patsubst $(CT_TOP_DIR)/samples/%,%,$(filter-out %Makefile,$(wildcard $(CT_TOP_DIR)/samples/*)))
yann@54
    30
.PHONY: $(SAMPLES)
yann@54
    31
$(SAMPLES):
yann@54
    32
	@cp "$(CT_TOP_DIR)/samples/$(@)/crosstool.config" "$(CT_TOP_DIR)/.config"
yann@1
    33
	@$(MAKE) oldconfig
yann@1
    34
yann@1
    35
# Help text used by make help
yann@1
    36
help::
yann@1
    37
	@echo  'General purpose configuration targets:'
yann@19
    38
	@echo  '  config         - Update current config using a line-oriented program'
yann@19
    39
	@echo  '  menuconfig     - Update current config using a menu based program'
yann@19
    40
	@echo  '  oldconfig      - Update current config using a provided .config as base'
yann@1
    41
	@echo
yann@54
    42
	@echo  'Preconfigured targets:'
yann@54
    43
	@for s in $(SAMPLES); do   \
yann@1
    44
	    echo  "  $${s}"; \
yann@1
    45
	 done
yann@1
    46
	@echo  ''
yann@1
    47
yann@1
    48
# Cheesy build
yann@1
    49
yann@1
    50
SHIPPED = kconfig/zconf.tab.c kconfig/lex.zconf.c kconfig/zconf.hash.c
yann@1
    51
yann@1
    52
%.c: %.c_shipped
yann@1
    53
	@ln -s $(notdir $<) $@
yann@1
    54
yann@1
    55
kconfig/mconf: $(SHIPPED) kconfig/mconf.c
yann@18
    56
	@$(HOST_CC) $(CFLAGS) -o $@ kconfig/{mconf.c,zconf.tab.c,lxdialog/*.c} \
yann@1
    57
		-lcurses "-DCURSES_LOC=<ncurses.h>"
yann@1
    58
yann@1
    59
kconfig/conf: $(SHIPPED) kconfig/conf.c
yann@18
    60
	@$(HOST_CC) $(CFLAGS) -o $@ kconfig/{conf.c,zconf.tab.c}
yann@1
    61
yann@1
    62
clean::
yann@1
    63
	@rm -f $(wildcard kconfig/*zconf*.c) kconfig/{conf,mconf}