diff options
author | Alexey Neyman <stilor@att.net> | 2018-02-22 00:25:36 -0800 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2018-04-07 12:03:17 -0700 |
commit | 69df9ae9ddb806b42d962ae8a0b2b8f7b31f480e (patch) | |
tree | 5e23600df2ad384e15b1c6131e3e235993a6d4b6 /scripts/scripts.mk | |
parent | dbe3877285549d1cdc549826673cdf8f07cf154c (diff) | |
download | crosstool-ng-69df9ae9ddb806b42d962ae8a0b2b8f7b31f480e.tar.gz crosstool-ng-69df9ae9ddb806b42d962ae8a0b2b8f7b31f480e.tar.bz2 crosstool-ng-69df9ae9ddb806b42d962ae8a0b2b8f7b31f480e.zip |
Remove the need for configure substitutions in scripts
... so that scripts/ directory can be installed verbatim.
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/scripts.mk')
-rw-r--r-- | scripts/scripts.mk | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/scripts/scripts.mk b/scripts/scripts.mk new file mode 100644 index 00000000..d77f1a70 --- /dev/null +++ b/scripts/scripts.mk @@ -0,0 +1,64 @@ +# Makefile for the scripts/ sub-directory + +# 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 +# scripts for later inclusion mainline. If CT_LIB_DIR != CT_TOP_DIR, then those +# scripts are downloaded only for use in CT_TOP_DIR. + +# ---------------------------------------------------------- +# The tools help entry + +help-distrib:: + @echo ' updatetools - Update the config tools' + +# ---------------------------------------------------------- +# Where to get tools from, and where to store them into +# 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_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_DEST=scripts/config.guess + +PHONY += updatetools +updatetools: $(CONFIG_SUB_DEST) $(CONFIG_GUESS_DEST) + +# ---------------------------------------------------------- +# How to retrieve the tools + +ifneq ($(strip $(V)),2) + wget_silent_opt = -o /dev/null + curl_silent_opt = --silent +endif + +ifneq ($(CT_wget),) +download_cmd = $(CT_wget) --passive-ftp $(wget_silent_opt) -O $@ +else +ifneq ($(CT_curl),) +download_cmd = $(CT_curl) --ftp-pasv $(curl_silent_opt) -o $@ +else +download_cmd = $(error wget or curl needed for downloads) +endif +endif + +PHONY += scripts +scripts: + @$(CT_ECHO) ' MKDIR $@' + $(SILENT)mkdir -p $@ + +$(CONFIG_SUB_DEST): scripts FORCE + @$(CT_ECHO) ' DOWNLOAD $@' + $(SILENT)$(download_cmd) $(CONFIG_SUB_SRC) + $(SILENT)chmod u+rwx,go+rx-w $@ + +$(CONFIG_GUESS_DEST): scripts FORCE + @$(CT_ECHO) ' DOWNLOAD $@' + $(SILENT)$(download_cmd) $(CONFIG_GUESS_SRC) + $(SILENT)chmod u+rwx,go+rx-w $@ + +# ---------------------------------------------------------- +# Clean up the mess + +distclean:: + @$(CT_ECHO) " CLEAN scripts" + $(SILENT)[ $(CT_TOP_DIR) = $(CT_LIB_DIR) ] || rm -rf $(CT_TOP_DIR)/scripts |