add Berkeley copyright
[unix-history] / usr / src / lib / libc / Makefile
index 4b9494c..b3030ae 100644 (file)
@@ -1,18 +1,20 @@
 #
 #
-# Copyright (c) 1980 Regents of the University of California.
-# All rights reserved.  The Berkeley software License Agreement
-# specifies the terms and conditions for redistribution.
+# Copyright (c) 1988 Regents of the University of California.
+# All rights reserved.
 #
 #
-#      @(#)Makefile    4.25 (Berkeley) %G%
+# Redistribution and use in source and binary forms are permitted
+# provided that the above copyright notice and this paragraph are
+# duplicated in all such forms and that any documentation,
+# advertising materials, and other materials related to such
+# distribution and use acknowledge that the software was developed
+# by the University of California, Berkeley.  The name of the
+# University may not be used to endorse or promote products derived
+# from this software without specific prior written permission.
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 #
 #
-#
-# The system has two monitoring schemes, utilizing either ``prof''
-# or ``gprof''. DFLMON determines the default profiler; mon.o
-# specifies that ``prof'' is the default, gmon.o specifies that
-# ``gprof'' is the default.
-#
-# Machine dependent routines are located in a subtree which parallels
-# the top directories.  This subtree is identified by the machine name.
+#      @(#)Makefile    4.34 (Berkeley) %G%
 #
 # Compatibility routines are kept in directories with a prefixing
 # ``compat'' (so they all sort together).
 #
 # Compatibility routines are kept in directories with a prefixing
 # ``compat'' (so they all sort together).
 # The C run-time startup code is always machine dependent and expected
 # to be located in ${MACHINE}/csu
 #
 # The C run-time startup code is always machine dependent and expected
 # to be located in ${MACHINE}/csu
 #
-# All files contain sccsid strings, but these are not compiled into
-# library objects by default, as a space-saving measure.  To produce
-# a library that contains these strings in every object except
-# system call stubs, add -DLIBC_SCCS to DEFS below; to put these
-# strings into system call stubs, use -DSYSLIBC_SCCS.
-#
 # There are two possible methods of doing host name look up.  They are
 # to use the name server or /etc/hosts. HOSTLOOKUP defines which method
 # is to be compiled into libc  :
 # There are two possible methods of doing host name look up.  They are
 # to use the name server or /etc/hosts. HOSTLOOKUP defines which method
 # is to be compiled into libc  :
 #
 #HOSTLOOKUP=   hosttable
 HOSTLOOKUP=    named
 #
 #HOSTLOOKUP=   hosttable
 HOSTLOOKUP=    named
-#                                                      
-DESTDIR=
-INSTALL=install -m 644
-DFLMON=        mon.o
-DEFS=
-COMPAT=        compat-4.1 compat-sys5
-ALL=   gen inet net ns stdio ${MACHINE} ${COMPAT}
+#
+# The system has two monitoring schemes, utilizing either ``prof''
+# or ``gprof''. DFLMON determines the default profiler; mon.o
+# specifies that ``prof'' is the default, gmon.o specifies that
+# ``gprof'' is the default.
+#DFLMON=       gmon.o
+DFLMON=                mon.o
+#
+# All library object contain sccsid strings by default; they may be
+# excluded as a space-saving measure.  To produce a library that does
+# not contain these strings, remove -DLIBC_SCCS and -DSYSLIBC_SCCS
+# from DEFS below.  To remove these strings from just the system call
+# stubs, remove -DSYSLIBC_SCCS from DEFS below.
+#DEFS=
+DEFS="-DLIBC_SCCS -DSYSLIBC_SCCS"
+
+SUBDIR=        ${ALL} net/hosttable net/named
+ONE=   compat-4.1 compat-4.3 compat-sys5 gen inet net ns stdio
+TWO=   compat-4.1/compat-4.1.${MACHINE} gen/gen.${MACHINE} \
+       net/net.${MACHINE} net/${HOSTLOOKUP} stdio/stdio.${MACHINE} \
+       compat-sys5/compat-sys5.${MACHINE} ${MACHINE}/csu ${MACHINE}/sys
+ALL=   ${ONE} ${TWO}
 TAGSFILE=tags
 
 TAGSFILE=tags
 
