Source-Changes-HG archive

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

[src/trunk]: src/share/mk From Greg A. Woods:



details:   https://anonhg.NetBSD.org/src/rev/2527b6ddc63f
branches:  trunk
changeset: 981865:2527b6ddc63f
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Mar 23 22:02:44 2021 +0000

description:
>From Greg A. Woods:
- add LDSTATIC to all the LINK rules, replacing CPPFLAGS which should not be
  used
- create new COMPILE_LINK rules that are like LINK rules but have CPPFLAGS
  where appropriate

diffstat:

 share/mk/sys.mk |  45 ++++++++++++++++++++++++++-------------------
 1 files changed, 26 insertions(+), 19 deletions(-)

diffs (158 lines):

diff -r 082b7d39f585 -r 2527b6ddc63f share/mk/sys.mk
--- a/share/mk/sys.mk   Tue Mar 23 21:19:08 2021 +0000
+++ b/share/mk/sys.mk   Tue Mar 23 22:02:44 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: sys.mk,v 1.145 2021/03/22 21:52:26 christos Exp $
+#      $NetBSD: sys.mk,v 1.146 2021/03/23 22:02:44 christos Exp $
 #      @(#)sys.mk      8.2 (Berkeley) 3/21/94
 #
 # This file contains the basic rules for make(1) and is read first
@@ -19,10 +19,11 @@
 AS?=           as
 AFLAGS?=
 COMPILE.s?=    ${CC} ${AFLAGS} ${AFLAGS.${<:T}} -c
-LINK.s?=       ${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${LDFLAGS}
+LINK.s?=       ${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${LDSTATIC} ${LDFLAGS}
 _ASM_TRADITIONAL_CPP=  -x assembler-with-cpp
 COMPILE.S?=    ${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${CPPFLAGS} ${_ASM_TRADITIONAL_CPP} -c
-LINK.S?=       ${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${CPPFLAGS} ${LDFLAGS}
+LINK.S?=       ${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${LDSTATIC} ${LDFLAGS}
+COMPILE_LINK.S?=${LINK.S} ${CPPFLAGS}
 
 CC?=           cc
 .if ${MACHINE_ARCH} == "sh3el" || ${MACHINE_ARCH} == "sh3eb"
@@ -42,7 +43,8 @@
 CFLAGS?=       ${DBG}
 LDFLAGS?=
 COMPILE.c?=    ${CC} ${CFLAGS} ${DTRACE_OPTS} ${CPPFLAGS} -c
-LINK.c?=       ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+LINK.c?=       ${CC} ${CFLAGS} ${LDSTATIC} ${LDFLAGS}
+COMPILE_LINK.c?=${LINK.c} ${CPPFLAGS}
 
 # C Type Format data is required for DTrace
 CTFFLAGS       ?=      -g -L VERSION
@@ -68,12 +70,14 @@
 _CXXSEED?=     ${BUILDSEED:D-frandom-seed=${__BUILDSEED:hash}}
 
 COMPILE.cc?=   ${CXX} ${_CXXSEED} ${CXXFLAGS} ${DTRACE_OPTS} ${CPPFLAGS} -c
-LINK.cc?=      ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+LINK.cc?=      ${CXX} ${CXXFLAGS} ${LDSTATIC} ${LDFLAGS}
+COMPILE_LINK.cc?=${LINK.cc} ${CPPFLAGS}
 
 OBJC?=         ${CC}
 OBJCFLAGS?=    ${CFLAGS}
 COMPILE.m?=    ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
-LINK.m?=       ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
+LINK.m?=       ${OBJC} ${OBJCFLAGS} ${LDSTATIC} ${LDFLAGS}
+LINK.m?=       ${LINK.m} ${CPPFLAGS}
 
 CPP?=          cpp
 CPPFLAGS?=
@@ -82,11 +86,14 @@
 FFLAGS?=       -O
 RFLAGS?=
 COMPILE.f?=    ${FC} ${FFLAGS} -c
-LINK.f?=       ${FC} ${FFLAGS} ${LDFLAGS}
+LINK.f?=       ${FC} ${FFLAGS} ${LDSTATIC} ${LDFLAGS}
+COMPILE_LINK.f?=${LINK.f} ${CPPFLAGS}
 COMPILE.F?=    ${FC} ${FFLAGS} ${CPPFLAGS} -c
-LINK.F?=       ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+LINK.F?=       ${FC} ${FFLAGS} ${LDSTATIC} ${LDFLAGS}
+COMPILE_LINK.F?=${LINK.F} ${CPPFLAGS}
 COMPILE.r?=    ${FC} ${FFLAGS} ${RFLAGS} -c
-LINK.r?=       ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+LINK.r?=       ${FC} ${FFLAGS} ${RFLAGS} ${LDSTATIC} ${LDFLAGS}
+COMPILE_LINK.r?=${LINK.r}
 
 INSTALL?=      install
 
@@ -122,7 +129,7 @@
 
 # C
 .c:
-       ${LINK.c} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS}
+       ${COMPILE_LINK.c} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS}
 .c.o:
        ${COMPILE.c} ${.IMPSRC} ${OBJECT_TARGET}
        ${CTFCONVERT_RUN}
@@ -137,7 +144,7 @@
 
 # C++
 .cc .cpp .cxx .C:
-       ${LINK.cc} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS}
+       ${COMPILE_LINK.cc} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS}
 .cc.o .cpp.o .cxx.o .C.o:
        ${COMPILE.cc} ${.IMPSRC} ${OBJECT_TARGET}
        ${CTFCONVERT_RUN}
@@ -148,7 +155,7 @@
 
 # Fortran/Ratfor
 .f:
-       ${LINK.f} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS}
+       ${COMPILE_LINK.f} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS}
 .f.o:
        ${COMPILE.f} ${.IMPSRC} ${OBJECT_TARGET}
        ${CTFCONVERT_RUN}
