yann@1: # =========================================================================== yann@1: # crosstool-ng configuration targets yann@1: # These targets are used from top-level makefile yann@1: yann@1: KCONFIG_TOP = config/config.in yann@1: obj = ./kconfig yann@1: PHONY += clean help oldconfig menuconfig config silentoldconfig \ yann@1: randconfig allyesconfig allnoconfig allmodconfig defconfig yann@1: yann@19: # Darwin (MacOS-X) does not have proper libintl support yann@19: ifeq ($(shell uname -s),Darwin) yann@19: KBUILD_NO_NLS:=1 yann@19: endif yann@19: yann@18: ifneq ($(KBUILD_NO_NLS),) yann@18: CFLAGS += -DKBUILD_NO_NLS yann@18: endif yann@18: yann@1: menuconfig: $(obj)/mconf yann@1: @$< $(KCONFIG_TOP) yann@1: yann@1: config: $(obj)/conf yann@1: @$< $(KCONFIG_TOP) yann@1: yann@1: oldconfig: $(obj)/conf yann@1: @$< -s $(KCONFIG_TOP) yann@1: yann@1: # Build a list of all available samples yann@1: SAMPLES = $(patsubst $(CT_TOP_DIR)/samples/%,%,$(filter-out %Makefile,$(wildcard $(CT_TOP_DIR)/samples/*))) yann@1: SAMPLES_CONFIG = $(patsubst %,%_config,$(SAMPLES)) yann@1: .PHONY: $(SAMPLES_CONFIG) yann@1: $(SAMPLES_CONFIG): yann@1: @cp "$(CT_TOP_DIR)/samples/$(patsubst %_config,%,$@)/crosstool.config" "$(CT_TOP_DIR)/.config" yann@1: @$(MAKE) oldconfig yann@1: yann@1: # Help text used by make help yann@1: help:: yann@1: @echo 'General purpose configuration targets:' yann@19: @echo ' config - Update current config using a line-oriented program' yann@19: @echo ' menuconfig - Update current config using a menu based program' yann@19: @echo ' oldconfig - Update current config using a provided .config as base' yann@1: @echo yann@1: @echo 'Preconfigured configuration targets:' yann@1: @for s in $(SAMPLES_CONFIG); do \ yann@1: echo " $${s}"; \ yann@1: done yann@1: @echo '' yann@1: yann@1: # Cheesy build yann@1: yann@1: SHIPPED = kconfig/zconf.tab.c kconfig/lex.zconf.c kconfig/zconf.hash.c yann@1: yann@1: %.c: %.c_shipped yann@1: @ln -s $(notdir $<) $@ yann@1: yann@1: kconfig/mconf: $(SHIPPED) kconfig/mconf.c yann@18: @$(HOST_CC) $(CFLAGS) -o $@ kconfig/{mconf.c,zconf.tab.c,lxdialog/*.c} \ yann@1: -lcurses "-DCURSES_LOC=" yann@1: yann@1: kconfig/conf: $(SHIPPED) kconfig/conf.c yann@18: @$(HOST_CC) $(CFLAGS) -o $@ kconfig/{conf.c,zconf.tab.c} yann@1: yann@1: clean:: yann@1: @rm -f $(wildcard kconfig/*zconf*.c) kconfig/{conf,mconf}