scripts/functions: Fix CT_ExtractGit function.
Change CT_ExtractGit so that it clones the repository, instead of just
symlinking it. After cloning, any given ref is checked out, or if no
ref is given, the HEAD of the repository is checked out.
This makes CT_Extract behave similar for git repositories as it does
for tarballs, so that it for example can be used for passing glibc-ports
as a git repository.
Signed-off-by: "Esben Haabendal" <esben.haabendal@prevas.dk>
[yann.morin.1998@anciens.enib.fr: fix incomplete var rename]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
1 # ===========================================================================
2 # crosstool-NG genererated config files
3 # These targets are used from top-level makefile
5 #-----------------------------------------------------------
6 # List all config files, wether sourced or generated
8 # The top-level config file to be used be configurators
9 KCONFIG_TOP = config/config.in
11 # Build the list of all source config files
12 STATIC_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(shell find $(CT_LIB_DIR)/config -type f \( -name '*.in' -o -name '*.in.2' \) 2>/dev/null))
13 # ... and how to access them:
14 $(STATIC_CONFIG_FILES): config
16 # Build a list of per-component-type source config files
17 ARCH_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/arch/*.in))
18 ARCH_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/arch/*.in.2))
19 KERNEL_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/kernel/*.in))
20 KERNEL_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/kernel/*.in.2))
21 CC_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/cc/*.in))
22 CC_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/cc/*.in.2))
23 LIBC_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/libc/*.in))
24 LIBC_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/libc/*.in.2))
25 DEBUG_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/debug/*.in))
27 # Build the list of generated config files
28 GEN_CONFIG_FILES = config.gen/arch.in \
29 config.gen/kernel.in \
33 # ... and how to access them:
34 # Generated files depends on the gen_in_frags script because it has the
35 # functions needed to build the genrated files, and thus they might need
36 # re-generation if it changes.
37 # They also depends on config.mk (this file) because it has the dependency
38 # rules, and thus they might need re-generation if the deps change.
39 $(GEN_CONFIG_FILES): config.gen \
40 $(CT_LIB_DIR)/scripts/gen_in_frags.sh \
41 $(CT_LIB_DIR)/config/config.mk
43 # Helper entry for the configurators
45 config_files: $(STATIC_CONFIG_FILES) $(GEN_CONFIG_FILES)
47 # Where to access to the source config files from
50 $(SILENT)ln -s $(CT_LIB_DIR)/config config
52 # Where to store the generated config files into
54 @$(ECHO) " MKDIR config.gen"
55 $(SILENT)mkdir -p config.gen
57 #-----------------------------------------------------------
58 # Build list of per-component-type items to easily build generated files
60 ARCHS = $(patsubst config/arch/%.in,%,$(ARCH_CONFIG_FILES))
61 KERNELS = $(patsubst config/kernel/%.in,%,$(KERNEL_CONFIG_FILES))
62 CCS = $(patsubst config/cc/%.in,%,$(CC_CONFIG_FILES))
63 LIBCS = $(patsubst config/libc/%.in,%,$(LIBC_CONFIG_FILES))
64 DEBUGS = $(patsubst config/debug/%.in,%,$(DEBUG_CONFIG_FILES))
66 #-----------------------------------------------------------
67 # The rules for the generated config files
69 # WARNING! If a .in file disapears between two runs, that will NOT be detected!
71 config.gen/arch.in: $(ARCH_CONFIG_FILES) $(ARCH_CONFIG_FILES_2)
73 $(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "Target Architecture" "ARCH" "config/arch" "Y" $(ARCHS)
75 config.gen/kernel.in: $(KERNEL_CONFIG_FILES) $(KERNEL_CONFIG_FILES_2)
77 $(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "Target OS" "KERNEL" "config/kernel" "Y" $(KERNELS)
79 config.gen/cc.in: $(CC_CONFIG_FILES) $(CC_CONFIG_FILES_2)
81 $(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "C compiler" "CC" "config/cc" "N" $(CCS)
83 config.gen/libc.in: $(LIBC_CONFIG_FILES) $(LIBC_CONFIG_FILES_2)
85 $(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "C library" "LIBC" "config/libc" "Y" $(LIBCS)
87 config.gen/debug.in: $(DEBUG_CONFIG_FILES)
89 $(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh menu "$@" "Debug facilities" "DEBUG" "config/debug" $(DEBUGS)
91 #-----------------------------------------------------------
92 # Cleaning up the mess...
95 @$(ECHO) " CLEAN config"
96 $(SILENT)rm -f config 2>/dev/null || true
97 @$(ECHO) " CLEAN config.gen"
98 $(SILENT)rm -rf config.gen