config/config.mk
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Sun May 11 23:43:52 2014 +0200 (2014-05-11)
changeset 3320 78af1c99bc6d
parent 3123 6a5946fbc728
child 3325 069f43a215cc
permissions -rw-r--r--
scripts/functions: add target_endian_le and target_endian_be

We currently define target_endian_el and target_endian_eb to be the
tuple extension depending on endianness, defined to be respectively
'el' or 'eb' according to the endianness.

Some architecture do not use 'el' or 'eb', but use 'le' or 'be'.

Provide that as well, as two new variables: target_endian_le and
target_endian_be.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Cody P Schafer <dev@codyps.com>
yann@1
     1
# ===========================================================================
yann@945
     2
# crosstool-NG genererated config files
yann@1
     3
# These targets are used from top-level makefile
yann@1
     4
yann@926
     5
#-----------------------------------------------------------
yann@1001
     6
# List all config files, wether sourced or generated
yann@97
     7
yann@945
     8
# The top-level config file to be used be configurators
yann@2981
     9
# We need it to savedefconfig in scripts/saveSample.sh
yann@2981
    10
export KCONFIG_TOP = config/config.in
yann@945
    11
yann@926
    12
# Build the list of all source config files
yann@1976
    13
STATIC_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(shell find $(CT_LIB_DIR)/config -type f \( -name '*.in' -o -name '*.in.2' \) 2>/dev/null))
yann@926
    14
# ... and how to access them:
yann@926
    15
$(STATIC_CONFIG_FILES): config
yann@88
    16
yann@926
    17
# Build a list of per-component-type source config files
yann@3124
    18