@@ -158,7 +165,7 @@
        rm -f ${.PREFIX}.o
 
 .F:
-       ${LINK.F} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS}
+       ${COMPILE_LINK.F} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS}
 .F.o:
        ${COMPILE.F} ${.IMPSRC} ${OBJECT_TARGET}
        ${CTFCONVERT_RUN}
@@ -168,7 +175,7 @@
        rm -f ${.PREFIX}.o
 
 .r:
-       ${LINK.r} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS}
+       ${COMPILE_LINK.r} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS}
 .r.o:
        ${COMPILE.r} ${.IMPSRC} ${OBJECT_TARGET}
        ${CTFCONVERT_RUN}
@@ -179,7 +186,7 @@
 
 # Pascal
 .p:
-       ${LINK.p} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS}
+       ${COMPILE_LINK.p} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS}
 .p.o:
        ${COMPILE.p} ${.IMPSRC} ${OBJECT_TARGET}
        ${CTFCONVERT_RUN}
@@ -190,7 +197,7 @@
 
 # Assembly
 .s:
-       ${LINK.s} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS}
+       ${COMPILE_LINK.s} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS}
 .s.o:
        ${COMPILE.s} ${.IMPSRC} ${OBJECT_TARGET}
        ${CTFCONVERT_RUN}
@@ -199,7 +206,7 @@
        ${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
        rm -f ${.PREFIX}.o
 .S:
-       ${LINK.S} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS}
+       ${COMPILE_LINK.S} ${EXEC_TARGET} ${.IMPSRC} ${LDLIBS}
 .S.o:
        ${COMPILE.S} ${.IMPSRC} ${OBJECT_TARGET}
        ${CTFCONVERT_RUN}
@@ -211,7 +218,7 @@
 # Lex
 .l:
        ${LEX.l} ${.IMPSRC}
-       ${LINK.c} ${EXEC_TARGET} lex.yy.c ${LDLIBS} -ll
+       ${COMPILE_LINK.c} ${EXEC_TARGET} lex.yy.c ${LDLIBS} -ll
        rm -f lex.yy.c
 .l.c:
        ${LEX.l} ${.IMPSRC}
@@ -225,7 +232,7 @@
 # Yacc
 .y:
        ${YACC.y} ${.IMPSRC}
-       ${LINK.c} ${EXEC_TARGET} y.tab.c ${LDLIBS}
+       ${COMPILE_LINK.c} ${EXEC_TARGET} y.tab.c ${LDLIBS}
        rm -f y.tab.c
 .y.c:
        ${YACC.y} ${.IMPSRC}



Home | Main Index | Thread Index | Old Index