. allow commands to use it by setting NEED_NBSDLIBC
. also add mkfiles to clean and cleandepend so they
don't break on missing new mkfiles
$(MAKE) -C share install
$(MAKE) -C tools install
-clean:
+clean: mkfiles
$(MAKE) -C boot clean
$(MAKE) -C commands clean
$(MAKE) -C bin clean
$(MAKE) -C lib clean_all
$(MAKE) -C test clean
-cleandepend:
+cleandepend: mkfiles
$(MAKE) -C lib cleandepend_all
$(MAKE) -C boot cleandepend
$(MAKE) -C commands cleandepend
-# Requires NBSD_LIBC and clang/gcc (we default to using clang)
-NBSD_LIBC:= yes
-CC:=${CC:C/^cc/clang/}
-COMPILER_TYPE:= gnu
+.include <minix.newlibc.mk>
CPPFLAGS+= -D_NETBSD_SOURCE
+# Any of the commands can force the new libc being used by
+# setting NEED_NBSDLIBC
+.if defined(NEED_NBSDLIBC)
+.include <minix.newlibc.mk>
+.endif
+
.if (${NBSD_LIBC} != "no")
CPPFLAGS+= -D_MINIX -D_NETBSD_SOURCE -D_MINIX_COMPAT
LDADD+= -lminlib -lcompat_minix -lasyn -lterminfo
# MINIX-specific files
FILES+= minix.bootprog.mk minix.service.mk minix.ackdep.mk \
- minix.ack.mk minix.gcc.mk minix.gcov.mk pkgsrchooks.mk
+ minix.ack.mk minix.gcc.mk minix.gcov.mk pkgsrchooks.mk \
+ minix.newlibc.mk
FILESDIR=/usr/share/mk
.endif
--- /dev/null
+# Force clang/gcc and using new libc
+# Requires NBSD_LIBC and clang/gcc (we default to using clang)
+NBSD_LIBC:= yes
+CC:=${CC:C/^cc/clang/}
+COMPILER_TYPE:= gnu
-# Requires clang/gcc for NetBSD libc
-CC:=${CC:C/^cc/clang/}
-COMPILER_TYPE:= gnu
+.include <minix.newlibc.mk>
CPPFLAGS+= -D_NETBSD_SOURCE -D__NBSD_LIBC=1