Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Feb 1998 19:34:07 +0100
From:      Eivind Eklund <eivind@yes.no>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   Suggested change to bsd.prog.mk
Message-ID:  <19980215193407.36627@follo.net>

next in thread | raw e-mail | index | archive | help
Index: bsd.prog.mk
===================================================================
RCS file: /home/ncvs/src/share/mk/bsd.prog.mk,v
retrieving revision 1.59
diff -u -r1.59 bsd.prog.mk
--- bsd.prog.mk 1997/12/18 12:56:52     1.59
+++ bsd.prog.mk 1998/02/15 18:13:45
@@ -25,6 +25,7 @@
 .endif
 
 .if defined(PROG)
+.if !target(${PROG})
 .if defined(SRCS)
 
 DPSRCS+= ${SRCS:M*.h}
@@ -47,6 +48,7 @@
        ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDDESTDIR} ${LDADD}
 
 .endif
+.endif
 
 .if    !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \
        !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \


Do anybody see any negative effects of not trying to transform PROG
from C source if the target is already defined?

It fixes some of my problems; specifically, it allows a Makefile like
the below to work:

PROG=testprog
NOMAN=yes
STRIP=

${PROG}: ${PROG}.pl
        install -c -m 555 ${.CURDIR}/${PROG}.pl ${.OBJDIR}/${PROG}

.include <bsd.prog.mk>


This is IMHO much better than the beforeinstall: hacks that are spread
around the FreeBSD source tree.  It seems less like a hack, and allow
one to use ${.OBJDIR}/${PROG} for direct execution.  The above is
actually a slightly edited Makefile from my build-cycle, and
'testprog' is never installed anywhere, but just used in place.

Eivind.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



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