diff --git a/share/mk/bsd.README b/share/mk/bsd.README index c4db43ea5699..ef93c55f73fc 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -125,10 +125,16 @@ The following variables are common: AFLAGS.${SRC} Flags dependent on source file name. +AFLAGS.${TARGET} + Flags dependent on output file name. ACFLAGS.${SRC} Flags dependent on source file name. +ACFLAGS.${TARGET} + Flags dependent on output file name. CFLAGS.${SRC} Flags dependent on source file name. +CFLAGS.${TARGET} + Flags dependent on output file name. CFLAGS.${COMPILER_TYPE} Flags dependent on compiler added to CFLAGS. CFLAGS.${MACHINE_ARCH} @@ -142,6 +148,8 @@ CXXFLAGS.${MACHINE_ARCH} Architectural flags added to CXXFLAGS. CXXFLAGS.${SRC} Flags dependent on source file name. +CXXFLAGS.${TARGET} + Flags dependent on output file name. COMPILER_FEATURES A list of features that the compiler supports. Zero or more of: @@ -336,14 +344,23 @@ LDADD Additional loader objects. Usually used for libraries. LDADD=-lutil -lcompat +LDADD.${TAREGT} + Loader objects dependent on output file name. + LDFLAGS Additional loader flags. Passed to the loader via CC, since that's used to link programs as well, so loader specific flags need to be prefixed with -Wl, to work. +LDFLAGS.${TARGET} + Flags dependent on output file name. + LIBADD Additional libraries. This is for base system libraries and is only valid inside of the /usr/src tree. Use LIBADD=name instead of LDADD=-lname. +LIBADD.${TARGET} + Libraries dependent on output file name. + LINKS The list of binary links; should be full pathnames, the linked-to file coming first, followed by the linked file. The files are hard-linked. For example, to link diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 00146a138fbd..3f4b64592fda 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -234,17 +234,25 @@ DEBUG_FILES_CFLAGS?= -g .if ${MK_WARNS} != "no" CFLAGS+= ${CWARNFLAGS:M*} ${CWARNFLAGS.${COMPILER_TYPE}} CFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} +CFLAGS+= ${CWARNFLAGS.${.TARGET:T}} .endif CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}} AFLAGS+= ${AFLAGS.${.IMPSRC:T}} +AFLAGS+= ${AFLAGS.${.TARGET:T}} ACFLAGS+= ${ACFLAGS.${.IMPSRC:T}} +ACFLAGS+= ${ACFLAGS.${.TARGET:T}} CFLAGS+= ${CFLAGS.${.IMPSRC:T}} +CFLAGS+= ${CFLAGS.${.TARGET:T}} CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}} +CXXFLAGS+= ${CXXFLAGS.${.TARGET:T}} LDFLAGS+= ${LDFLAGS.${LINKER_TYPE}} +LDFLAGS+= ${LDFLAGS.${.TARGET:T}} +LDADD+= ${LDADD.${.TARGET:T}} +LIBADD+= ${LIBADD.${.TARGET:T}} .if defined(SRCTOP) # Prevent rebuilding during install to support read-only objdirs.