Commit | Line | Data |
---|---|---|
bb0cfa24 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 | # | |
61576367 | 6 | # @(#)Makefile 5.4 (Berkeley) %G% |
35486962 | 7 | # |
b5fb482c | 8 | CFLAGS= -O ${DEFS} |
818c32a5 SL |
9 | STDSRCS=ftime.c gtty.c nice.c pause.c rand.c stty.c tell.c \ |
10 | times.c utime.c vlimit.c vtimes.c | |
35486962 SL |
11 | STD= ftime.o gtty.o nice.o pause.o rand.o stty.o tell.o \ |
12 | times.o utime.o vlimit.o vtimes.o | |
13 | # these should just be pitched, but in the interest of compatibility... | |
818c32a5 | 14 | TRASHSRC=getpw.c |
95a23c9e | 15 | TRASH= getpw.o |
818c32a5 | 16 | SRCS= ${STDSRCS} ${TRASHSRCS} |
35486962 | 17 | OBJS= ${STD} ${TRASH} |
818c32a5 | 18 | TAGSFILE=tags |
35486962 SL |
19 | |
20 | .c.o: | |
21 | ${CC} -p ${CFLAGS} -c $*.c | |
22 | -ld -X -r $*.o | |
23 | mv a.out profiled/$*.o | |
24 | ${CC} ${CFLAGS} -c $*.c | |
25 | -ld -x -r $*.o | |
26 | mv a.out $*.o | |
27 | ||
28 | compat-4.1lib compat-4.1lib_p: ${OBJS} | |
29 | @echo "building profiled compat-4.1lib" | |
30 | @cd profiled; ar cru ../compat-4.1lib_p ${OBJS} | |
31 | @echo "buiding normal compat-4.1lib" | |
32 | @ar cru compat-4.1lib ${OBJS} | |
33 | ||
818c32a5 SL |
34 | tags: |
35 | cwd=`pwd`; \ | |
36 | for i in ${SRCS}; do \ | |
37 | ctags -a -f ${TAGSFILE} $$cwd/$$i; \ | |
38 | done | |
39 | ||
35486962 | 40 | clean: |
f0bb30cd JB |
41 | rm -f compat-4.1lib compat-4.1lib_p *.o profiled/*.o tags Makefile.bak |
42 | ||
43 | depend: | |
44 | for i in ${SRCS}; do \ | |
45 | cc -M ${CFLAGS} $$i | awk ' { if ($$1 != prev) \ | |
46 | { if (rec != "") print rec; rec = $$0; prev = $$1; } \ | |
47 | else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ | |
48 | else rec = rec " " $$2 } } \ | |
49 | END { print rec } ' >> makedep; done | |
50 | echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep | |
51 | echo '$$r makedep' >>eddep | |
52 | echo 'w' >>eddep | |
53 | cp Makefile Makefile.bak | |
54 | ed - Makefile < eddep | |
55 | rm eddep makedep | |
56 | echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile | |
57 | echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile | |
58 | echo '# see make depend above' >> Makefile | |
59 | ||
60 | # DO NOT DELETE THIS LINE -- make depend uses it | |
61 | ||
62 |