-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy
36 lines (32 loc) · 928 Bytes
/
my
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
#!/bin/sh
# Attempt to mangle a Makefile in hopes that it might be useful, but
# without any warranty whatsoever. Shudder.
if [ "$*" = "mistake" ]; then
if [ -f Makefile.unmangled ]; then
echo "That's all right. Here's your old Makefile back."
mv Makefile.unmangled Makefile
exit 0
else
echo "I don't know what you're talking about."
exit 1
fi
fi
if [ "$*" = "make right or wrong" ]; then
if [ -e Makefile.unmangled ]; then
echo "I already mangled the Makefile. Sorry, I'm a very stupid script."
exit 1
else
echo "I'll mangle this Makefile..."
mv Makefile Makefile.unmangled
if ! perl my.pl < Makefile.unmangled >Makefile; then
echo "It like didn't work or something. Here's your old Makefile back."
mv Makefile.unmangled Makefile
exit 1
else
echo "Ha ha, there."
exit 0
fi
fi
fi
echo "No, no, you didn't say it properly."
exit 1