yann@182: # Makefile for the tools/ sub-directory yann@182: yann@182: # Here, we can update the config.* scripts. yann@182: # If we're in CT_LIB_DIR, then CT_LIB_DIR == CT_TOP_DIR, and we can update those yann@182: # scripts for later inclusion mainline. If CT_LIB_DIR != CT_TOP_DIR, then those yann@182: # scripts are downloaded only for use in CT_TOP_DIR. yann@182: yann@1001: # ---------------------------------------------------------- yann@1001: # The tools help entry yann@1001: yann@1001: help-distrib:: yann@1001: @echo ' updatetools - Update the config tools' yann@1001: yann@1001: # ---------------------------------------------------------- yann@1001: # Where to get tools from, and where to store them into yann@1001: # The tools are: config.guess and config.sub yann@1001: yann@493: CONFIG_SUB_SRC="http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" yann@1039: CONFIG_SUB_DEST=tools/config.sub yann@493: CONFIG_GUESS_SRC="http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD" yann@1039: CONFIG_GUESS_DEST=tools/config.guess yann@1: yann@1039: # Kludge: we have a step that is called 'tools', and thus we can not define a yann@1039: # rule here that is named 'tools'. Naming it 'tools/' does not help either. yann@1039: # Thus, prepend the top directory to have a single rule description. This is yann@1039: # not as bad as it seems, because it is only refered to by teo rules in this yann@1039: # file, but still it is a kludge... yann@182: $(CT_TOP_DIR)/tools: yann@1039: $(SILENT)mkdir -p tools yann@182: yann@182: PHONY += updatetools yann@1039: updatetools: $(CONFIG_SUB_DEST) $(CONFIG_GUESS_DEST) yann@182: yann@1001: # ---------------------------------------------------------- yann@1001: # How to retrieve the tools yann@1001: yann@1039: wget_opt=-o /dev/null yann@1039: ifeq ($(strip $(V)),2) yann@1039: wget_opt= yann@1039: endif yann@1039: yann@1039: $(CONFIG_SUB_DEST): .FORCE $(CT_TOP_DIR)/tools yann@1039: @$(ECHO) ' WGET $@' yann@1039: $(SILENT)wget $(wget_opt) -O $@ $(CONFIG_SUB_SRC) yann@940: $(SILENT)chmod u+rwx,go+rx-w $@ yann@182: yann@1039: $(CONFIG_GUESS_DEST): .FORCE $(CT_TOP_DIR)/tools yann@1039: @$(ECHO) ' WGET $@' yann@1039: $(SILENT)wget $(wget_opt) -O $@ $(CONFIG_GUESS_SRC) yann@940: $(SILENT)chmod u+rwx,go+rx-w $@ yann@1: yann@1001: # ---------------------------------------------------------- yann@1001: # Clean up the mess yann@182: yann@182: distclean:: yann@953: @$(ECHO) " CLEAN tools" yann@940: $(SILENT)[ $(CT_TOP_DIR) = $(CT_LIB_DIR) ] || rm -rf $(CT_TOP_DIR)/tools