ARCH_CONFIG_FILES       = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/arch/*.in))
yann@3124
    19
ARCH_CONFIG_FILES_2     = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/arch/*.in.2))
yann@3124
    20
KERNEL_CONFIG_FILES     = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/kernel/*.in))
yann@3124
    21
KERNEL_CONFIG_FILES_2   = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/kernel/*.in.2))
yann@3124
    22
CC_CONFIG_FILES         = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/cc/*.in))
yann@3124
    23
CC_CONFIG_FILES_2       = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/cc/*.in.2))
yann@3124
    24
BINUTILS_CONFIG_FILES   = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/binutils/*.in))
diorcet@3123
    25
BINUTILS_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/binutils/*.in.2))
yann@3124
    26
LIBC_CONFIG_FILES       = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/libc/*.in))
yann@3124
    27
LIBC_CONFIG_FILES_2     = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/libc/*.in.2))
yann@3124
    28
DEBUG_CONFIG_FILES      = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/debug/*.in))
yann@182
    29
yann@926
    30
# Build the list of generated config files
yann@926
    31
GEN_CONFIG_FILES = config.gen/arch.in     \
yann@926
    32
                   config.gen/kernel.in   \
yann@926
    33
                   config.gen/cc.in       \
diorcet@3123
    34
                   config.gen/binutils.in \
yann@926
    35
                   config.gen/libc.in     \
yann@926
    36
                   config.gen/debug.in
yann@926
    37
# ... and how to access them:
yann@2537
    38
# Generated files depends on the gen_in_frags script because it has the
yann@2537
    39
# functions needed to build the genrated files, and thus they might need
yann@2537
    40
# re-generation if it changes.
yann@2537
    41
# They also depends on config.mk (this file) because it has the dependency
yann@2537
    42
# rules, and thus they might need re-generation if the deps change.
yann@2537
    43
$(GEN_CONFIG_FILES): config.gen                             \
yann@2537
    44
                     $(CT_LIB_DIR)/scripts/gen_in_frags.sh  \
yann@945
    45
                     $(CT_LIB_DIR)/config/config.mk
yann@182
    46
yann@945
    47
# Helper entry for the configurators
yann@945
    48
PHONY += config_files
yann@945
    49
config_files: $(STATIC_CONFIG_FILES) $(GEN_CONFIG_FILES)
yann@182
    50
yann@926
    51
# Where to access to the source config files from
yann@926
    52
config:
yann@940
    53
	@$(ECHO) "  LN    config"
yann@940
    54
	$(SILENT)ln -s $(CT_LIB_DIR)/config config
yann@926
    55
yann@926
    56
# Where to store the generated config files into
yann@926
    57
config.gen:
yann@940
    58
	@$(ECHO) "  MKDIR config.gen"
yann@940
    59
	$(SILENT)mkdir -p config.gen
yann@926
    60
yann@926
    61
#-----------------------------------------------------------
yann@926
    62
# Build list of per-component-type items to easily build generated files
yann@926
    63
yann@3124
    64
ARCHS     = $(patsubst config/arch/%.in,%,$(ARCH_CONFIG_FILES))
yann@3124
    65
KERNELS   = $(patsubst config/kernel/%.in,%,$(KERNEL_CONFIG_FILES))
yann@3124
    66
CCS       = $(patsubst config/cc/%.in,%,$(CC_CONFIG_FILES))
diorcet@3123
    67
BINUTILSS = $(patsubst config/binutils/%.in,%,$(BINUTILS_CONFIG_FILES))
yann@3124
    68
LIBCS     = $(patsubst config/libc/%.in,%,$(LIBC_CONFIG_FILES))
yann@3124
    69
DEBUGS    = $(patsubst config/debug/%.in,%,$(DEBUG_CONFIG_FILES))
yann@926
    70
yann@926
    71
#-----------------------------------------------------------
yann@926
    72
# The rules for the generated config files
yann@916
    73
yann@1976
    74
# WARNING! If a .in file disapears between two runs, that will NOT be detected!
yann@1976
    75
yann@1976
    76
config.gen/arch.in: $(ARCH_CONFIG_FILES) $(ARCH_CONFIG_FILES_2)
yann@2537
    77
	@$(ECHO) '  IN    $(@)'
yann@2537
    78
	$(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "Target Architecture" "ARCH" "config/arch" "Y" $(ARCHS)
yann@861
    79
yann@1976
    80
config.gen/kernel.in: $(KERNEL_CONFIG_FILES) $(KERNEL_CONFIG_FILES_2)
yann@2537
    81
	@$(ECHO) '  IN    $(@)'
yann@2537
    82
	$(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "Target OS" "KERNEL" "config/kernel" "Y" $(KERNELS)
yann@182
    83
yann@1976
    84
config.gen/cc.in: $(CC_CONFIG_FILES) $(CC_CONFIG_FILES_2)
yann@2537
    85
	@$(ECHO) '  IN    $(@)'
yann@2537
    86
	$(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "C compiler" "CC" "config/cc" "N" $(CCS)
yann@926
    87
diorcet@3123
    88
config.gen/binutils.in: $(CC_BINUTILS_FILES) $(CC_BINUTILS_FILES_2)
diorcet@3123
    89
	@$(ECHO) '  IN    $(@)'
diorcet@3123
    90
	$(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "Binutils" "BINUTILS" "config/binutils" "N" $(BINUTILSS)
diorcet@3123
    91
yann@1976
    92
config.gen/libc.in: $(LIBC_CONFIG_FILES) $(LIBC_CONFIG_FILES_2)
yann@2537
    93
	@$(ECHO) '  IN    $(@)'
yann@2537
    94
	$(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "C library" "LIBC" "config/libc" "Y" $(LIBCS)
yann@926
    95
yann@926
    96
config.gen/debug.in: $(DEBUG_CONFIG_FILES)
yann@2537
    97
	@$(ECHO) '  IN    $(@)'
yann@2537
    98
	$(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh menu "$@" "Debug facilities" "DEBUG" "config/debug" $(DEBUGS)
yann@926
    99
yann@926
   100
#-----------------------------------------------------------
yann@926
   101
# Cleaning up the mess...
yann@926
   102
yann@1
   103
clean::
yann@940
   104
	@$(ECHO) "  CLEAN config"
yann@940
   105
	$(SILENT)rm -f config 2>/dev/null || true
yann@940
   106
	@$(ECHO) "  CLEAN config.gen"
yann@940
   107
	$(SILENT)rm -rf config.gen