-# 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"
-
-CSU= csu
-SRCDIR= compat-43 gen net stdio string sys sys5
-SUBDIR= ${CSU} ${SRCDIR}
-TAGSFILE=tags
-TPATH=`pwd`/${TAGSFILE}
-
-all: library ${SUBDIR}
- cd library; ls *.o | sort > t1; \
- ar cr libc.a `lorder \`cat t1\` | tsort` ../csu/${MACHINE}/${DFLMON}; \
- ar ma findiop.o libc.a exit.o; \
- ar ma exit.o libc.a fakcu.o; \
- rm -f t1
- cd profiled; ls *.o | sort > t1; \
- ar cr libc_p.a `lorder \`cat t1\` | tsort` ../csu/${MACHINE}/${DFLMON}; \
- ar ma findiop.o libc_p.a exit.o; \
- ar ma exit.o libc_p.a fakcu.o; \
- rm -f t1
-
-${SUBDIR}: FRC
- cd $@; make ${MFLAGS} DEFS=${DEFS}
-
-clean:
- for i in ${SUBDIR}; \
- do (cd $$i; make ${MFLAGS} clean); done
- rm -rf library/libc.a profiled/libc_p.a
-
-cleandir: clean
- for i in ${SUBDIR}; \
- do (cd $$i; make ${MFLAGS} cleandir); done
-
-depend:
- for i in ${SUBDIR}; \
- do (cd $$i; make ${MFLAGS} DEFS=${DEFS} $@); done
-
-install: tags
- install -o bin -g bin -m 644 library/libc.a ${DESTDIR}/usr/lib/libc.a
- ranlib ${DESTDIR}/usr/lib/libc.a
- install -o bin -g bin -m 644 profiled/libc_p.a ${DESTDIR}/usr/lib/libc_p.a
- ranlib ${DESTDIR}/usr/lib/libc_p.a
- for i in ${SUBDIR}; \
- do (cd $$i; make DEFS=${DEFS} $@); done
- install -o bin -g bin -m 444 ${TAGSFILE} ${DESTDIR}/usr/libdata
-
-tags:
- for i in ${SUBDIR}; do \
- (cd $$i; make TAGSFILE=tags tags); done
- rm -f tags
- for i in ${SUBDIR}; do \
- cat $$i/tags >> tags; done
- sort -o tags tags
-
-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}/compat-43/Makefile.inc"
+.include "${.CURDIR}/db/Makefile.inc"
+.include "${.CURDIR}/gen/Makefile.inc"
+.include "${.CURDIR}/locale/Makefile.inc"
+.include "${.CURDIR}/net/Makefile.inc"
+.include "${.CURDIR}/stdio/Makefile.inc"
+.include "${.CURDIR}/stdlib/Makefile.inc"
+.include "${.CURDIR}/string/Makefile.inc"
+.include "${.CURDIR}/sys/Makefile.inc"
+
+beforeinstall: tags
+ install -c -o bin -g bin -m 444 ${.CURDIR}/tags /var/db/libc.tags
+
+tags: ${SRCS}
+ cd ${.CURDIR}; ctags ${.ALLSRC:M*.c}
+ cd ${.CURDIR}; egrep -o "^ENTRY(.*)|^SYSCALL(.*)" ${.ALLSRC:M*.s} | \
+ sed "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \
+ >> tags; sort -o tags tags
+
+.include <bsd.lib.mk>