Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/mk do the dependencies in a simpler way using a separa...



details:   https://anonhg.NetBSD.org/src/rev/3cb42ff45cc1
branches:  trunk
changeset: 333665:3cb42ff45cc1
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Nov 13 02:31:24 2014 +0000

description:
do the dependencies in a simpler way using a separate target

diffstat:

 share/mk/bsd.kmodule.mk |  29 +++++++++++++++--------------
 1 files changed, 15 insertions(+), 14 deletions(-)

diffs (67 lines):

diff -r e755a4e9bb73 -r 3cb42ff45cc1 share/mk/bsd.kmodule.mk
--- a/share/mk/bsd.kmodule.mk   Thu Nov 13 01:09:59 2014 +0000
+++ b/share/mk/bsd.kmodule.mk   Thu Nov 13 02:31:24 2014 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.kmodule.mk,v 1.51 2014/11/13 01:09:59 uebayasi Exp $
+#      $NetBSD: bsd.kmodule.mk,v 1.52 2014/11/13 02:31:24 christos Exp $
 
 # We are not building this with PIE
 MKPIE=no
@@ -79,6 +79,7 @@
 .endif
 .if ${MKLDSCRIPT} == "yes"
 KMODSCRIPT=    kldscript
+MKLDSCRIPTSH=  
 .else
 KMODSCRIPT=    ${KMODSCRIPTSRC}
 .endif
@@ -106,14 +107,14 @@
 ${XOBJS}:      ${DPSRCS}
 .endif
 
-${PROG}: ${XOBJS} ${XSRCS} ${DPSRCS} ${DPADD} \
-    ${"${MKLDSCRIPT}" == "yes":?$S/conf/mkldscript.sh ${KMODSCRIPTSRC}:}
-       ${_MKTARGET_LINK}
 .if ${MKLDSCRIPT} == "yes"
-       @rm -f ${KMODSCRIPT}
+${KMODSCRIPT}: ${KMODSCRIPTSRC} ${XOBJS} $S/conf/mkldscript.sh
+       @rm -f ${.TARGET}
        @OBJDUMP=${OBJDUMP} ${HOST_SH} $S/conf/mkldscript.sh \
-           -t ${KMODSCRIPTSRC} ${OBJS} > ${KMODSCRIPT}
+           -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} \
@@ -125,6 +126,13 @@
 
 ${OBJS} ${LOBJS}: ${DPSRCS}
 
+.if ${MKLDSCRIPT} == "yes"
+${KMODSCRIPT}: ${KMODSCRIPTSRC} ${OBJS} $S/conf/mkldscript.sh
+       @rm -f ${.TARGET}
+       @OBJDUMP=${OBJDUMP} ${HOST_SH} $S/conf/mkldscript.sh \
+           -t ${KMODSCRIPTSRC} ${OBJS} > ${.TARGET}
+.endif
+
 .if ${MACHINE_CPU} == "arm"
 # The solution to limited branch space involves generating trampolines for
 # those relocations while creating the module, as the resulting code will
@@ -161,14 +169,7 @@
            -o ${.TARGET} ${KMOD}_tmp.o ${KMOD}_tramp.o
 .endif
 .else
-${PROG}: ${OBJS} ${DPADD} \
-    ${"${MKLDSCRIPT}" == "yes":?$S/conf/mkldscript.sh ${KMODSCRIPTSRC}:}
-       ${_MKTARGET_LINK}
-.if ${MKLDSCRIPT} == "yes"
-       @rm -f ${KMODSCRIPT}
-       @OBJDUMP=${OBJDUMP} ${HOST_SH} $S/conf/mkldscript.sh \
-           -t ${KMODSCRIPTSRC} ${OBJS} > ${KMODSCRIPT}
-.endif
+${PROG}: ${OBJS} ${DPADD} ${KMODSCRIPT}
        ${CC} ${LDFLAGS} -nostdlib -r -Wl,-T,${KMODSCRIPT},-d \
                -Wl,-Map=${.TARGET}.map \
                -o ${.TARGET} ${OBJS}



Home | Main Index | Thread Index | Old Index