version 1.59.14.3, 2020/04/13 08:03:26 |
version 1.60, 2019/01/21 21:11:54 |
|
|
# Only need symbols for ctf, strip them after converting to CTF |
# Only need symbols for ctf, strip them after converting to CTF |
CTFFLAGS= -L VERSION |
CTFFLAGS= -L VERSION |
CTFMFLAGS= -t -L VERSION |
CTFMFLAGS= -t -L VERSION |
# Keep symbols if built with "-g" |
|
.if !empty(COPTS:M*-g*) |
|
CTFFLAGS+= -g |
|
CTFMFLAGS+= -g |
|
.endif |
|
.endif |
.endif |
|
|
.include <bsd.sys.mk> |
.include <bsd.sys.mk> |
Line 42 CFLAGS+= -fno-strict-aliasing -Wno-point |
|
Line 37 CFLAGS+= -fno-strict-aliasing -Wno-point |
|
# The real solution to this involves generating trampolines for those |
# The real solution to this involves generating trampolines for those |
# relocations inside the loader and removing this workaround, as the |
# relocations inside the loader and removing this workaround, as the |
# resulting code would be much faster. |
# resulting code would be much faster. |
.if ${MACHINE_CPU} == "aarch64" |
.if ${MACHINE_CPU} == "arm" |
CFLAGS+= -march=armv8-a+nofp+nosimd |
|
.elif ${MACHINE_CPU} == "arm" |
|
CFLAGS+= -fno-common -fno-unwind-tables |
CFLAGS+= -fno-common -fno-unwind-tables |
.elif ${MACHINE_CPU} == "hppa" |
.elif ${MACHINE_CPU} == "hppa" |
CFLAGS+= -mlong-calls |
CFLAGS+= -mlong-calls |
Line 112 PROG?= ${KMOD}.kmod |
|
Line 105 PROG?= ${KMOD}.kmod |
|
##### Build rules |
##### Build rules |
realall: ${PROG} |
realall: ${PROG} |
|
|
|
.if (defined(USE_COMBINE) && ${USE_COMBINE} != "no" && !commands(${_P}) \ |
|
&& !defined(NOCOMBINE.${_P}) && !defined(NOCOMBINE)) |
|
.for f in ${SRCS:N*.h:N*.sh:N*.fth:C/\.[yl]$/.c/g} |
|
.if (${CPPFLAGS.$f:D1} == "1" || ${CPUFLAGS.$f:D2} == "2" \ |
|
|| ${COPTS.$f:D3} == "3" || ${OBJCOPTS.$f:D4} == "4" \ |
|
|| ${CXXFLAGS.$f:D5} == "5") \ |
|
|| ("${f:M*.[cyl]}" == "" || commands(${f:R:S/$/.o/})) |
|
XOBJS+= ${f:R:S/$/.o/} |
|
.else |
|
XSRCS+= ${f} |
|
NODPSRCS+= ${f} |
|
.endif |
|
.endfor |
|
|
|
.if !empty(XOBJS) |
|
${XOBJS}: ${DPSRCS} |
|
.endif |
|
|
|
.if ${MKLDSCRIPT} == "yes" |
|
${KMODSCRIPT}: ${KMODSCRIPTSRC} ${XOBJS} $S/conf/mkldscript.sh |
|
@rm -f ${.TARGET} |
|
@OBJDUMP=${OBJDUMP} ${HOST_SH} $S/conf/mkldscript.sh \ |
|
-t ${KMODSCRIPTSRC} ${XOBJS} > ${.TARGET} |
|
.endif |
|
|
|
${PROG}: ${XOBJS} ${XSRCS} ${DPSRCS} ${DPADD} ${KMODSCRIPT} |
|
${CC} ${LDFLAGS} -nostdlib -MD -combine -r -Wl,-T,${KMODSCRIPT},-d \ |
|
-Wl,-Map=${.TARGET}.map \ |
|
-o ${.TARGET} ${CFLAGS} ${CPPFLAGS} ${XOBJS} \ |
|
${XSRCS:@.SRC.@${.ALLSRC:M*.c:M*${.SRC.}}@:O:u} && \ |
|
echo '.-include "${KMOD}.d"' > .depend |
|
|
|
.else |
OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/g} |
OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/g} |
|
|
${OBJS} ${LOBJS}: ${DPSRCS} |
${OBJS} ${LOBJS}: ${DPSRCS} |
Line 165 ${PROG}: ${OBJS} ${DPADD} ${KMODSCRIPT} |
|
Line 191 ${PROG}: ${OBJS} ${DPADD} ${KMODSCRIPT} |
|
-Wl,-Map=${.TARGET}.map \ |
-Wl,-Map=${.TARGET}.map \ |
-o ${.TARGET} ${OBJS} |
-o ${.TARGET} ${OBJS} |
.endif |
.endif |
|
.endif |
.if defined(CTFMERGE) |
.if defined(CTFMERGE) |
${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS} |
${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS} |
.endif |
.endif |
Line 172 ${PROG}: ${OBJS} ${DPADD} ${KMODSCRIPT} |
|
Line 199 ${PROG}: ${OBJS} ${DPADD} ${KMODSCRIPT} |
|
##### Install rules |
##### Install rules |
.if !target(kmodinstall) |
.if !target(kmodinstall) |
.if !defined(KMODULEDIR) |
.if !defined(KMODULEDIR) |
.if ${KERNEL_DIR:Uno} == "yes" |
|
KMODULEDIR= ${DESTDIR}/netbsd/modules/${KMOD} |
|
_INST_DIRS= ${DESTDIR}/netbsd |
|
_INST_DIRS+= ${DESTDIR}/netbsd/modules |
|
_INST_DIRS+= ${DESTDIR}/netbsd/modules/${KMOD} |
|
.else |
|
# Ensure these are recorded properly in METALOG on unprived installes: |
|
_OSRELEASE!= ${HOST_SH} $S/conf/osrelease.sh -k |
_OSRELEASE!= ${HOST_SH} $S/conf/osrelease.sh -k |
|
# Ensure these are recorded properly in METALOG on unprived installes: |
KMODULEARCHDIR?= ${MACHINE} |
KMODULEARCHDIR?= ${MACHINE} |
_INST_DIRS= ${DESTDIR}/stand/${KMODULEARCHDIR} |
_INST_DIRS= ${DESTDIR}/stand/${KMODULEARCHDIR} |
_INST_DIRS+= ${DESTDIR}/stand/${KMODULEARCHDIR}/${_OSRELEASE} |
_INST_DIRS+= ${DESTDIR}/stand/${KMODULEARCHDIR}/${_OSRELEASE} |
_INST_DIRS+= ${DESTDIR}/stand/${KMODULEARCHDIR}/${_OSRELEASE}/modules |
_INST_DIRS+= ${DESTDIR}/stand/${KMODULEARCHDIR}/${_OSRELEASE}/modules |
KMODULEDIR= ${DESTDIR}/stand/${KMODULEARCHDIR}/${_OSRELEASE}/modules/${KMOD} |
KMODULEDIR= ${DESTDIR}/stand/${KMODULEARCHDIR}/${_OSRELEASE}/modules/${KMOD} |
.endif |
.endif |
.endif |
|
_PROG:= ${KMODULEDIR}/${PROG} # installed path |
_PROG:= ${KMODULEDIR}/${PROG} # installed path |
|
|
.if ${MKUPDATE} == "no" |
.if ${MKUPDATE} == "no" |