-# 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"
-
-ALL= compat-4.1 compat-4.1/compat-4.1.${MACHINE} compat-4.3 \
- compat-sys5 gen gen/gen.${MACHINE} inet net net/net.${MACHINE} \
- net/${HOSTLOOKUP} ns stdio stdio/stdio.${MACHINE} \
- ${MACHINE}/csu ${MACHINE}/sys
-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} \
- ${MACHINE}/csu ${MACHINE}/sys
-TAGSFILE=tags
-
-libc.a libc_p.a: mkdir ${ALL}
- 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
- 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
- rm -rf t1 library profiled
-
-mkdir: FRC
- rm -rf library profiled
- mkdir library profiled
-
-${ALL}: FRC
- cd $@; make ${MFLAGS} DEFS=${DEFS} link
-
-install:
- install -o bin -g bin -m 644 libc.a ${DESTDIR}/lib/libc.a
- ranlib ${DESTDIR}/lib/libc.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
-
-tags:
- for i in ${ONE}; do \
- (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:
- for i in ${SUBDIR}; \
- do (cd $$i; make ${MFLAGS} clean); done
- rm -rf libc.a libc_p.a library profiled
-
-depend:
- for i in ${SUBDIR}; \
- do (cd $$i; make ${MFLAGS} DEFS=${DEFS} depend); done
-
-FRC:
-
+# not contain these strings, delete -DLIBC_SCCS and -DSYSLIBC_SCCS
+# from CFLAGS below. To remove these strings from just the system call
+# stubs, remove just -DSYSLIBC_SCCS from CFLAGS.
+LIB=c
+CFLAGS+=-DLIBC_SCCS -DSYSLIBC_SCCS
+AINC= -I${.CURDIR}/${MACHINE}
+
+.include "${.CURDIR}/db/Makefile.inc"
+.include "${.CURDIR}/compat-43/Makefile.inc"
+.include "${.CURDIR}/gen/Makefile.inc"
+.include "${.CURDIR}/locale/Makefile.inc"
+.include "${.CURDIR}/net/Makefile.inc"
+.include "${.CURDIR}/quad/Makefile.inc"
+.include "${.CURDIR}/stdio/Makefile.inc"
+.include "${.CURDIR}/stdlib/Makefile.inc"
+.include "${.CURDIR}/string/Makefile.inc"
+.include "${.CURDIR}/sys/Makefile.inc"
+
+KQSRCS= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
+ lshldi3.c lshrdi3.c moddi3.c muldi3.c negdi2.c notdi2.c qdivrem.c \
+ subdi3.c ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
+KSRCS= bcmp.c ffs.c strcat.c strcmp.c strcpy.c strlen.c strncpy.c
+
+libkern: ${KQSRCS} ${KSRCS}
+ cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} /sys/libkern
+
+beforeinstall: tags
+ install -c -o bin -g bin -m 444 tags /var/db/libc.tags
+
+tags: ${SRCS}
+ ctags ${.ALLSRC:M*.c}
+ egrep -o "^ENTRY(.*)|^FUNC(.*)|^SYSCALL(.*)" ${.ALLSRC:M*.s} | \
+ sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \
+ >> tags; sort -o tags tags
+
+.include <bsd.lib.mk>