kconfig/Makefile
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
child 2 687f86f2a01c
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
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@1
    10
menuconfig: $(obj)/mconf
yann@1
    11
	@$< $(KCONFIG_TOP)
yann@1
    12
yann@1
    13
config: $(obj)/conf
yann@1
    14
	@$< $(KCONFIG_TOP)
yann@1
    15
yann@1
    16
oldconfig: $(obj)/conf
yann@1
    17
	@$< -s $(KCONFIG_TOP)
yann@1
    18
yann@1
    19
randconfig: $(obj)/conf
yann@1
    20
	@$< -r $(KCONFIG_TOP)
yann@1
    21
yann@1
    22
allyesconfig: $(obj)/conf
yann@1
    23
	@$< -y $(KCONFIG_TOP)
yann@1
    24
yann@1
    25
allnoconfig: $(obj)/conf
yann@1
    26
	@$< -n $(KCONFIG_TOP)
yann@1
    27
yann@1
    28
defconfig: $(obj)/conf
yann@1
    29
	@$< -d $(KCONFIG_TOP)
yann@1
    30
yann@1
    31
# Build a list of all available samples
yann@1
    32
SAMPLES = $(patsubst $(CT_TOP_DIR)/samples/%,%,$(filter-out %Makefile,$(wildcard $(CT_TOP_DIR)/samples/*)))
yann@1
    33
SAMPLES_CONFIG = $(patsubst %,%_config,$(SAMPLES))
yann@1
    34
.PHONY: $(SAMPLES_CONFIG)
yann@1
    35
$(SAMPLES_CONFIG):
yann@1
    36
	@cp "$(CT_TOP_DIR)/samples/$(patsubst %_config,%,$@)/crosstool.config" "$(CT_TOP_DIR)/.config"
yann@1
    37
	@$(MAKE) oldconfig
yann@1
    38
yann@1
    39
# Help text used by make help
yann@1
    40
help::
yann@1
    41
	@echo  'General purpose configuration targets:'
yann@1
    42
	@echo  '  config	  - Update current config utilising a line-oriented program'
yann@1
    43
	@echo  '  menuconfig	  - Update current config utilising a menu based program'
yann@1
    44
	@echo  '  oldconfig	  - Update current config utilising a provided .config as base'
yann@1
    45
	@echo  '  randconfig	  - New config with random answer to all options'
yann@1
    46
	@echo  '  defconfig	  - New config with default answer to all options'
yann@1
    47
	@echo  '  allyesconfig	  - New config where all options are accepted with yes'
yann@1
    48
	@echo  '  allnoconfig	  - New config where all options are answered with no'
yann@1
    49
	@echo
yann@1
    50
	@echo  'Preconfigured configuration targets:'
yann@1
    51
	@for s in $(SAMPLES_CONFIG); do   \
yann@1
    52
	    echo  "  $${s}"; \
yann@1
    53
	 done
yann@1
    54
	@echo  ''
yann@1
    55
yann@1
    56
# Cheesy build
yann@1
    57
yann@1
    58
SHIPPED = kconfig/zconf.tab.c kconfig/lex.zconf.c kconfig/zconf.hash.c
yann@1
    59
yann@1
    60
%.c: %.c_shipped
yann@1
    61
	@ln -s $(notdir $<) $@
yann@1
    62
yann@1
    63
kconfig/mconf: $(SHIPPED) kconfig/mconf.c
yann@1
    64
	@$(HOST_CC) -o $@ kconfig/{mconf.c,zconf.tab.c,lxdialog/*.c} \
yann@1
    65
		-lcurses "-DCURSES_LOC=<ncurses.h>"
yann@1
    66
yann@1
    67
kconfig/conf: $(SHIPPED) kconfig/conf.c
yann@1
    68
	@$(HOST_CC) -o $@ kconfig/{conf.c,zconf.tab.c}
yann@1
    69
yann@1
    70
clean::
yann@1
    71
	@rm -f $(wildcard kconfig/*zconf*.c) kconfig/{conf,mconf}