BSD 4_2 release
[unix-history] / usr / src / lib / libc / Makefile
index 2d5d3d3..aedb4fa 100644 (file)
@@ -1,52 +1,52 @@
-#      @(#)Makefile    4.1     (Berkeley)      82/12/03
+#      Makefile        4.6     83/07/02
+#
+# 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.
+#
+# 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
 #
 DESTDIR=
 #
 DESTDIR=
+INSTALL=install -m 644
+DFLMON=        mon.o
+MACHINE=vax
+COMPAT=        compat-4.1 compat-sys5
+ALL=   gen inet net stdio ${MACHINE} ${COMPAT}
 
 
-INSTALL=mv
-
-all: libc.a libc_p.a crtx
-
-libc.a libc_p.a:
-       cd sys; make
-       cd gen; make
-       cd stdio; make
-       cd net; make
-       mkdir tmp
-       cd tmp; ar x ../sys/syslib
-       cd tmp; ar x ../gen/genlib
-       cd tmp; ar x ../stdio/stdiolib
-       cd tmp; ar x ../net/netlib
+libc.a libc_p.a: ${MACHINE}/csu ${ALL}
+       -mkdir tmp
+       for i in ${ALL}; do (cd tmp; ar x ../$$i/$${i}lib); done
        ls tmp/*.o | sort -t/ +1 > t1
        ls tmp/*.o | sort -t/ +1 > t1
-       ar ar libc.a `lorder \`cat t1\` | tsort`;
+       ar cr libc.a `lorder \`cat t1\` | tsort` ${MACHINE}/csu/${DFLMON}
        ar ma flsbuf.o libc.a exit.o
        rm -f t1 tmp/*
        ar ma flsbuf.o libc.a exit.o
        rm -f t1 tmp/*
-       cd tmp; ar x ../sys/syslib_p
-       cd tmp; ar x ../gen/genlib_p
-       cd tmp; ar x ../stdio/stdiolib_p
-       cd tmp; ar x ../net/netlib_p
+       for i in ${ALL}; do (cd tmp; ar x ../$$i/$${i}lib_p); done
        ls tmp/*.o | sort -t/ +1 > t1
        ls tmp/*.o | sort -t/ +1 > t1
-       ar ar libc_p.a `lorder \`cat t1\` | tsort`;
+       ar cr libc_p.a `lorder \`cat t1\` | tsort` ${MACHINE}/csu/${DFLMON}
        ar ma flsbuf.o libc_p.a exit.o
        rm -rf t1 tmp
 
        ar ma flsbuf.o libc_p.a exit.o
        rm -rf t1 tmp
 
-crtx:
-       cd csu; make
+${MACHINE}/csu ${ALL}: FRC
+       cd $@; make ${MFLAGS}
 
 
-clean:
-       for i in */.; do cd $$i; make clean; cd ..; done
-       rm -f t1 *.o
+FRC:
 
 
-errlst.o: gen/errlst.c
-       cc -S gen/errlst.c
-       ed - <gen/:errfix errlst.s
-       as -o errlst.o errlst.s
-       rm errlst.s
+clean:
+       for i in ${MACHINE}/csu ${ALL}; do (cd $$i; make ${MFLAGS} clean); done
+       rm -f t1 tmp/*.o
+       -rmdir tmp
 
 
-install: all
-       $(INSTALL) libc.a $(DESTDIR)/lib/libc.a
-       ranlib $(DESTDIR)/lib/libc.a
-       $(INSTALL) libc_p.a $(DESTDIR)/usr/lib/libc_p.a
-       ranlib $(DESTDIR)/usr/lib/libc_p.a
-       cd csu; $(INSTALL) crt0.o $(DESTDIR)/lib
-       cd csu; $(INSTALL) mcrt0.o $(DESTDIR)/lib
-       cd csu; $(INSTALL) gcrt0.o $(DESTDIR)/usr/lib
+install: 
+       ${INSTALL} libc.a ${DESTDIR}/lib/libc.a
+       ranlib ${DESTDIR}/lib/libc.a
+       ${INSTALL} libc_p.a ${DESTDIR}/usr/lib/libc_p.a
+       ranlib ${DESTDIR}/usr/lib/libc_p.a
+       cd ${MACHINE}/csu; make DESTDIR=${DESTDIR} install