From owner-p4-projects@FreeBSD.ORG Fri Aug 2 03:47:06 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DA917E81; Fri, 2 Aug 2013 03:47:05 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8BCDBE7F for ; Fri, 2 Aug 2013 03:47:05 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [8.8.178.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7917F227F for ; Fri, 2 Aug 2013 03:47:05 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.7/8.14.7) with ESMTP id r723l5CZ029597 for ; Fri, 2 Aug 2013 03:47:05 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.7/8.14.6/Submit) id r723l5Z9029594 for perforce@freebsd.org; Fri, 2 Aug 2013 03:47:05 GMT (envelope-from brooks@freebsd.org) Date: Fri, 2 Aug 2013 03:47:05 GMT Message-Id: <201308020347.r723l5Z9029594@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis Subject: PERFORCE change 231637 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Aug 2013 03:47:06 -0000 http://p4web.freebsd.org/@@231637?ac=10 Change 231637 by brooks@brooks_zenith on 2013/08/02 03:46:08 Simplify the generation of make rules and reduce duplicate code. Affected files ... .. //depot/projects/ctsrd/tesla/src/share/mk/bsd.prog.mk#8 edit Differences ... ==== //depot/projects/ctsrd/tesla/src/share/mk/bsd.prog.mk#8 (text+ko) ==== @@ -42,39 +42,17 @@ .if defined(PROG) PROGNAME?= ${PROG} -.if defined(SRCS) -OBJS+= ${SRCS:N*.h:R:S/$/.o/g} - -.if target(beforelinking) -beforelinking: ${OBJS} -${PROG}: beforelinking -.endif -${PROG}: ${OBJS} -.if defined(PROG_CXX) - ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} -.else - ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} -.endif -.if ${MK_CTF} != "no" - ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} -.endif - -.else # !defined(SRCS) - -.if !target(${PROG}) +.if !defined(SRCS) && !target(${PROG}) .if defined(PROG_CXX) SRCS= ${PROG}.cc .else SRCS= ${PROG}.c .endif +.endif -# Always make an intermediate object file because: -# - it saves time rebuilding when only the library has changed -# - the name of the object gets put into the executable symbol table instead of -# the name of a variable temporary object. -# - it's useful to keep objects around for crunching. -OBJS+= ${PROG}.o +.if defined(SRCS) && !empty(SRCS) +OBJS+= ${SRCS:N*.h:R:S/$/.o/g} .if target(beforelinking) beforelinking: ${OBJS} @@ -91,8 +69,6 @@ .endif .endif -.endif # !defined(SRCS) - # XXX: forced assignment due to make not figuring out how to make things # from generated .c files (which are added to SRCS later). CSRC_OBJS:= ${SRCS:M*.c:R:S/$/.object/:N.object}