mk: single mk fragment for new libc

. 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
This commit is contained in:
Ben Gras 2011-07-27 18:01:44 +02:00
parent 3ca141ab81
commit f614d0015a
6 changed files with 17 additions and 10 deletions

View file

@ -94,7 +94,7 @@ install:
$(MAKE) -C share install
$(MAKE) -C tools install
clean:
clean: mkfiles
$(MAKE) -C boot clean
$(MAKE) -C commands clean
$(MAKE) -C bin clean
@ -103,7 +103,7 @@ 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

View file

@ -1,7 +1,4 @@
# 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

View file

@ -1,3 +1,9 @@
# 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

View file

@ -12,7 +12,8 @@ FILES= bsd.dep.mk bsd.files.mk \
# 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

View file

@ -0,0 +1,5 @@
# 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

View file

@ -1,6 +1,4 @@
# 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