forked from gambit/gambit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
change-makefiles
executable file
·88 lines (68 loc) · 1.91 KB
/
change-makefiles
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#! /bin/sh
# Utility to change the makefiles.
#
# The changes need to be explicitly coded in this file.
add_bootstrap_target()
{
old="$1"
new="$2"
add_recursive_target "$old" "$new" "bootstrap" "install"
}
add_recursive_target()
{
old="$1"
new="$2"
target="$3"
before_target="$4"
cat <<EOF > "$old.sed"
/install-recursive uninstall-recursive/s/$before_target-recursive/$target-recursive $before_target-recursive/
/$before_target: $before_target-post/i\\
$target: $target-post\\
\\
$target-post: $target-recursive\\
\\
$target-recursive: $target-pre\\
\\
/^$before_target-pre:/i\\
$target-pre:\\
\\
$target-post:\\
\\
EOF
sed -f "$old.sed" < "$old" > "$new"
rm "$old.sed"
}
ALL_MAKEFILES=" \
bin/makefile.in \
doc/makefile.in \
examples/distr-comp/makefile.in \
examples/iOS/makefile.in \
examples/makefile.in \
examples/misc/makefile.in \
examples/pi/makefile.in \
examples/pthread/makefile.in \
examples/ring/makefile.in \
examples/tcltk/makefile.in \
examples/web-repl/makefile.in \
examples/web-server/makefile.in \
examples/Xlib-simple/makefile.in \
gsc/makefile.in \
gsi/makefile.in \
include/makefile.in \
lib/guide/images/makefile.in \
lib/guide/makefile.in \
lib/makefile.in \
makefile.in \
misc/makefile.in \
prebuilt/macosx/makefile.in \
prebuilt/makefile.in \
prebuilt/windows/makefile.in \
tests/makefile.in \
"
for mf in $ALL_MAKEFILES ; do
echo "---------------------------------------------- $mf"
add_bootstrap_target "$mf" "$mf.new"
diff "$mf" "$mf.new"
mv "$mf.new" "$mf"
#rm "$mf.new"
done