Get rid of the tols/ directory:

- move config.guess and config.sub from tools/ into scripts/
- update the scripts and makefile fragments accordingly

 /trunk/Makefile.in        |   10     5     5     0 +++++-----
 /trunk/scripts/functions  |   16     8     8     0 ++++++++--------
 /trunk/scripts/scripts.mk |   28    13    15     0 +++++++++++++---------------
 /trunk/ct-ng.in           |    4     2     2     0 ++--
 4 files changed, 28 insertions(+), 30 deletions(-)
This commit is contained in:
Yann E. MORIN" 2008-12-16 18:12:34 +00:00
parent 7915426092
commit 65bb3ac67c
6 changed files with 28 additions and 30 deletions

View File

@ -39,7 +39,7 @@ TARGETS := bin lib doc man
build: $(patsubst %,build-%,$(TARGETS)) build: $(patsubst %,build-%,$(TARGETS))
install: real-install install: build real-install
clean: $(patsubst %,clean-%,$(TARGETS)) clean: $(patsubst %,clean-%,$(TARGETS))
@ -100,7 +100,7 @@ clean-man:
ifeq ($(strip $(LOCAL)),1) ifeq ($(strip $(LOCAL)),1)
real-install: build real-install:
@echo " CHMOD 'ct-ng'" @echo " CHMOD 'ct-ng'"
@chmod a+x ct-ng @chmod a+x ct-ng
@ -112,7 +112,7 @@ else
#-------------------------------------- #--------------------------------------
# Install rules # Install rules
real-install: build $(patsubst %,install-%,$(TARGETS)) real-install: $(patsubst %,install-%,$(TARGETS))
install-bin: $(DESTDIR)$(BINDIR) install-bin: $(DESTDIR)$(BINDIR)
@echo " INST 'ct-ng'" @echo " INST 'ct-ng'"
@ -125,11 +125,11 @@ install-bin: $(DESTDIR)$(BINDIR)
install-lib: uninstall-lib $(DESTDIR)$(LIBDIR) install-lib-main install-lib-samples install-lib: uninstall-lib $(DESTDIR)$(LIBDIR) install-lib-main install-lib-samples
install-lib-main: $(DESTDIR)$(LIBDIR) install-lib-main: $(DESTDIR)$(LIBDIR)
@for src_dir in config kconfig patches scripts tools; do \ @for src_dir in config kconfig patches scripts; do \
echo " INST '$${src_dir}/'"; \ echo " INST '$${src_dir}/'"; \
tar cf - --exclude=.svn $${src_dir} |(cd "$(DESTDIR)$(LIBDIR)"; tar xf -); \ tar cf - --exclude=.svn $${src_dir} |(cd "$(DESTDIR)$(LIBDIR)"; tar xf -); \
done done
@rm -f "$(DESTDIR)$(LIBDIR)/tools/addToolVersion.sh" @rm -f "$(DESTDIR)$(LIBDIR)/scripts/addToolVersion.sh"
@echo " INST 'steps.mk'" @echo " INST 'steps.mk'"
@install -m 644 steps.mk "$(DESTDIR)$(LIBDIR)/steps.mk" @install -m 644 steps.mk "$(DESTDIR)$(LIBDIR)/steps.mk"

View File

@ -50,7 +50,7 @@ ifeq ($(strip $(origin V)),command line)
endif # origin V endif # origin V
export V SILENT ECHO export V SILENT ECHO
.FORCE: .FORCE: $(FORCE)
.PHONY: $(PHONY) .PHONY: $(PHONY)
PHONY += all PHONY += all
all: help all: help
@ -103,7 +103,7 @@ include $(CT_LIB_DIR)/config/config.mk
include $(CT_LIB_DIR)/kconfig/kconfig.mk include $(CT_LIB_DIR)/kconfig/kconfig.mk
include $(CT_LIB_DIR)/steps.mk include $(CT_LIB_DIR)/steps.mk
include $(CT_LIB_DIR)/samples/samples.mk include $(CT_LIB_DIR)/samples/samples.mk
include $(CT_LIB_DIR)/tools/tools.mk include $(CT_LIB_DIR)/scripts/scripts.mk
help-distrib:: help-distrib::
@echo ' tarball - Build a tarball of the configured toolchain' @echo ' tarball - Build a tarball of the configured toolchain'

View File

