Repository navigation
Expand file tree
/
Copy pathMAKE
More file actions
executable file
·169 lines (151 loc) · 4.18 KB
/
Copy pathMAKE
File metadata and controls
executable file
·169 lines (151 loc) · 4.18 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
trap "" 1
DESTDIR=${DESTDIR-/4bsd}
CC=cc
: make sure directory hierarchy exists
( cd $DESTDIR
for i in bin etc lib sys usr
do if [ ! -d $i ]
then rm -f $i; mkdir $i
fi
done
cd $DESTDIR/usr
for i in bin dict games lib net spool ucb vpd
do if [ ! -d $i ]
then rm -f $i; mkdir $i
fi
done
cd $DESTDIR/usr/lib
for i in learn lex lisp lint refer struct term tmac uucp
do if [ ! -d $i ]
then rm -f $i; mkdir $i
fi
done
cd $DESTDIR/usr/net
for i in bin network
do if [ ! -d $i ]
then rm -f $i; mkdir $i
fi
done
cd $DESTDIR/usr/spool
for i in lpd mail secretmail uucp uucppublic vpd
do if [ ! -d $i ]
then rm -f $i; mkdir $i
fi
done
)
for i in $*
do echo " ======== $i"
CFLAGS='-O -d2'
case $i in
512restor.c|analyze.c|colcrt.c|dump.c|dumpdir.c|egrep.y|fgrep.c|\
ld.c|ndump.c|ncheck.c|ps.c|quot.c|ranlib.c|restor.c|sa.c|sort.c|\
tar.c|w.c|wc.c)\
CFLAGS='-O';;
esac
case $i in
clean) rm -f *.o core y.tab.c lex.yy.c ;: Clean unwanted files.
;;
*.y) B=`basename $i .y`
eval D=`grep " $B\$" DESTINATIONS`
yacc $B.y \
&& $CC $CFLAGS -o $B y.tab.c -lln \
&& install -s $B $DESTDIR$D/$B
rm -f y.tab.[co] $B
;;
*.l) B=`basename $i .l`
eval D=`grep " $B\$" DESTINATIONS`
lex $B.l \
&& $CC $CFLAGS -o $B lex.yy.c -lln \
&& install -s $B $DESTDIR$D/$B
rm -f lex.yy.[co] $B
;;
clear.c|more.c|ul.c)
B=`basename $i .c`
eval D=`grep " $B\$" DESTINATIONS`
$CC $CFLAGS -o $B $B.c -ltermlib \
&& install -s $B $DESTDIR$D/$B
rm -f $B.o $B
;;
comsat.c)
B=`basename $i .c`
eval D=`grep " $B\$" DESTINATIONS`
$CC $CFLAGS -o $B $B.c -ljobs \
&& install -s $B $DESTDIR$D/$B
rm -f $B.o $B
;;
*.c) B=`basename $i .c`
eval D=`grep " $B\$" DESTINATIONS`
$CC $CFLAGS -o $B $B.c -lm \
&& install -s $B $DESTDIR$D/$B
rm -f $B.o $B
;;
mklost+found.s|*.sh) B=`basename $i .sh`
eval D=`grep " $B\$" DESTINATIONS`
install -c $B.sh $DESTDIR$D/$B
;;
*.s) B=`basename $i .s`
eval D=`grep " $B\$" DESTINATIONS`
as -o $B.o $B.s \
&& $CC -o $B $B.o \
&& install -s $B $DESTDIR$D/$B
rm -f $B.o $B
;;
MAKE|DESTINATIONS|SCCS)
echo Do nothing.
;;
MODES)
BINF=" df login mail mkdir mv passwd rmdir su"
UBINF=" at newgrp"
UCBF=" chfn chsh netrm netq net"
LIBF=" atrun ex3.5preserve ex3.5recover rvcat"
UULIBF="uucp/uuxqt uucp/uucico uucp/uuclean uucp/uusub"
UUBINF="uucp uux uulog uuname"
TMPF=" /tmp /usr/tmp /usr/lib/uucp/.XQTDIR /usr/msgs"
TSPOOL="lpd mail secretmail uucp uucppublic"
ATDIR="at at/past"
BNETBF="net v6mail"
cd $DESTDIR/bin; chown root $BINF; chmod 4755 $BINF
cd $DESTDIR/usr/bin; chown root $UBINF; chmod 4755 $UBINF
cd $DESTDIR/usr/ucb; chown root $UCBF; chmod 4755 $UCBF
cd $DESTDIR/usr/lib; chown root $LIBF; chmod 4755 $LIBF
cd $DESTDIR/usr/lib; chown uucp $UULIBF; chmod 4755 $UULIBF
cd $DESTDIR/usr/bin; chown uucp $UUBINF; chmod 4755 $UUBINF
cd $DESTDIR/usr/net/bin; chown root $BNETBF; chmod 4755 $BNETBF
chmod 777 $DESTDIR/$TMPF
cd $DESTDIR/usr/spool; chmod 777 $TSPOOL; chmod 755 $ATDIR;\
chown root $ATDIR
;;
ALIASES) echo Establish alias names.
rm -f $DESTDIR/bin/[
ln $DESTDIR/bin/test $DESTDIR/bin/[
rm -f $DESTDIR/usr/ucb/l $DESTDIR/usr/ucb/f $DESTDIR/usr/ucb/u
rm -f $DESTDIR/usr/ucb/page
ln $DESTDIR/usr/ucb/ls $DESTDIR/usr/ucb/l
ln $DESTDIR/usr/ucb/finger $DESTDIR/usr/ucb/f
ln $DESTDIR/usr/ucb/users $DESTDIR/usr/ucb/u
ln $DESTDIR/usr/ucb/more $DESTDIR/usr/ucb/page
cp $DESTDIR/usr/ucb/ls $DESTDIR/bin/ucbls
rm $DESTDIR/usr/bin/uuclean
ln $DESTDIR/usr/lib/uucp/uuclean $DESTDIR/usr/bin/uuclean
rm -f $DESTDIR/usr/ucb/uptime
ln $DESTDIR/usr/ucb/w $DESTDIR/usr/ucb/uptime
(cd $DESTDIR/usr/ucb ; rm vi view edit e ../bin/ex)
(cd $DESTDIR/usr/ucb ; ln ex vi ; ln ex view ; ln ex edit )
(cd $DESTDIR/usr/ucb ; ln ex e ; ln ex ../bin/ex)
(cd $DESTDIR/usr/ucb ; rm -f mail ; ln Mail mail)
(cd $DESTDIR/usr/ucb ; rm -f net ; ln $DESTDIR/usr/net/bin/net)
(cd $DESTDIR/usr/ucb ; rm -f netcp ; ln $DESTDIR/usr/net/bin/netcp)
;;
*) if [ ! -d $i ]
then echo "Don't know what to do with $i."
else
date
cd $i
make CC=$CC DESTDIR=$DESTDIR \
&& make install DESTDIR=$DESTDIR \
&& make clean
date
cd ..
fi
esac
done