Commit | Line | Data |
---|---|---|
1f312495 DF |
1 | # |
2 | # Copyright (c) 1980 Regents of the University of California. | |
3 | # All rights reserved. The Berkeley software License Agreement | |
4 | # specifies the terms and conditions for redistribution. | |
5 | # | |
6 | # @(#)Makefile 5.1 (Berkeley) %G% | |
ed4eaf26 | 7 | # |
79854fee | 8 | DESTDIR= |
ed4eaf26 | 9 | CFLAGS= -O |
ed4eaf26 | 10 | |
79854fee KM |
11 | # Programs that live in subdirectories, and have makefiles of their own. |
12 | # | |
7ddb6d53 | 13 | SUBDIR= adb as awk csh diff make sed sh tp |
ed4eaf26 | 14 | |
79854fee KM |
15 | # Shell scripts that need only be installed and are never removed. |
16 | # | |
17 | SCRIPT= false true | |
ed4eaf26 | 18 | |
79854fee KM |
19 | # C programs that live in the current directory and do not need |
20 | # explicit make lines. | |
21 | # | |
d89146d3 | 22 | STD= ar cat cc chgrp chmod cmp date dd df du echo ed expr \ |
d497fe9f | 23 | grep hostid hostname kill ld ln login ls mail mkdir mt nice \ |
d89146d3 | 24 | nm od pagesize passwd pr pwd rm rmail rmdir size strip stty su sync \ |
3e7f9b9e | 25 | tar tee test time wall who write |
ed4eaf26 | 26 | |
e4cc2084 RC |
27 | # C programs that live in the current directory and need explicit make lines. |
28 | # | |
29 | NSTD= ps | |
30 | ||
79854fee KM |
31 | # Programs that must run setuid to root |
32 | # | |
66a05c49 | 33 | SETUID= chgrp df login mail passwd su |
ed4eaf26 | 34 | |
e4cc2084 | 35 | # Programs that must run set-group-id kmem. |
79854fee | 36 | # |
e4cc2084 | 37 | KMEM= ps |
79854fee | 38 | |
3e7f9b9e | 39 | all: ${SUBDIR} ${STD} ${NSTD} cp mv |
79854fee KM |
40 | |
41 | ${SUBDIR}: /tmp | |
42 | cd $@; make ${MFLAGS} | |
43 | ||
3e7f9b9e | 44 | ${STD} mv cp: |
ff17818f | 45 | ${CC} ${CFLAGS} -o $@ $@.c |
79854fee | 46 | |
d497fe9f | 47 | # take care with cp and mv, install uses them |
79854fee | 48 | install: |
5ef6ff74 SL |
49 | install -s cp ${DESTDIR}/bin/newcp; \ |
50 | mv ${DESTDIR}/bin/newcp ${DESTDIR}/bin/cp; | |
56f5b7b8 SL |
51 | rm -f ${DESTDIR}/bin/mv; cp mv ${DESTDIR}/bin/mv; rm -f mv; \ |
52 | strip ${DESTDIR}/bin/mv | |
79854fee KM |
53 | for i in ${SUBDIR}; do \ |
54 | (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done | |
55 | for i in ${SCRIPT}; do (install -c $$i.sh ${DESTDIR}/bin/$$i); done | |
5ef6ff74 | 56 | for i in ${STD} ${NSTD}; do (install -s $$i ${DESTDIR}/bin/$$i); done |
79854fee KM |
57 | for i in ${SETUID}; do (chown root ${DESTDIR}/bin/$$i; \ |
58 | chmod 4755 ${DESTDIR}/bin/$$i); done | |
e4cc2084 RC |
59 | for i in ${KMEM}; do (chgrp kmem ${DESTDIR}/bin/$$i; \ |
60 | chmod 2755 ${DESTDIR}/bin/$$i); done | |
79854fee KM |
61 | rm -f ${DESTDIR}/bin/[; ln ${DESTDIR}/bin/test ${DESTDIR}/bin/[ |
62 | rm -f ${DESTDIR}/bin/e; ln ${DESTDIR}/bin/ed ${DESTDIR}/bin/e | |
8cf6e5dd RC |
63 | rm -f ${DESTDIR}/bin/chfn; ln ${DESTDIR}/bin/passwd ${DESTDIR}/bin/chfn |
64 | rm -f ${DESTDIR}/bin/chsh; ln ${DESTDIR}/bin/passwd ${DESTDIR}/bin/chsh | |
79854fee KM |
65 | |
66 | clean: | |
67 | rm -f a.out core *.s *.o errs | |
68 | for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done | |
69 | rm -f ${STD} ${NSTD} expr.c | |
70 | ||
71 | depend: | |
72 | cat </dev/null >x.c | |
73 | for i in ${STD} ${NSTD}; do \ | |
74 | (echo $$i: $$i.c >>makedep; \ | |
75 | /bin/grep '^#[ ]*include' x.c $$i.c | sed \ | |
76 | -e 's,<\(.*\)>,"/usr/include/\1",' \ | |
77 | -e 's/:[^"]*"\([^"]*\)".*/: \1/' \ | |
78 | -e 's/\.c//' >>makedep); done | |
79 | echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep | |
80 | echo '$$r makedep' >>eddep | |
81 | echo 'w' >>eddep | |
82 | cp Makefile Makefile.bak | |
83 | ed - Makefile < eddep | |
84 | rm eddep makedep x.c | |
85 | echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile | |
86 | echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile | |
87 | echo '# see make depend above' >> Makefile | |
88 | ||
89 | # Files listed in ${NSTD} have explicit make lines given below. | |
90 | ||
91 | ps: | |
92 | cc ${CFLAGS} -o ps ps.c -lm | |
93 | ||
94 | # DO NOT DELETE THIS LINE -- make depend uses it | |
95 | ||
96 | ar: ar.c | |
79854fee KM |
97 | ar: /usr/include/sys/types.h |
98 | ar: /usr/include/sys/stat.h | |
72cf2549 BJ |
99 | ar: /usr/include/sys/time.h |
100 | ar: /usr/include/stdio.h | |
79854fee KM |
101 | ar: /usr/include/ar.h |
102 | ar: /usr/include/signal.h | |
103 | cat: cat.c | |
104 | cat: /usr/include/stdio.h | |
105 | cat: /usr/include/sys/types.h | |
106 | cat: /usr/include/sys/stat.h | |
107 | cc: cc.c | |
108 | cc: /usr/include/sys/param.h | |
109 | cc: /usr/include/stdio.h | |
110 | cc: /usr/include/ctype.h | |
111 | cc: /usr/include/signal.h | |
72cf2549 | 112 | cc: /usr/include/sys/dir.h |
79854fee KM |
113 | chgrp: chgrp.c |
114 | chgrp: /usr/include/stdio.h | |
115 | chgrp: /usr/include/ctype.h | |
116 | chgrp: /usr/include/sys/types.h | |
117 | chgrp: /usr/include/sys/stat.h | |
118 | chgrp: /usr/include/grp.h | |
119 | chgrp: /usr/include/pwd.h | |
120 | chmod: chmod.c | |
121 | chmod: /usr/include/stdio.h | |
122 | chmod: /usr/include/sys/types.h | |
123 | chmod: /usr/include/sys/stat.h | |
124 | cmp: cmp.c | |
125 | cmp: /usr/include/stdio.h | |
126 | cmp: /usr/include/ctype.h | |
79854fee KM |
127 | date: date.c |
128 | date: /usr/include/stdio.h | |
72cf2549 | 129 | date: /usr/include/sys/time.h |
79854fee KM |
130 | date: /usr/include/utmp.h |
131 | dd: dd.c | |
132 | dd: /usr/include/stdio.h | |
133 | dd: /usr/include/signal.h | |
134 | df: df.c | |
79854fee KM |
135 | df: /usr/include/sys/param.h |
136 | df: /usr/include/sys/fs.h | |
137 | df: /usr/include/sys/stat.h | |
72cf2549 BJ |
138 | df: /usr/include/stdio.h |
139 | df: /usr/include/fstab.h | |
140 | df: /usr/include/mtab.h | |
79854fee KM |
141 | du: du.c |
142 | du: /usr/include/stdio.h | |
143 | du: /usr/include/sys/param.h | |
144 | du: /usr/include/sys/stat.h | |
72cf2549 | 145 | du: /usr/include/sys/dir.h |
79854fee KM |
146 | echo: echo.c |
147 | echo: /usr/include/stdio.h | |
148 | ed: ed.c | |
149 | ed: /usr/include/signal.h | |
150 | ed: /usr/include/sgtty.h | |
151 | ed: /usr/include/setjmp.h | |
152 | expr: expr.c | |
153 | expr: /usr/include/stdio.h | |
154 | grep: grep.c | |
155 | grep: /usr/include/stdio.h | |
156 | grep: /usr/include/ctype.h | |
56f5b7b8 | 157 | hostid: hostid.c |
79854fee KM |
158 | hostname: hostname.c |
159 | hostname: /usr/include/stdio.h | |
160 | kill: kill.c | |
161 | kill: /usr/include/signal.h | |
162 | kill: /usr/include/ctype.h | |
163 | ld: ld.c | |
164 | ld: /usr/include/sys/types.h | |
165 | ld: /usr/include/signal.h | |
166 | ld: /usr/include/stdio.h | |
167 | ld: /usr/include/ctype.h | |
168 | ld: /usr/include/ar.h | |
169 | ld: /usr/include/a.out.h | |
170 | ld: /usr/include/ranlib.h | |
72cf2549 | 171 | ld: /usr/include/sys/stat.h |
79854fee KM |
172 | ln: ln.c |
173 | ln: /usr/include/stdio.h | |
174 | ln: /usr/include/sys/types.h | |
175 | ln: /usr/include/sys/stat.h | |
56f5b7b8 | 176 | ln: /usr/include/errno.h |
79854fee | 177 | login: login.c |
72cf2549 | 178 | login: /usr/include/sys/param.h |
56f5b7b8 SL |
179 | login: /usr/include/sys/quota.h |
180 | login: /usr/include/sys/stat.h | |
181 | login: /usr/include/sys/time.h | |
182 | login: /usr/include/sys/resource.h | |
79854fee KM |
183 | login: /usr/include/sgtty.h |
184 | login: /usr/include/utmp.h | |
185 | login: /usr/include/signal.h | |
186 | login: /usr/include/pwd.h | |
187 | login: /usr/include/stdio.h | |
79854fee | 188 | login: /usr/include/lastlog.h |
56f5b7b8 | 189 | login: /usr/include/errno.h |
79854fee KM |
190 | ls: ls.c |
191 | ls: /usr/include/sys/param.h | |
192 | ls: /usr/include/sys/stat.h | |
72cf2549 | 193 | ls: /usr/include/sys/dir.h |
79854fee KM |
194 | ls: /usr/include/stdio.h |
195 | ls: /usr/include/sgtty.h | |
196 | ls: /usr/include/pwd.h | |
197 | ls: /usr/include/grp.h | |
198 | ls: /usr/include/utmp.h | |
199 | mail: mail.c | |
200 | mail: /usr/include/ctype.h | |
201 | mail: /usr/include/stdio.h | |
202 | mail: /usr/include/pwd.h | |
203 | mail: /usr/include/utmp.h | |
204 | mail: /usr/include/signal.h | |
205 | mail: /usr/include/sys/types.h | |
206 | mail: /usr/include/sys/stat.h | |
207 | mail: /usr/include/setjmp.h | |
208 | mail: /usr/include/sysexits.h | |
209 | mail: /usr/include/sys/socket.h | |
d89146d3 | 210 | mail: /usr/include/netinet/in.h |
56f5b7b8 | 211 | mail: /usr/include/netdb.h |
79854fee | 212 | mkdir: mkdir.c |
79854fee | 213 | mkdir: /usr/include/stdio.h |
79854fee KM |
214 | mt: mt.c |
215 | mt: /usr/include/stdio.h | |
216 | mt: /usr/include/ctype.h | |
217 | mt: /usr/include/sys/types.h | |
218 | mt: /usr/include/sys/mtio.h | |
219 | mt: /usr/include/sys/ioctl.h | |
df0c1398 SL |
220 | mt: /usr/include/vaxmba/mtreg.h |
221 | mt: /usr/include/vaxmba/htreg.h | |
222 | mt: /usr/include/vaxuba/utreg.h | |
223 | mt: /usr/include/vaxuba/tmreg.h | |
224 | mt: /usr/include/vaxuba/tsreg.h | |
79854fee KM |
225 | nice: nice.c |
226 | nice: /usr/include/stdio.h | |
56f5b7b8 SL |
227 | nice: /usr/include/sys/time.h |
228 | nice: /usr/include/sys/resource.h | |
79854fee KM |
229 | nm: nm.c |
230 | nm: /usr/include/sys/types.h | |
231 | nm: /usr/include/ar.h | |
232 | nm: /usr/include/stdio.h | |
233 | nm: /usr/include/ctype.h | |
234 | nm: /usr/include/a.out.h | |
235 | nm: /usr/include/stab.h | |
72cf2549 | 236 | nm: /usr/include/sys/stat.h |
79854fee KM |
237 | od: od.c |
238 | od: /usr/include/stdio.h | |
56f5b7b8 SL |
239 | od: /usr/include/sys/types.h |
240 | od: /usr/include/sys/stat.h | |
241 | pagesize: pagesize.c | |
79854fee | 242 | passwd: passwd.c |
56f5b7b8 | 243 | passwd: /usr/include/sys/file.h |
79854fee KM |
244 | passwd: /usr/include/stdio.h |
245 | passwd: /usr/include/signal.h | |
246 | passwd: /usr/include/pwd.h | |
56f5b7b8 | 247 | passwd: /usr/include/errno.h |
79854fee KM |
248 | pr: pr.c |
249 | pr: /usr/include/stdio.h | |
250 | pr: /usr/include/signal.h | |
251 | pr: /usr/include/sys/types.h | |
252 | pr: /usr/include/sys/stat.h | |
253 | pwd: pwd.c | |
254 | pwd: /usr/include/stdio.h | |
255 | pwd: /usr/include/sys/param.h | |
79854fee KM |
256 | rm: rm.c |
257 | rm: /usr/include/stdio.h | |
258 | rm: /usr/include/sys/param.h | |
259 | rm: /usr/include/sys/stat.h | |
72cf2549 | 260 | rm: /usr/include/sys/dir.h |
79854fee KM |
261 | rmail: rmail.c |
262 | rmail: /usr/include/stdio.h | |
56f5b7b8 | 263 | rmail: /usr/include/sysexits.h |
79854fee | 264 | rmdir: rmdir.c |
79854fee KM |
265 | rmdir: /usr/include/stdio.h |
266 | size: size.c | |
267 | size: /usr/include/stdio.h | |
268 | size: /usr/include/a.out.h | |
269 | strip: strip.c | |
270 | strip: /usr/include/a.out.h | |
271 | strip: /usr/include/signal.h | |
dda7c879 SL |
272 | strip: /usr/include/stdio.h |
273 | strip: /usr/include/sys/file.h | |
79854fee KM |
274 | stty: stty.c |
275 | stty: /usr/include/stdio.h | |
276 | stty: /usr/include/sgtty.h | |
277 | su: su.c | |
278 | su: /usr/include/stdio.h | |
279 | su: /usr/include/pwd.h | |
72cf2549 BJ |
280 | su: /usr/include/sys/types.h |
281 | su: /usr/include/sys/time.h | |
282 | su: /usr/include/sys/resource.h | |
79854fee KM |
283 | sync: sync.c |
284 | tar: tar.c | |
285 | tar: /usr/include/stdio.h | |
286 | tar: /usr/include/sys/param.h | |
287 | tar: /usr/include/sys/stat.h | |
56f5b7b8 | 288 | tar: /usr/include/sys/dir.h |
79854fee KM |
289 | tar: /usr/include/sys/ioctl.h |
290 | tar: /usr/include/sys/mtio.h | |
72cf2549 | 291 | tar: /usr/include/sys/time.h |
79854fee | 292 | tar: /usr/include/signal.h |
56f5b7b8 | 293 | tar: /usr/include/errno.h |
79854fee KM |
294 | tee: tee.c |
295 | tee: /usr/include/signal.h | |
296 | tee: /usr/include/sys/types.h | |
297 | tee: /usr/include/sys/stat.h | |
298 | tee: /usr/include/errno.h | |
79854fee KM |
299 | test: test.c |
300 | test: /usr/include/stdio.h | |
301 | test: /usr/include/sys/types.h | |
302 | test: /usr/include/sys/stat.h | |
72cf2549 BJ |
303 | time: time.c |
304 | time: /usr/include/stdio.h | |
305 | time: /usr/include/signal.h | |
306 | time: /usr/include/sys/types.h | |
307 | time: /usr/include/sys/time.h | |
308 | time: /usr/include/sys/resource.h | |
79854fee KM |
309 | wall: wall.c |
310 | wall: /usr/include/stdio.h | |
311 | wall: /usr/include/utmp.h | |
72cf2549 | 312 | wall: /usr/include/sys/time.h |
79854fee KM |
313 | wall: /usr/include/signal.h |
314 | who: who.c | |
315 | who: /usr/include/stdio.h | |
316 | who: /usr/include/utmp.h | |
317 | who: /usr/include/pwd.h | |
318 | who: /usr/include/ctype.h | |
319 | write: write.c | |
320 | write: /usr/include/stdio.h | |
321 | write: /usr/include/sys/types.h | |
322 | write: /usr/include/sys/stat.h | |
323 | write: /usr/include/signal.h | |
324 | write: /usr/include/utmp.h | |
72cf2549 | 325 | write: /usr/include/sys/time.h |
79854fee KM |
326 | ps: ps.c |
327 | ps: /usr/include/stdio.h | |
328 | ps: /usr/include/ctype.h | |
329 | ps: /usr/include/nlist.h | |
330 | ps: /usr/include/pwd.h | |
331 | ps: /usr/include/sys/param.h | |
332 | ps: /usr/include/sys/tty.h | |
56f5b7b8 | 333 | ps: /usr/include/sys/dir.h |
79854fee KM |
334 | ps: /usr/include/sys/user.h |
335 | ps: /usr/include/sys/proc.h | |
0bc29a7d | 336 | ps: /usr/include/machine/pte.h |
79854fee KM |
337 | ps: /usr/include/sys/vm.h |
338 | ps: /usr/include/sys/text.h | |
339 | ps: /usr/include/sys/stat.h | |
56f5b7b8 | 340 | ps: /usr/include/sys/mbuf.h |
79854fee | 341 | ps: /usr/include/math.h |
dda7c879 SL |
342 | # DEPENDENCIES MUST END AT END OF FILE |
343 | # IF YOU PUT STUFF HERE IT WILL GO AWAY | |
344 | # see make depend above |