yann@182
|
1 |
# Makefile for the tools/ sub-directory
|
yann@182
|
2 |
|
yann@182
|
3 |
# Here, we can update the config.* scripts.
|
yann@182
|
4 |
# If we're in CT_LIB_DIR, then CT_LIB_DIR == CT_TOP_DIR, and we can update those
|
yann@182
|
5 |
# scripts for later inclusion mainline. If CT_LIB_DIR != CT_TOP_DIR, then those
|
yann@182
|
6 |
# scripts are downloaded only for use in CT_TOP_DIR.
|
yann@182
|
7 |
|
yann@1001
|
8 |
# ----------------------------------------------------------
|
yann@1001
|
9 |
# The tools help entry
|
yann@1001
|
10 |
|
yann@1001
|
11 |
help-distrib::
|
yann@1001
|
12 |
@echo ' updatetools - Update the config tools'
|
yann@1001
|
13 |
|
yann@1001
|
14 |
# ----------------------------------------------------------
|
yann@1001
|
15 |
# Where to get tools from, and where to store them into
|
yann@1001
|
16 |
# The tools are: config.guess and config.sub
|
yann@1001
|
17 |
|
yann@493
|
18 |
CONFIG_SUB_SRC="http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD"
|
yann@1039
|
19 |
CONFIG_SUB_DEST=tools/config.sub
|
yann@493
|
20 |
CONFIG_GUESS_SRC="http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD"
|
yann@1039
|
21 |
CONFIG_GUESS_DEST=tools/config.guess
|
yann@1
|
22 |
|
yann@1039
|
23 |
# Kludge: we have a step that is called 'tools', and thus we can not define a
|
yann@1039
|
24 |
# rule here that is named 'tools'. Naming it 'tools/' does not help either.
|
yann@1039
|
25 |
# Thus, prepend the top directory to have a single rule description. This is
|
yann@1039
|
26 |
# not as bad as it seems, because it is only refered to by teo rules in this
|
yann@1039
|
27 |
# file, but still it is a kludge...
|
yann@182
|
28 |
$(CT_TOP_DIR)/tools:
|
yann@1039
|
29 |
$(SILENT)mkdir -p tools
|
yann@182
|
30 |
|
yann@182
|
31 |
PHONY += updatetools
|
yann@1039
|
32 |
updatetools: $(CONFIG_SUB_DEST) $(CONFIG_GUESS_DEST)
|
yann@182
|
33 |
|
yann@1001
|
34 |
# ----------------------------------------------------------
|
yann@1001
|
35 |
# How to retrieve the tools
|
yann@1001
|
36 |
|
yann@1039
|
37 |
wget_opt=-o /dev/null
|
yann@1039
|
38 |
ifeq ($(strip $(V)),2)
|
yann@1039
|
39 |
wget_opt=
|
yann@1039
|
40 |
endif
|
yann@1039
|
41 |
|
yann@1039
|
42 |
$(CONFIG_SUB_DEST): .FORCE $(CT_TOP_DIR)/tools
|
yann@1039
|
43 |
@$(ECHO) ' WGET $@'
|
yann@1039
|
44 |
$(SILENT)wget $(wget_opt) -O $@ $(CONFIG_SUB_SRC)
|
yann@940
|
45 |
$(SILENT)chmod u+rwx,go+rx-w $@
|
yann@182
|
46 |
|
yann@1039
|
47 |
$(CONFIG_GUESS_DEST): .FORCE $(CT_TOP_DIR)/tools
|
yann@1039
|
48 |
@$(ECHO) ' WGET $@'
|
yann@1039
|
49 |
$(SILENT)wget $(wget_opt) -O $@ $(CONFIG_GUESS_SRC)
|
yann@940
|
50 |
$(SILENT)chmod u+rwx,go+rx-w $@
|
yann@1
|
51 |
|
yann@1001
|
52 |
# ----------------------------------------------------------
|
yann@1001
|
53 |
# Clean up the mess
|
yann@182
|
54 |
|
yann@182
|
55 |
distclean::
|
yann@953
|
56 |
@$(ECHO) " CLEAN tools"
|
yann@940
|
57 |
$(SILENT)[ $(CT_TOP_DIR) = $(CT_LIB_DIR) ] || rm -rf $(CT_TOP_DIR)/tools
|