Skip to content

Commit

Permalink
bsd.prog.mk: Avoid redefining $PROG target
Browse files Browse the repository at this point in the history
In rare cases, the PROG target is intentionally redefined before
including bsd.prog.mk, but when that happens a target redefinition
warning is emitting.  This adds a check for a pre-existing $PROG
target before attempting to define it.

It stops warnings from being emitted when loader and loader_tftp
are built.
  • Loading branch information
John Marino authored and Sascha Wildner committed Oct 4, 2012
1 parent 58700ca commit b4061d6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions share/mk/bsd.prog.mk
Expand Up @@ -32,12 +32,14 @@ LDADD+= ${OBJCLIBS}


OBJS+= ${SRCS:N*.h:N*.patch:R:S/$/.o/g} OBJS+= ${SRCS:N*.h:N*.patch:R:S/$/.o/g}


.if !target(${PROG})
${PROG}: ${OBJS} ${PROG}: ${OBJS}
.if defined(PROG_CXX) .if defined(PROG_CXX)
${CXX_LINK} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} ${CXX_LINK} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
.else .else
${CC_LINK} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} ${CC_LINK} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
.endif .endif
.endif


.else # !defined(SRCS) .else # !defined(SRCS)


Expand Down

0 comments on commit b4061d6

Please sign in to comment.