Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

bsd.prog.mk: Avoid redefining $PROG target

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...
commit b4061d6cf8a3f9e959e064a3b5127b0172117fe6 1 parent 58700ca
John Marino authored Sascha Wildner committed

Showing 1 changed file with 2 additions and 0 deletions. Show diff stats Hide diff stats

  1. +2 0  share/mk/bsd.prog.mk
2  share/mk/bsd.prog.mk
@@ -32,12 +32,14 @@ LDADD+= ${OBJCLIBS}
32 32
33 33 OBJS+= ${SRCS:N*.h:N*.patch:R:S/$/.o/g}
34 34
  35 +.if !target(${PROG})
35 36 ${PROG}: ${OBJS}
36 37 .if defined(PROG_CXX)
37 38 ${CXX_LINK} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
38 39 .else
39 40 ${CC_LINK} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
40 41 .endif
  42 +.endif
41 43
42 44 .else # !defined(SRCS)
43 45

0 comments on commit b4061d6

Please sign in to comment.
Something went wrong with that request. Please try again.