xref: /original-bsd/lib/libc/Makefile (revision 9750efab)
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 this notice is preserved and that due credit is given
7# to the University of California at Berkeley. The name of the University
8# may not be used to endorse or promote products derived from this
9# software without specific prior written permission. This software
10# is provided ``as is'' without express or implied warranty.
11#
12#	@(#)Makefile	4.33 (Berkeley) 06/04/88
13#
14# Compatibility routines are kept in directories with a prefixing
15# ``compat'' (so they all sort together).
16#
17# The C run-time startup code is always machine dependent and expected
18# to be located in ${MACHINE}/csu
19#
20# There are two possible methods of doing host name look up.  They are
21# to use the name server or /etc/hosts. HOSTLOOKUP defines which method
22# is to be compiled into libc  :
23#
24#	defining HOSTLOOKUP to be "named", compiles the
25#	host lookup routines that use the BIND name server.
26#
27#	defining HOSTLOOKUP to be "hosttable", compiles
28#	the host lookup routines that use /etc/hosts.
29#
30#HOSTLOOKUP=	hosttable
31HOSTLOOKUP=	named
32#
33# The system has two monitoring schemes, utilizing either ``prof''
34# or ``gprof''. DFLMON determines the default profiler; mon.o
35# specifies that ``prof'' is the default, gmon.o specifies that
36# ``gprof'' is the default.
37#DFLMON=	gmon.o
38DFLMON=		mon.o
39#
40# All library object contain sccsid strings by default; they may be
41# excluded as a space-saving measure.  To produce a library that does
42# not contain these strings, remove -DLIBC_SCCS and -DSYSLIBC_SCCS
43# from DEFS below.  To remove these strings from just the system call
44# stubs, remove -DSYSLIBC_SCCS from DEFS below.
45#DEFS=
46DEFS="-DLIBC_SCCS -DSYSLIBC_SCCS"
47
48SUBDIR=	${ALL} net/hosttable net/named
49ONE=	compat-4.1 compat-4.3 compat-sys5 gen inet net ns stdio
50TWO=	compat-4.1/compat-4.1.${MACHINE} gen/gen.${MACHINE} \
51	net/net.${MACHINE} net/${HOSTLOOKUP} stdio/stdio.${MACHINE} \
52	compat-sys5/compat-sys5.${MACHINE} ${MACHINE}/csu ${MACHINE}/sys
53ALL=	${ONE} ${TWO}
54TAGSFILE=tags
55
56libc.a libc_p.a: mkdir ${ALL} tags
57	ls library/*.o | sort -t/ +1 > t1
58	ar cr libc.a `lorder \`cat t1\` | tsort` ${MACHINE}/csu/${DFLMON}
59	ar ma findiop.o libc.a exit.o
60	ar ma exit.o libc.a fakcu.o
61	ls profiled/*.o | sort -t/ +1 > t1
62	ar cr libc_p.a `lorder \`cat t1\` | tsort` ${MACHINE}/csu/${DFLMON}
63	ar ma findiop.o libc_p.a exit.o
64	ar ma exit.o libc_p.a fakcu.o
65	rm -rf t1 library profiled
66
67mkdir: FRC
68	rm -rf library profiled
69	mkdir library profiled
70
71${ALL}: FRC
72	cd $@; make ${MFLAGS} DEFS=${DEFS} link
73
74install:
75	install -o bin -g bin -m 644 libc.a ${DESTDIR}/lib/libc.a
76	ranlib ${DESTDIR}/lib/libc.a
77	install -o bin -g bin -m 644 libc_p.a ${DESTDIR}/usr/lib/libc_p.a
78	ranlib ${DESTDIR}/usr/lib/libc_p.a
79	cd ${MACHINE}/csu; make DESTDIR=${DESTDIR} install
80	install -o bin -g bin -m 444 ${TAGSFILE} ${DESTDIR}/usr/lib/${TAGSFILE}
81
82tags:
83	for i in ${ONE}; do \
84		(cd $$i; make ${MFLAGS} TAGSFILE=../${TAGSFILE} tags); \
85	done
86	for i in ${TWO}; do \
87		(cd $$i; make ${MFLAGS} TAGSFILE=../../${TAGSFILE} tags); \
88	done
89	sort -o ${TAGSFILE} ${TAGSFILE}
90
91clean:
92	for i in ${SUBDIR}; \
93		do (cd $$i; make ${MFLAGS} clean); done
94	rm -rf libc.a libc_p.a library profiled
95
96depend:
97	for i in ${SUBDIR}; \
98		do (cd $$i; make ${MFLAGS} DEFS=${DEFS} depend); done
99
100FRC:
101
102