-libc.a libc_p.a: ${MACHINE}/csu ${ALL} net/${HOSTLOOKUP}
-       rm -rf t1 tmp
-       -mkdir tmp
-       for i in ${ALL}; do (cd tmp; ar x ../$$i/$${i}lib); done
-       cd tmp; ar x ../net/${HOSTLOOKUP}/hostlib
-       ls tmp/*.o | sort -t/ +1 > t1
+libc.a libc_p.a: mkdir ${ALL} tags
+       ls library/*.o | sort -t/ +1 > t1
        ar cr libc.a `lorder \`cat t1\` | tsort` ${MACHINE}/csu/${DFLMON}
        ar ma findiop.o libc.a exit.o
        ar ma exit.o libc.a fakcu.o
        ar cr libc.a `lorder \`cat t1\` | tsort` ${MACHINE}/csu/${DFLMON}
        ar ma findiop.o libc.a exit.o
        ar ma exit.o libc.a fakcu.o
-       rm -f t1 tmp/*
-       for i in ${ALL}; do (cd tmp; ar x ../$$i/$${i}lib_p); done
-       cd tmp; ar x ../net/${HOSTLOOKUP}/hostlib_p
-       ls tmp/*.o | sort -t/ +1 > t1
+       ls profiled/*.o | sort -t/ +1 > t1
        ar cr libc_p.a `lorder \`cat t1\` | tsort` ${MACHINE}/csu/${DFLMON}
        ar ma findiop.o libc_p.a exit.o
        ar ma exit.o libc_p.a fakcu.o
        ar cr libc_p.a `lorder \`cat t1\` | tsort` ${MACHINE}/csu/${DFLMON}
        ar ma findiop.o libc_p.a exit.o
        ar ma exit.o libc_p.a fakcu.o
-       rm -rf t1 tmp
+       rm -rf t1 library profiled
 
 
-${MACHINE}/csu ${ALL} net/${HOSTLOOKUP}: FRC
-       cd $@; make ${MFLAGS} DEFS=${DEFS}
+mkdir: FRC
+       rm -rf library profiled
+       mkdir library profiled
 
 
-FRC:
+${ALL}: FRC
+       cd $@; make ${MFLAGS} DEFS=${DEFS} link
 
 install: 
 
 install: 
-       ${INSTALL} libc.a ${DESTDIR}/lib/libc.a
+       install -o bin -g bin -m 644 libc.a ${DESTDIR}/lib/libc.a
        ranlib ${DESTDIR}/lib/libc.a
        ranlib ${DESTDIR}/lib/libc.a
-       ${INSTALL} libc_p.a ${DESTDIR}/usr/lib/libc_p.a
+       install -o bin -g bin -m 644 libc_p.a ${DESTDIR}/usr/lib/libc_p.a
        ranlib ${DESTDIR}/usr/lib/libc_p.a
        cd ${MACHINE}/csu; make DESTDIR=${DESTDIR} install
        ranlib ${DESTDIR}/usr/lib/libc_p.a
        cd ${MACHINE}/csu; make DESTDIR=${DESTDIR} install
+       install -o bin -g bin -m 444 ${TAGSFILE} ${DESTDIR}/usr/lib/${TAGSFILE}
 
 tags:
 
 tags:
-       for i in ${ALL}; do \
+       for i in ${ONE}; do \
                (cd $$i; make ${MFLAGS} TAGSFILE=../${TAGSFILE} tags); \
        done
                (cd $$i; make ${MFLAGS} TAGSFILE=../${TAGSFILE} tags); \
        done
+       for i in ${TWO}; do \
+               (cd $$i; make ${MFLAGS} TAGSFILE=../../${TAGSFILE} tags); \
+       done
        /usr/bin/sort -o ${TAGSFILE} ${TAGSFILE}
 
 clean:
        /usr/bin/sort -o ${TAGSFILE} ${TAGSFILE}
 
 clean:
-       for i in ${MACHINE}/csu ${ALL} net/hosttable net/named; \
+       for i in ${SUBDIR}; \
                do (cd $$i; make ${MFLAGS} clean); done
                do (cd $$i; make ${MFLAGS} clean); done
-       rm -f t1 tmp/*.o
-       -rmdir tmp
+       rm -rf libc.a libc_p.a library profiled
 
 depend:
 
 depend:
-       for i in ${ALL} net/hosttable net/named; \
+       for i in ${SUBDIR}; \
                do (cd $$i; make ${MFLAGS} DEFS=${DEFS} depend); done
                do (cd $$i; make ${MFLAGS} DEFS=${DEFS} depend); done
+
+FRC:
+