scripts/scripts.mk
changeset 1180 734db80cc9b9
child 1618 7f52e1cca71e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/scripts/scripts.mk	Sat Jan 31 17:38:26 2009 +0000
     1.3 @@ -0,0 +1,55 @@
     1.4 +# Makefile for the scripts/ sub-directory
     1.5 +
     1.6 +# Here, we can update the config.* scripts.
     1.7 +# If we're in CT_LIB_DIR, then CT_LIB_DIR == CT_TOP_DIR, and we can update those
     1.8 +# scripts for later inclusion mainline. If CT_LIB_DIR != CT_TOP_DIR, then those
     1.9 +# scripts are downloaded only for use in CT_TOP_DIR.
    1.10 +
    1.11 +# ----------------------------------------------------------
    1.12 +# The tools help entry
    1.13 +
    1.14 +help-distrib::
    1.15 +	@echo  '  updatetools        - Update the config tools'
    1.16 +
    1.17 +# ----------------------------------------------------------
    1.18 +# Where to get tools from, and where to store them into
    1.19 +# The tools are: config.guess and config.sub
    1.20 +
    1.21 +CONFIG_SUB_SRC="http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD"
    1.22 +CONFIG_SUB_DEST=scripts/config.sub
    1.23 +CONFIG_GUESS_SRC="http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD"
    1.24 +CONFIG_GUESS_DEST=scripts/config.guess
    1.25 +
    1.26 +PHONY += updatetools
    1.27 +updatetools: $(CONFIG_SUB_DEST) $(CONFIG_GUESS_DEST)
    1.28 +
    1.29 +# ----------------------------------------------------------
    1.30 +# How to retrieve the tools
    1.31 +
    1.32 +wget_opt=-o /dev/null
    1.33 +ifeq ($(strip $(V)),2)
    1.34 +  wget_opt=
    1.35 +endif
    1.36 +
    1.37 +PHONY += scripts
    1.38 +scripts:
    1.39 +	$(SILENT)mkdir -p scripts
    1.40 +
    1.41 +FROCE += $(CONFIG_SUB_DEST)
    1.42 +$(CONFIG_SUB_DEST): scripts
    1.43 +	@$(ECHO) '  WGET  $@'
    1.44 +	$(SILENT)wget $(wget_opt) -O $@ $(CONFIG_SUB_SRC)
    1.45 +	$(SILENT)chmod u+rwx,go+rx-w $@
    1.46 +
    1.47 +FORCE += $(CONFIG_GUESS_DEST)
    1.48 +$(CONFIG_GUESS_DEST): scripts
    1.49 +	@$(ECHO) '  WGET  $@'
    1.50 +	$(SILENT)wget $(wget_opt) -O $@ $(CONFIG_GUESS_SRC)
    1.51 +	$(SILENT)chmod u+rwx,go+rx-w $@
    1.52 +
    1.53 +# ----------------------------------------------------------
    1.54 +# Clean up the mess
    1.55 +
    1.56 +distclean::
    1.57 +	@$(ECHO) "  CLEAN scripts"
    1.58 +	$(SILENT)[ $(CT_TOP_DIR) = $(CT_LIB_DIR) ] || rm -rf $(CT_TOP_DIR)/scripts