From 0d947ed19ab8149541b513c44c3a22c4d9290002 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Fri, 14 Dec 2012 18:30:01 +0000 Subject: [PATCH] Minor refactoring prior to .symbols file changes - Combine .if x and .if !x using .else - Separate out beforelinking dependency - Add comments to clarify .if nesting Sponsored by: ADARA Networks --- share/mk/bsd.lib.mk | 9 +++------ share/mk/bsd.prog.mk | 14 ++++++-------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 2c96df1f923e..0335d53c32f8 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -39,9 +39,7 @@ CFLAGS+= ${DEBUG_FLAGS} .if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" CTFFLAGS+= -g .endif -.endif - -.if !defined(DEBUG_FLAGS) +.else STRIP?= -s .endif @@ -173,10 +171,9 @@ SOLINKOPTS+= -Wl,--fatal-warnings -Wl,--warn-shared-textrel .endif .if target(beforelinking) -${SHLIB_NAME}: ${SOBJS} beforelinking -.else -${SHLIB_NAME}: ${SOBJS} +${SHLIB_NAME}: beforelinking .endif +${SHLIB_NAME}: ${SOBJS} @${ECHO} building shared library ${SHLIB_NAME} @rm -f ${.TARGET} ${SHLIB_LINK} .if defined(SHLIB_LINK) diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 3c306eb75fe8..950d3817568c 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -46,10 +46,9 @@ PROG= ${PROG_CXX} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} .if target(beforelinking) -${PROG}: ${OBJS} beforelinking -.else -${PROG}: ${OBJS} +${PROG}: beforelinking .endif +${PROG}: ${OBJS} .if defined(PROG_CXX) ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .else @@ -76,10 +75,9 @@ SRCS= ${PROG}.c OBJS= ${PROG}.o .if target(beforelinking) -${PROG}: ${OBJS} beforelinking -.else -${PROG}: ${OBJS} +${PROG}: beforelinking .endif +${PROG}: ${OBJS} .if defined(PROG_CXX) ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .else @@ -90,7 +88,7 @@ ${PROG}: ${OBJS} .endif .endif -.endif +.endif # !defined(SRCS) .if ${MK_MAN} != "no" && !defined(MAN) && \ !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \ @@ -100,7 +98,7 @@ ${PROG}: ${OBJS} MAN= ${PROG}.1 MAN1= ${MAN} .endif -.endif +.endif # defined(PROG) all: objwarn ${PROG} ${SCRIPTS} .if ${MK_MAN} != "no"