Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Dec 2012 18:30:02 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244224 - head/share/mk
Message-ID:  <201212141830.qBEIU2Qq025332@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Fri Dec 14 18:30:01 2012
New Revision: 244224
URL: http://svnweb.freebsd.org/changeset/base/244224

Log:
  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

Modified:
  head/share/mk/bsd.lib.mk
  head/share/mk/bsd.prog.mk

Modified: head/share/mk/bsd.lib.mk
==============================================================================
--- head/share/mk/bsd.lib.mk	Fri Dec 14 16:28:10 2012	(r244223)
+++ head/share/mk/bsd.lib.mk	Fri Dec 14 18:30:01 2012	(r244224)
@@ -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,--
 .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)

Modified: head/share/mk/bsd.prog.mk
==============================================================================
--- head/share/mk/bsd.prog.mk	Fri Dec 14 16:28:10 2012	(r244223)
+++ head/share/mk/bsd.prog.mk	Fri Dec 14 18:30:01 2012	(r244224)
@@ -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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212141830.qBEIU2Qq025332>