machine now defined in make
[unix-history] / usr / src / lib / libc / Makefile
CommitLineData
1b597941
SL
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#
c2155dd0 6# @(#)Makefile 4.24 (Berkeley) %G%
fb1f04f7 7#
8c7be43d 8#
4e22c84a
BJ
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#
298fecef
BJ
17# Compatibility routines are kept in directories with a prefixing
18# ``compat'' (so they all sort together).
4e22c84a
BJ
19#
20# The C run-time startup code is always machine dependent and expected
21# to be located in ${MACHINE}/csu
29e84943 22#
01ffb051
DS
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.
311cfb46 28#
2cf8fbdc 29# There are two possible methods of doing host name look up. They are
f40caa26 30# to use the name server or /etc/hosts. HOSTLOOKUP defines which method
cc8774b4 31# is to be compiled into libc :
fb1f04f7 32#
cc8774b4 33# defining HOSTLOOKUP to be "named", compiles the
f40caa26 34# host lookup routines that use the BIND name server.
cc8774b4
JB
35#
36# defining HOSTLOOKUP to be "hosttable", compiles
37# the host lookup routines that use /etc/hosts.
38#
3aebf78c
KS
39#HOSTLOOKUP= hosttable
40HOSTLOOKUP= named
cc8774b4 41#
29e84943 42DESTDIR=
8c7be43d 43INSTALL=install -m 644
7867d964 44DFLMON= mon.o
311cfb46 45DEFS=
298fecef 46COMPAT= compat-4.1 compat-sys5
3aebf78c 47ALL= gen inet net ns stdio ${MACHINE} ${COMPAT}
818c32a5 48TAGSFILE=tags
29e84943 49
2cf8fbdc 50libc.a libc_p.a: ${MACHINE}/csu ${ALL} net/${HOSTLOOKUP}
ed6a7667 51 rm -rf t1 tmp
b507d6c0 52 -mkdir tmp
4e22c84a 53 for i in ${ALL}; do (cd tmp; ar x ../$$i/$${i}lib); done
2cf8fbdc 54 cd tmp; ar x ../net/${HOSTLOOKUP}/hostlib
29e84943 55 ls tmp/*.o | sort -t/ +1 > t1
4e22c84a 56 ar cr libc.a `lorder \`cat t1\` | tsort` ${MACHINE}/csu/${DFLMON}
1b597941 57 ar ma findiop.o libc.a exit.o
c8a54e4e 58 ar ma exit.o libc.a fakcu.o
29e84943 59 rm -f t1 tmp/*
4e22c84a 60 for i in ${ALL}; do (cd tmp; ar x ../$$i/$${i}lib_p); done
2cf8fbdc 61 cd tmp; ar x ../net/${HOSTLOOKUP}/hostlib_p
29e84943 62 ls tmp/*.o | sort -t/ +1 > t1
4e22c84a 63 ar cr libc_p.a `lorder \`cat t1\` | tsort` ${MACHINE}/csu/${DFLMON}
1b597941 64 ar ma findiop.o libc_p.a exit.o
d92dfcf8 65 ar ma exit.o libc_p.a fakcu.o
29e84943
KM
66 rm -rf t1 tmp
67
2cf8fbdc 68${MACHINE}/csu ${ALL} net/${HOSTLOOKUP}: FRC
311cfb46 69 cd $@; make ${MFLAGS} DEFS=${DEFS}
29e84943 70
4e22c84a
BJ
71FRC:
72
4e22c84a 73install:
7867d964
SL
74 ${INSTALL} libc.a ${DESTDIR}/lib/libc.a
75 ranlib ${DESTDIR}/lib/libc.a
76 ${INSTALL} libc_p.a ${DESTDIR}/usr/lib/libc_p.a
77 ranlib ${DESTDIR}/usr/lib/libc_p.a
4e22c84a 78 cd ${MACHINE}/csu; make DESTDIR=${DESTDIR} install
818c32a5
SL
79
80tags:
81 for i in ${ALL}; do \
82 (cd $$i; make ${MFLAGS} TAGSFILE=../${TAGSFILE} tags); \
3aebf78c 83 done
90dfbb64 84 /usr/bin/sort -o ${TAGSFILE} ${TAGSFILE}
818c32a5
SL
85
86clean:
cc8774b4 87 for i in ${MACHINE}/csu ${ALL} net/hosttable net/named; \
2cf8fbdc 88 do (cd $$i; make ${MFLAGS} clean); done
818c32a5
SL
89 rm -f t1 tmp/*.o
90 -rmdir tmp
cc8774b4
JB
91
92depend:
93 for i in ${MACHINE}/csu ${ALL} net/hosttable net/named; \
94 do (cd $$i; make ${MFLAGS} DEFS=${DEFS} depend); done