diff --git a/lib/libposix/Makefile b/lib/libposix/Makefile new file mode 100644 index 000000000000..55ba60041ac0 --- /dev/null +++ b/lib/libposix/Makefile @@ -0,0 +1,13 @@ +# $NetBSD: Makefile,v 1.1 1997/05/18 20:14:21 kleink Exp $ + +LIB= posix + +CFLAGS+=-D_REENTRANT -I${.CURDIR}/../libc/include +AINC= -I${.CURDIR}/../libc/arch/${MACHINE_ARCH} +.if defined(DESTDIR) +AINC+= -nostdinc -idirafter ${DESTDIR}/usr/include +.endif + +.include "${.CURDIR}/sys/Makefile.inc" + +.include diff --git a/lib/libposix/shlib_version b/lib/libposix/shlib_version new file mode 100644 index 000000000000..97c9f92d6b8f --- /dev/null +++ b/lib/libposix/shlib_version @@ -0,0 +1,2 @@ +major=0 +minor=0 diff --git a/lib/libposix/sys/Makefile.inc b/lib/libposix/sys/Makefile.inc new file mode 100644 index 000000000000..8cdfa38273e6 --- /dev/null +++ b/lib/libposix/sys/Makefile.inc @@ -0,0 +1,53 @@ +# $NetBSD: Makefile.inc,v 1.1 1997/05/18 20:14:22 kleink Exp $ + +# sys sources +.PATH: ${.CURDIR}/../libc/arch/${MACHINE_ARCH}/sys ${.CURDIR}/sys + +# stubs providing an entry "foo" but calling "posix_foo()" +PSEUDO= rename.o +PPSEUDO=${PSEUDO:.o=.po} +SPSEUDO=${PSEUDO:.o=.so} +LPSEUDO=${PSEUDO:.o=.ln} + +OBJS+= ${PSEUDO} +LOBJS+= ${LPSEUDO} + + +${PPSEUDO}: ${.CURDIR}/../libc/arch/${MACHINE_ARCH}/SYS.h \ + ${DESTDIR}/usr/include/sys/syscall.h + @echo creating ${.TARGET} + @printf '#include "SYS.h"\n \ + PSEUDO(${.PREFIX},${.PREFIX:S/^/posix_/})\n' | \ + ${CPP} -DPROF ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o + @${LD} -X -r ${.TARGET}.o -o ${.TARGET} + @rm -f ${.TARGET}.o + +.if (${MACHINE_ARCH} != "alpha") +${SPSEUDO}: ${.CURDIR}/../libc/arch/${MACHINE_ARCH}/SYS.h \ + ${DESTDIR}/usr/include/sys/syscall.h + @echo creating ${.TARGET} + @printf '#include "SYS.h"\n \ + PSEUDO(${.PREFIX},${.PREFIX:S/^/posix_/})\n' | \ + ${CPP} -DPIC ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -k -o ${.TARGET} +.else +${SPSEUDO}: ${.CURDIR}/../libc/arch/${MACHINE_ARCH}/SYS.h \ + ${DESTDIR}/usr/include/sys/syscall.h + @echo creating ${.TARGET} + @printf '#include "SYS.h"\n \ + PSEUDO(${.PREFIX},${.PREFIX:S/^/posix_/})\n' | \ + ${CPP} -DPIC ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET} +.endif + +${PSEUDO}: ${.CURDIR}/../libc/arch/${MACHINE_ARCH}/SYS.h \ + ${DESTDIR}/usr/include/sys/syscall.h + @echo creating ${.TARGET} + @printf '#include "SYS.h"\n \ + PSEUDO(${.PREFIX},${.PREFIX:S/^/posix_/})\n' | \ + ${CPP} ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o + @${LD} -X -r ${.TARGET}.o -o ${.TARGET} + @rm -f ${.TARGET}.o + +${LPSEUDO}: ${DESTDIR}/usr/include/sys/syscall.h ${.CURDIR}/sys/makelintstub + @echo creating ${.TARGET} + @${.CURDIR}/sys/makelintstub ${.PREFIX:S/posix_//} ${.PREFIX} | \ + ${LINT} -z ${LINTFLAGS} ${CFLAGS:M-[IDU]*} -i -o ${.TARGET} -