From: Dirk Vogt Date: Tue, 1 May 2012 14:09:06 +0000 (+0200) Subject: Makefile fixups for cross compilation X-Git-Tag: v3.2.1~530 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.dnssec-coverage.html?a=commitdiff_plain;h=c735b0bb2c021a441ec29b7f5ac289f10e135472;p=minix.git Makefile fixups for cross compilation --- diff --git a/kernel/Makefile b/kernel/Makefile index b85519743..1b6d23b3c 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -15,12 +15,12 @@ CFLAGS += -D__kernel__ CPPFLAGS+= -fno-stack-protector -D_NETBSD_SOURCE LDFLAGS+= -T ${.CURDIR}/arch/${ARCH}/kernel.lds -LDFLAGS+= -nostdlib -L${LIBDIR} +LDFLAGS+= -nostdlib -L${DESTDIR}/${LIBDIR} LDADD+= -lminlib DPADD+= ${LIBMINLIB} -.if ${CC} == "gcc" +.if !empty(CC:M*gcc) LDADD+= -lgcc -lsys -lgcc -lminc -.elif ${CC} == "clang" +.elif !empty(CC:M*clang) LDADD+= -L/usr/pkg/compiler-rt/lib -lCompilerRT-Generic -lsys -lCompilerRT-Generic -lminc DPADD+= ${LIBC} .endif diff --git a/man/Makefile b/man/Makefile index 163dfde28..40e96eeec 100644 --- a/man/Makefile +++ b/man/Makefile @@ -7,8 +7,8 @@ WHATISDBDIR?= /usr/man makedb: ${TOOL_MAKEWHATIS} ${DESTDIR}${WHATISDBDIR} .if ${MKUNPRIVED} != "no" - echo ".${WHATISDBDIR}/whatis.db type=file mode=0444 uname=${BINOWN} gname=${BINGRP}" \ - | ${METALOG.add} +# echo ".${WHATISDBDIR}/whatis.db type=file mode=0444 uname=${BINOWN} gname=${BINGRP}" \ +# | ${METALOG.add} .endif .include diff --git a/sys/arch/i386/stand/boot/Makefile.boot b/sys/arch/i386/stand/boot/Makefile.boot index 53727d3dd..4b98817fc 100644 --- a/sys/arch/i386/stand/boot/Makefile.boot +++ b/sys/arch/i386/stand/boot/Makefile.boot @@ -34,7 +34,7 @@ BINMODE=444 .PATH: ${.CURDIR}/.. ${.CURDIR}/../../lib -LDFLAGS+= -nostdlib -Wl,-N -Wl,-e,boot_start +LDFLAGS+= -nostdlib -Wl,-N -Wl,-e,boot_start -L${DESTDIR}/${LIBDIR} CPPFLAGS+= -I ${.CURDIR}/.. -I ${.CURDIR}/../../lib -I ${S}/lib/libsa CPPFLAGS+= -I ${.OBJDIR} # Make sure we override any optimization options specified by the user diff --git a/sys/arch/i386/stand/bootxx/Makefile.bootxx b/sys/arch/i386/stand/bootxx/Makefile.bootxx index 58bcd4342..338fc3aca 100644 --- a/sys/arch/i386/stand/bootxx/Makefile.bootxx +++ b/sys/arch/i386/stand/bootxx/Makefile.bootxx @@ -39,7 +39,7 @@ BINMODE=444 .PATH: ${.CURDIR}/.. ${.CURDIR}/../../lib -LDFLAGS+= -nostdlib -Wl,-N -Wl,-e,start +LDFLAGS+= -nostdlib -Wl,-N -Wl,-e,start -L${DESTDIR}/${LIBDIR} CPPFLAGS+= -DBOOTXX # CPPFLAGS+= -D__daddr_t=int32_t CPPFLAGS+= -I ${.CURDIR}/../../lib -I ${.OBJDIR} @@ -52,7 +52,7 @@ CPPFLAGS+= -DXXfs_read=${FS}_read CPPFLAGS+= -DXXfs_stat=${FS}_stat CPPFLAGS+= -DFS=${FS} # clang generates too big bootxx_xxx -.if (${CC} == "clang") +.if !empty(CC:M*clang) CPPFLAGS+= -Os .endif # CPPFLAGS+= -DBOOT_MSG_COM0