xref: /original-bsd/lib/libc/Makefile (revision ad93c43e)
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	4.28 (Berkeley) 12/31/87
7#
8#
9# The system has two monitoring schemes, utilizing either ``prof''
10# or ``gprof''. DFLMON determines the default profiler; mon.o
11# specifies that ``prof'' is the default, gmon.o specifies that
12# ``gprof'' is the default.
13#
14# Machine dependent routines are located in a subtree which parallels
15# the top directories.  This subtree is identified by the machine name.
16#
17# Compatibility routines are kept in directories with a prefixing
18# ``compat'' (so they all sort together).
19#
20# The C run-time startup code is always machine dependent and expected
21# to be located in ${MACHINE}/csu
22#
23# All files contain sccsid strings, but these are not compiled into
24# library objects by default, as a space-saving measure.  To produce
25# a library that contains these strings in every object except
26# system call stubs, add -DLIBC_SCCS to DEFS below; to put these
27# strings into system call stubs, use -DSYSLIBC_SCCS.
28#
29# There are two possible methods of doing host name look up.  They are
30# to use the name server or /etc/hosts. HOSTLOOKUP defines which method
31# is to be compiled into libc  :
32#
33#	defining HOSTLOOKUP to be "named", compiles the
34#	host lookup routines that use the BIND name server.
35#
36#	defining HOSTLOOKUP to be "hosttable", compiles
37#	the host lookup routines that use /etc/hosts.
38#
39#HOSTLOOKUP=	hosttable
40HOSTLOOKUP=	named
41#
42DESTDIR=
43DFLMON=	mon.o
44DEFS=
45COMPAT=	compat-4.1 compat-sys5
46ALL=	gen inet net ns stdio ${MACHINE} ${COMPAT}
47TAGSFILE=tags
48
49libc.a libc_p.a: ${MACHINE}/csu ${ALL} net/${HOSTLOOKUP}
50	rm -rf t1 tmp
51	-mkdir tmp
52	for i in ${ALL}; do (cd tmp; ar x ../$$i/$${i}lib); done
53	cd tmp; ar x ../net/${HOSTLOOKUP}/hostlib
54	ls tmp/*.o | sort -t/ +1 > t1
55	ar cr libc.a `lorder \`cat t1\` | tsort` ${MACHINE}/csu/${DFLMON}
56	ar ma findiop.o libc.a exit.o
57	ar ma exit.o libc.a fakcu.o
58	rm -f t1 tmp/*
59	for i in ${ALL}; do (cd tmp; ar x ../$$i/$${i}lib_p); done
60	cd tmp; ar x ../net/${HOSTLOOKUP}/hostlib_p
61	ls tmp/*.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 tmp
66
67${MACHINE}/csu ${ALL} net/${HOSTLOOKUP}: FRC
68	cd $@; make ${MFLAGS} DEFS=${DEFS}
69
70FRC:
71
72install:
73	install -o bin -g bin -m 644 libc.a ${DESTDIR}/lib/libc.a
74	ranlib ${DESTDIR}/lib/libc.a
75	install -o bin -g bin -m 644 libc_p.a ${DESTDIR}/usr/lib/libc_p.a
76	ranlib ${DESTDIR}/usr/lib/libc_p.a
77	cd ${MACHINE}/csu; make DESTDIR=${DESTDIR} install
78
79tags:
80	for i in ${ALL}; do \
81		(cd $$i; make ${MFLAGS} TAGSFILE=../${TAGSFILE} tags); \
82	done
83	cd net/${HOSTLOOKUP}; \
84		make ${MFLAGS} TAGSFILE=../../${TAGSFILE} tags
85	sort -o ${TAGSFILE} ${TAGSFILE}
86
87clean:
88	for i in ${MACHINE}/csu ${ALL} net/hosttable net/named; \
89		do (cd $$i; make ${MFLAGS} clean); done
90	rm -rf tmp t1 libc.a libc_p.a
91
92depend:
93	for i in ${ALL} net/hosttable net/named; \
94		do (cd $$i; make ${MFLAGS} DEFS=${DEFS} depend); done
95