@ -617,8 +617,8 @@ CT_ExtractAndPatch() {
if [ "${CT_OVERIDE_CONFIG_GUESS_SUB}" = "y" ]; then if [ "${CT_OVERIDE_CONFIG_GUESS_SUB}" = "y" ]; then
CT_DoLog ALL "Overiding config.guess and config.sub" CT_DoLog ALL "Overiding config.guess and config.sub"
for cfg in config_guess config_sub; do for cfg in config_guess config_sub; do
eval ${cfg}="${CT_LIB_DIR}/tools/${cfg/_/.}" eval ${cfg}="${CT_LIB_DIR}/scripts/${cfg/_/.}"
[ -e "${CT_TOP_DIR}/tools/${cfg/_/.}" ] && eval ${cfg}="${CT_TOP_DIR}/tools/${cfg/_/.}" [ -e "${CT_TOP_DIR}/scripts/${cfg/_/.}" ] && eval ${cfg}="${CT_TOP_DIR}/scripts/${cfg/_/.}"
# Can't use CT_DoExecLog because of the '{} \;' to be passed un-mangled to find # Can't use CT_DoExecLog because of the '{} \;' to be passed un-mangled to find
find . -type f -name "${cfg/_/.}" -exec cp -v "${!cfg}" {} \; |CT_DoLog ALL find . -type f -name "${cfg/_/.}" -exec cp -v "${!cfg}" {} \; |CT_DoLog ALL
done done
@ -630,18 +630,18 @@ CT_ExtractAndPatch() {
# Two wrappers to call config.(guess|sub) either from CT_TOP_DIR or CT_LIB_DIR. # Two wrappers to call config.(guess|sub) either from CT_TOP_DIR or CT_LIB_DIR.
# Those from CT_TOP_DIR, if they exist, will be be more recent than those from CT_LIB_DIR. # Those from CT_TOP_DIR, if they exist, will be be more recent than those from CT_LIB_DIR.
CT_DoConfigGuess() { CT_DoConfigGuess() {
if [ -x "${CT_TOP_DIR}/tools/config.guess" ]; then if [ -x "${CT_TOP_DIR}/scripts/config.guess" ]; then
"${CT_TOP_DIR}/tools/config.guess" "${CT_TOP_DIR}/scripts/config.guess"
else else
"${CT_LIB_DIR}/tools/config.guess" "${CT_LIB_DIR}/scripts/config.guess"
fi fi
} }
CT_DoConfigSub() { CT_DoConfigSub() {
if [ -x "${CT_TOP_DIR}/tools/config.sub" ]; then if [ -x "${CT_TOP_DIR}/scripts/config.sub" ]; then
"${CT_TOP_DIR}/tools/config.sub" "$@" "${CT_TOP_DIR}/scripts/config.sub" "$@"
else else
"${CT_LIB_DIR}/tools/config.sub" "$@" "${CT_LIB_DIR}/scripts/config.sub" "$@"
fi fi
} }

View File

@ -1,4 +1,4 @@
# Makefile for the tools/ sub-directory # Makefile for the scripts/ sub-directory
# Here, we can update the config.* scripts. # Here, we can update the config.* scripts.
# If we're in CT_LIB_DIR, then CT_LIB_DIR == CT_TOP_DIR, and we can update those # If we're in CT_LIB_DIR, then CT_LIB_DIR == CT_TOP_DIR, and we can update those
@ -16,17 +16,9 @@ help-distrib::
# The tools are: config.guess and config.sub # The tools are: config.guess and config.sub
CONFIG_SUB_SRC="http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" CONFIG_SUB_SRC="http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD"
CONFIG_SUB_DEST=tools/config.sub CONFIG_SUB_DEST=scripts/config.sub
CONFIG_GUESS_SRC="http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD" CONFIG_GUESS_SRC="http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD"
CONFIG_GUESS_DEST=tools/config.guess CONFIG_GUESS_DEST=scripts/config.guess
# Kludge: we have a step that is called 'tools', and thus we can not define a
# rule here that is named 'tools'. Naming it 'tools/' does not help either.
# Thus, prepend the top directory to have a single rule description. This is
# not as bad as it seems, because it is only refered to by teo rules in this
# file, but still it is a kludge...
$(CT_TOP_DIR)/tools:
$(SILENT)mkdir -p tools
PHONY += updatetools PHONY += updatetools
updatetools: $(CONFIG_SUB_DEST) $(CONFIG_GUESS_DEST) updatetools: $(CONFIG_SUB_DEST) $(CONFIG_GUESS_DEST)
@ -39,12 +31,18 @@ ifeq ($(strip $(V)),2)
wget_opt= wget_opt=
endif endif
$(CONFIG_SUB_DEST): .FORCE $(CT_TOP_DIR)/tools PHONY += scripts
scripts:
$(SILENT)mkdir -p scripts
FROCE += $(CONFIG_SUB_DEST)
$(CONFIG_SUB_DEST): scripts
@$(ECHO) ' WGET $@' @$(ECHO) ' WGET $@'
$(SILENT)wget $(wget_opt) -O $@ $(CONFIG_SUB_SRC) $(SILENT)wget $(wget_opt) -O $@ $(CONFIG_SUB_SRC)
$(SILENT)chmod u+rwx,go+rx-w $@ $(SILENT)chmod u+rwx,go+rx-w $@
$(CONFIG_GUESS_DEST): .FORCE $(CT_TOP_DIR)/tools FORCE += $(CONFIG_GUESS_DEST)
$(CONFIG_GUESS_DEST): scripts
@$(ECHO) ' WGET $@' @$(ECHO) ' WGET $@'
$(SILENT)wget $(wget_opt) -O $@ $(CONFIG_GUESS_SRC) $(SILENT)wget $(wget_opt) -O $@ $(CONFIG_GUESS_SRC)
$(SILENT)chmod u+rwx,go+rx-w $@ $(SILENT)chmod u+rwx,go+rx-w $@
@ -53,5 +51,5 @@ $(CONFIG_GUESS_DEST): .FORCE $(CT_TOP_DIR)/tools
# Clean up the mess # Clean up the mess
distclean:: distclean::
@$(ECHO) " CLEAN tools" @$(ECHO) " CLEAN scripts"
$(SILENT)[ $(CT_TOP_DIR) = $(CT_LIB_DIR) ] || rm -rf $(CT_TOP_DIR)/tools $(SILENT)[ $(CT_TOP_DIR) = $(CT_LIB_DIR) ] || rm -rf $(CT_TOP_DIR)/scripts