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
This commit is contained in:
Ed Maste 2012-12-14 18:30:01 +00:00
parent 349d039bdb
commit 0d947ed19a
2 changed files with 9 additions and 14 deletions

View File

@ -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)

View File

@ -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"