xref: /original-bsd/lib/libterm/Makefile (revision c47935e1)
1#
2# Copyright (c) 1987 The 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.7 (Berkeley) 05/10/89
18#
19CFLAGS=	-O -DCM_N -DCM_GT -DCM_B -DCM_D
20LIBC=	/lib/libc.a
21SRCS=	termcap.c tgoto.c tputs.c
22OBJS=	termcap.o tgoto.o tputs.o
23MAN=	termcap.0
24MDIR=	${DESTDIR}/usr/man/cat3
25
26.c.o:
27	${CC} ${CFLAGS} -c -p $*.c
28	ld -x -r -o profiled/$*.o $*.o
29	${CC} ${CFLAGS} -c $*.c
30	ld -X -r $*.o
31	mv a.out $*.o
32
33all: termcap.a termcap_p.a
34
35termcap.a termcap_p.a: ${OBJS}
36	@echo building normal termcap
37	@ar cr termcap.a ${OBJS}
38	ranlib termcap.a
39	@echo building profiled termcap
40	@cd profiled; ar cr ../termcap_p.a ${OBJS}
41	ranlib termcap_p.a
42
43test:
44	${CC} ${CFLAGS} -o tc1 tc1.c termcap.a
45	${CC} ${CFLAGS} -o tc2 tc2.c termcap.a
46	${CC} ${CFLAGS} -o tc3 tc3.c termcap.a
47
48clean:
49	rm -f ${OBJS} core profiled/*.o termcap.a termcap_p.a
50
51cleandir: clean
52	rm -f ${MAN} tags .depend
53
54depend:
55	mkdep ${CFLAGS} ${SRCS}
56
57install: ${MAN}
58	install -o bin -g bin -m 644 termcap.a ${DESTDIR}/usr/lib/libtermcap.a
59	ranlib -t ${DESTDIR}/usr/lib/libtermcap.a
60	rm -f ${DESTDIR}/usr/lib/libtermlib.a
61	ln ${DESTDIR}/usr/lib/libtermcap.a ${DESTDIR}/usr/lib/libtermlib.a
62	install -o bin -g bin -m 644 termcap_p.a \
63	    ${DESTDIR}/usr/lib/libtermcap_p.a
64	ranlib -t ${DESTDIR}/urs/lib/libtermcap_p.a
65	rm -f ${DESTDIR}/usr/lib/libtermlib_p.a
66	ln ${DESTDIR}/usr/lib/libtermcap_p.a ${DESTDIR}/usr/lib/libtermlib_p.a
67	install -c -o bin -g bin -m 444 termcap.0 ${DESTDIR}/usr/man/cat3
68	rm -f ${MDIR}/tgetent.0; ln ${MDIR}/termcap.0 ${MDIR}/tgetent.0
69	rm -f ${MDIR}/tgetflag.0; ln ${MDIR}/termcap.0 ${MDIR}/tgetflag.0
70	rm -f ${MDIR}/tgetnum.0; ln ${MDIR}/termcap.0 ${MDIR}/tgetnum.0
71	rm -f ${MDIR}/tgetstr.0; ln ${MDIR}/termcap.0 ${MDIR}/tgetstr.0
72	rm -f ${MDIR}/tgoto.0; ln ${MDIR}/termcap.0 ${MDIR}/tgoto.0
73	rm -f ${MDIR}/tputs.0; ln ${MDIR}/termcap.0 ${MDIR}/tputs.0
74
75lint:
76	lint ${CFLAGS} ${SRCS}
77
78tags:
79	ctags ${SRCS}
80