From owner-freebsd-hackers Sun Feb 15 10:34:53 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA04156 for freebsd-hackers-outgoing; Sun, 15 Feb 1998 10:34:53 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from ns1.yes.no (ns1.yes.no [195.119.24.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA04149 for ; Sun, 15 Feb 1998 10:34:49 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [194.198.43.36]) by ns1.yes.no (8.8.7/8.8.7) with ESMTP id SAA04648 for ; Sun, 15 Feb 1998 18:34:07 GMT Received: (from eivind@localhost) by bitbox.follo.net (8.8.6/8.8.6) id TAA03394; Sun, 15 Feb 1998 19:34:07 +0100 (MET) Message-ID: <19980215193407.36627@follo.net> Date: Sun, 15 Feb 1998 19:34:07 +0100 From: Eivind Eklund To: freebsd-hackers@FreeBSD.ORG Subject: Suggested change to bsd.prog.mk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 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