xref: /original-bsd/lib/libcompat/4.1/Makefile (revision 8431ec24)
1#
2# Copyright (c) 1988 Regents of the University of California.
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms are permitted
6# provided that the above copyright notice and this paragraph are
7# duplicated in all such forms and that any documentation,
8# advertising materials, and other materials related to such
9# distribution and use acknowledge that the software was developed
10# by the University of California, Berkeley.  The name of the
11# University may not be used to endorse or promote products derived
12# from this software without specific prior written permission.
13# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16#
17#	@(#)Makefile	5.13 (Berkeley) 03/22/90
18#
19
20OBJS=	ftime.o getpw.o gtty.o rand.o reset.o stty.o tell.o times.o \
21	utime.o vlimit.o vtimes.o
22SRCS=	ftime.c getpw.c gtty.c rand.c stty.c tell.c times.c utime.c \
23	vlimit.c vtimes.c
24ASRCS=	reset.s
25MAN=	ftime.0 getpw.0 rand.0 stty.0 times.0 utime.0 vlimit.0 vtimes.0
26
27# Tahoe specific sources
28TSRC=	${SRCS}
29TASRC=	${ASRCS}
30
31# Vax specific sources
32#VSRC=	${SRCS}
33#VASRC=	${ASRCS}
34
35VPATH=	${MACHINE}
36FLAGS=	-I${MACHINE} -I../../libc/${MACHINE}
37DEFS=	-DLIBC_SCCS
38CFLAGS=	-O ${DEFS}
39TAGSFILE=tags
40MDIR=	/usr/man/cat3
41
42.SUFFIXES:
43.SUFFIXES: .o .s .c .3 .0
44
45.s.o:
46	@${CPP} -E ${FLAGS} -DPROF $*.s | ${AS} -o $*.o
47	@ld -X -o profiled/$*.o -r $*.o
48	${CPP} -E ${FLAGS} $*.s | ${AS} -o $*.o
49	@ld -x -r $*.o
50	@mv a.out $*.o
51
52.c.o:
53	@${CC} -p ${CFLAGS} -c $*.c
54	@-ld -X -o profiled/$*.o -r $*.o
55	${CC} ${CFLAGS} -c $*.c
56	@-ld -x -r $*.o
57	@mv a.out $*.o
58
59all: ${OBJS}
60
61clean:
62	rm -f *.o profiled/* a.out core
63
64cleandir: clean
65	rm -f ${MAN} tags .depend
66
67depend: depend.${MACHINE}
68
69depend.tahoe: ${TSRC}
70	mkdep ${CFLAGS} ${TSRC}
71
72depend.vax: ${VSRC}
73	mkdep ${CFLAGS} ${VSRC}
74
75tags: tags.${MACHINE}
76
77tags.tahoe: ${TSRC} ${TASRC}
78	rm -f ${TAGSFILE}
79	cwd=`pwd`; \
80	for i in ${TSRC}; do \
81		ctags -a -f ${TAGSFILE} $$cwd/$$i; \
82	done
83	(P=`pwd`; \
84	egrep "^ENTRY(.*)|^SYSCALL(.*)" ${TASRC} | sed \
85"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 $$P/\1 /^\2(\3\4$$/;" \
86	>> ${TAGSFILE})
87
88tags.vax: ${VSRC} ${VASRC}
89	rm -f ${TAGSFILE}
90	cwd=`pwd`; \
91	for i in ${VSRC}; do \
92		ctags -a -f ${TAGSFILE} $$cwd/$$i; \
93	done
94	(P=`pwd`; \
95	egrep "^ENTRY(.*)|^SYSCALL(.*)" ${VASRC} | sed \
96"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 $$P/\1 /^\2(\3\4$$/;" \
97	>> ${TAGSFILE})
98
99install: ${MAN}
100	cd ../library; rm -f ${OBJS}
101	ln ${OBJS} ../library
102	cd ../profiled; rm -f ${OBJS}
103	cd profiled; ln ${OBJS} ../../profiled
104	install -c -o bin -g bin -m 444 ${MAN} ${MDIR}
105	rm -f ${MDIR}/srand.0; ln ${MDIR}/rand.0 ${MDIR}/srand.0
106	rm -f ${MDIR}/gtty.0; ln ${MDIR}/stty.0 ${MDIR}/gtty.0
107