From owner-freebsd-arch@FreeBSD.ORG Mon Aug 25 07:16:59 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02E02106566B; Mon, 25 Aug 2008 07:16:59 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 8999C8FC12; Mon, 25 Aug 2008 07:16:58 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m7P7Ei5c032983; Mon, 25 Aug 2008 01:14:44 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 25 Aug 2008 01:15:13 -0600 (MDT) Message-Id: <20080825.011513.-432836673.imp@bsdimp.com> To: arch@freebsd.org, ru@freebsd.org From: "M. Warner Losh" X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Mon_Aug_25_01_15_13_2008_547)--" Content-Transfer-Encoding: 7bit Cc: Subject: Code review: using ${.TARGET} instead of opt_*.h X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Aug 2008 07:16:59 -0000 ----Next_Part(Mon_Aug_25_01_15_13_2008_547)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit [[ resent with attachment]] I was cleaning out my tree, and noticed that I took a stab at solving the problem opt_*.h being explicitly named in rules rather than ${.TARGET} when building modules. Comments? Warner ----Next_Part(Mon_Aug_25_01_15_13_2008_547)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="make-target.diff" Index: wlan_wep/Makefile =================================================================== --- wlan_wep/Makefile (revision 182150) +++ wlan_wep/Makefile (working copy) @@ -8,7 +8,7 @@ .if !defined(KERNBUILDDIR) opt_wlan.h: - echo "#define IEEE80211_DEBUG 1" > opt_wlan.h + echo "#define IEEE80211_DEBUG 1" > ${.TARGET} .endif .include Index: wlan_amrr/Makefile =================================================================== --- wlan_amrr/Makefile (revision 182150) +++ wlan_amrr/Makefile (working copy) @@ -8,7 +8,7 @@ .if !defined(KERNBUILDDIR) opt_wlan.h: - echo "#define IEEE80211_DEBUG 1" > opt_wlan.h + echo "#define IEEE80211_DEBUG 1" > ${.TARGET} .endif .include Index: digi/digi/Makefile =================================================================== --- digi/digi/Makefile (revision 182150) +++ digi/digi/Makefile (working copy) @@ -9,8 +9,8 @@ .if !defined(KERNBUILDDIR) opt_compat.h: - echo "#define COMPAT_43 1" > opt_compat.h - echo "#define COMPAT_FREEBSD6 1" >> opt_compat.h + echo "#define COMPAT_43 1" > ${.TARGET} + echo "#define COMPAT_FREEBSD6 1" >> ${.TARGET} .endif .include Index: wlan_acl/Makefile =================================================================== --- wlan_acl/Makefile (revision 182150) +++ wlan_acl/Makefile (working copy) @@ -8,7 +8,7 @@ .if !defined(KERNBUILDDIR) opt_wlan.h: - echo "#define IEEE80211_DEBUG 1" > opt_wlan.h + echo "#define IEEE80211_DEBUG 1" > ${.TARGET} .endif .include Index: netgraph/sync_ar/Makefile =================================================================== --- netgraph/sync_ar/Makefile (revision 182150) +++ netgraph/sync_ar/Makefile (working copy) @@ -1,13 +1,13 @@ # $FreeBSD$ - + .PATH: ${.CURDIR}/../../../dev/ar KMOD = ng_sync_ar SRCS = if_ar.c if_ar_isa.c if_ar_pci.c SRCS += device_if.h bus_if.h pci_if.h isa_if.h opt_netgraph.h - + .if !defined(KERNBUILDDIR) opt_netgraph.h: - echo "#define NETGRAPH" > opt_netgraph.h + echo "#define NETGRAPH" > ${.TARGET} .endif .include Index: netgraph/sync_sr/Makefile =================================================================== --- netgraph/sync_sr/Makefile (revision 182150) +++ netgraph/sync_sr/Makefile (working copy) @@ -1,13 +1,13 @@ # $FreeBSD$ - + .PATH: ${.CURDIR}/../../../dev/sr KMOD = ng_sync_sr SRCS = if_sr.c if_sr_isa.c if_sr_pci.c SRCS += device_if.h bus_if.h pci_if.h isa_if.h opt_netgraph.h - + .if !defined(KERNBUILDDIR) opt_netgraph.h: - echo "#define NETGRAPH" > opt_netgraph.h + echo "#define NETGRAPH" > ${.TARGET} .endif .include Index: aha/Makefile =================================================================== --- aha/Makefile (revision 182150) +++ aha/Makefile (working copy) @@ -8,7 +8,7 @@ .if !defined(KERNBUILDDIR) opt_scsi.h: - echo "#define SCSI_DELAY 15000" > opt_scsi.h + echo "#define SCSI_DELAY 15000" > ${.TARGET} .endif .include Index: ahb/Makefile =================================================================== --- ahb/Makefile (revision 182150) +++ ahb/Makefile (working copy) @@ -3,12 +3,11 @@ .PATH: ${.CURDIR}/../../dev/ahb KMOD= ahb -SRCS= ahb.c opt_cam.h device_if.h bus_if.h \ - eisa_if.h opt_scsi.h +SRCS= ahb.c opt_cam.h device_if.h bus_if.h eisa_if.h opt_scsi.h .if !defined(KERNBUILDDIR) opt_scsi.h: - echo "#define SCSI_DELAY 15000" > opt_scsi.h + echo "#define SCSI_DELAY 15000" > ${.TARGET} .endif .include Index: svr4/Makefile =================================================================== --- svr4/Makefile (revision 182150) +++ svr4/Makefile (working copy) @@ -26,11 +26,11 @@ .if !defined(KERNBUILDDIR) opt_compat.h: - echo "#define COMPAT_43 1" > opt_compat.h + echo "#define COMPAT_43 1" > ${.TARGET} .if defined(DEBUG) opt_svr4.h: - echo "#define DEBUG_SVR4 1" > opt_svr4.h + echo "#define DEBUG_SVR4 1" > ${.TARGET} .endif .endif Index: patm/Makefile =================================================================== --- patm/Makefile (revision 182150) +++ patm/Makefile (working copy) @@ -14,10 +14,10 @@ .if !defined(KERNBUILDDIR) opt_inet.h: - echo "#define INET 1" > opt_inet.h + echo "#define INET 1" > ${.TARGET} opt_natm.h: - echo "#define NATM 1" > opt_natm.h + echo "#define NATM 1" > ${.TARGET} .endif .include Index: trm/Makefile =================================================================== --- trm/Makefile (revision 182150) +++ trm/Makefile (working copy) @@ -8,7 +8,7 @@ .if !defined(KERNBUILDDIR) opt_scsi.h: - echo "#define SCSI_DELAY 15000" > opt_scsi.h + echo "#define SCSI_DELAY 15000" > ${.TARGET} .endif .include Index: wlan_rssadapt/Makefile =================================================================== --- wlan_rssadapt/Makefile (revision 182150) +++ wlan_rssadapt/Makefile (working copy) @@ -8,7 +8,7 @@ .if !defined(KERNBUILDDIR) opt_wlan.h: - echo "#define IEEE80211_DEBUG 1" > opt_wlan.h + echo "#define IEEE80211_DEBUG 1" > ${.TARGET} .endif .include Index: fatm/Makefile =================================================================== --- fatm/Makefile (revision 182150) +++ fatm/Makefile (working copy) @@ -11,10 +11,10 @@ .if !defined(KERNBUILDDIR) opt_inet.h: - echo "#define INET 1" > opt_inet.h + echo "#define INET 1" > ${.TARGET} opt_natm.h: - echo "#define NATM 1" > opt_natm.h + echo "#define NATM 1" > ${.TARGET} .endif .include Index: ubsec/Makefile =================================================================== --- ubsec/Makefile (revision 182150) +++ ubsec/Makefile (working copy) @@ -8,7 +8,7 @@ .if !defined(KERNBUILDDIR) opt_ubsec.h: - echo "#define UBSEC_DEBUG 1" > opt_ubsec.h + echo "#define UBSEC_DEBUG 1" > ${.TARGET} .endif .include Index: ath_rate_onoe/Makefile =================================================================== --- ath_rate_onoe/Makefile (revision 182150) +++ ath_rate_onoe/Makefile (working copy) @@ -61,8 +61,8 @@ .if !defined(KERNBUILDDIR) opt_wlan.h: - echo "#define IEEE80211_DEBUG 1" > opt_wlan.h -# echo > opt_wlan.h + echo "#define IEEE80211_DEBUG 1" > ${.TARGET} +# echo > ${.TARGET} .endif .include Index: pf/Makefile =================================================================== --- pf/Makefile (revision 182150) +++ pf/Makefile (working copy) @@ -15,20 +15,20 @@ .if !defined(KERNBUILDDIR) opt_inet.h: - echo "#define INET 1" > opt_inet.h + echo "#define INET 1" > ${.TARGET} .if ${MK_INET6_SUPPORT} != "no" opt_inet6.h: - echo "#define INET6 1" > opt_inet6.h + echo "#define INET6 1" > ${.TARGET} .endif opt_bpf.h: - echo "#define DEV_BPF 1" > opt_bpf.h + echo "#define DEV_BPF 1" > ${.TARGET} # pflog can be loaded as a module, have the additional checks turned on opt_pf.h: - echo "#define DEV_PF 1" > opt_pf.h - echo "#define DEF_PFLOG 1" >> opt_pf.h + echo "#define DEV_PF 1" > ${.TARGET} + echo "#define DEF_PFLOG 1" >> ${.TARGET} .endif .include Index: sppp/Makefile =================================================================== --- sppp/Makefile (revision 182150) +++ sppp/Makefile (working copy) @@ -17,13 +17,13 @@ .if !defined(KERNBUILDDIR) opt_inet.h: - echo "#define INET 1" > opt_inet.h + echo "#define INET 1" > ${.TARGET} opt_inet6.h: - echo "#define INET6 1" > opt_inet6.h + echo "#define INET6 1" > ${.TARGET} opt_ipx.h: - echo "#define IPX 1" > opt_ipx.h + echo "#define IPX 1" > ${.TARGET} .endif .include Index: an/Makefile =================================================================== --- an/Makefile (revision 182150) +++ an/Makefile (working copy) @@ -9,7 +9,7 @@ .if !defined(KERNBUILDDIR) opt_inet.h: - echo "#define INET 1" > opt_inet.h + echo "#define INET 1" > ${.TARGET} .endif .include Index: ar/Makefile =================================================================== --- ar/Makefile (revision 182150) +++ ar/Makefile (working copy) @@ -10,7 +10,7 @@ .if ${NETGRAPH} != 0 opt_netgraph.h: - echo "#define NETGRAPH ${NETGRAPH}" > opt_netgraph.h + echo "#define NETGRAPH ${NETGRAPH}" > ${.TARGET} .endif .endif Index: wlan_xauth/Makefile =================================================================== --- wlan_xauth/Makefile (revision 182150) +++ wlan_xauth/Makefile (working copy) @@ -8,7 +8,7 @@ .if !defined(KERNBUILDDIR) opt_wlan.h: - echo "#define IEEE80211_DEBUG 1" > opt_wlan.h + echo "#define IEEE80211_DEBUG 1" > ${.TARGET} .endif .include Index: ath_rate_sample/Makefile =================================================================== --- ath_rate_sample/Makefile (revision 182150) +++ ath_rate_sample/Makefile (working copy) @@ -61,8 +61,8 @@ .if !defined(KERNBUILDDIR) opt_wlan.h: -# echo "#define IEEE80211_DEBUG 1" > opt_wlan.h - echo > opt_wlan.h +# echo "#define IEEE80211_DEBUG 1" > ${.TARGET} + echo > ${.TARGET} .endif .include Index: rp/Makefile =================================================================== --- rp/Makefile (revision 182150) +++ rp/Makefile (working copy) @@ -7,7 +7,7 @@ .if !defined(KERNBUILDDIR) opt_compat.h: - echo "#define COMPAT_43 1" > opt_compat.h + echo "#define COMPAT_43 1" > ${.TARGET} .endif .include Index: ce/Makefile =================================================================== --- ce/Makefile (revision 182150) +++ ce/Makefile (working copy) @@ -16,12 +16,12 @@ .if ${NETGRAPH} != 0 opt_netgraph.h: - echo "#define NETGRAPH ${NETGRAPH}" > opt_netgraph.h + echo "#define NETGRAPH ${NETGRAPH}" > ${.TARGET} .endif .if ${NG_CRONYX} != 0 opt_ng_cronyx.h: - echo "#define NETGRAPH_CRONYX 1" > opt_ng_cronyx.h + echo "#define NETGRAPH_CRONYX 1" > ${.TARGET} .endif .endif Index: cp/Makefile =================================================================== --- cp/Makefile (revision 182150) +++ cp/Makefile (working copy) @@ -16,12 +16,12 @@ .if ${NETGRAPH} != 0 opt_netgraph.h: - echo "#define NETGRAPH ${NETGRAPH}" > opt_netgraph.h + echo "#define NETGRAPH ${NETGRAPH}" > ${.TARGET} .endif .if ${NG_CRONYX} != 0 opt_ng_cronyx.h: - echo "#define NETGRAPH_CRONYX 1" > opt_ng_cronyx.h + echo "#define NETGRAPH_CRONYX 1" > ${.TARGET} .endif .endif Index: pflog/Makefile =================================================================== --- pflog/Makefile (revision 182150) +++ pflog/Makefile (working copy) @@ -12,15 +12,15 @@ .if !defined(KERNBUILDDIR) opt_inet.h: - echo "#define INET 1" > opt_inet.h + echo "#define INET 1" > ${.TARGET} .if ${MK_INET6_SUPPORT} != "no" opt_inet6.h: - echo "#define INET6 1" > opt_inet6.h + echo "#define INET6 1" > ${.TARGET} .endif opt_bpf.h: - echo "#define DEV_BPF 1" > opt_bpf.h + echo "#define DEV_BPF 1" > ${.TARGET} .endif .include Index: cx/Makefile =================================================================== --- cx/Makefile (revision 182150) +++ cx/Makefile (working copy) @@ -15,12 +15,12 @@ .if ${NETGRAPH} != 0 opt_netgraph.h: - echo "#define NETGRAPH $(NETGRAPH)" > opt_netgraph.h + echo "#define NETGRAPH $(NETGRAPH)" > ${.TARGET} .endif .if ${NG_CRONYX} != 0 opt_ng_cronyx.h: - echo "#define NETGRAPH_CRONYX 1" > opt_ng_cronyx.h + echo "#define NETGRAPH_CRONYX 1" > ${.TARGET} .endif .endif Index: sr/Makefile =================================================================== --- sr/Makefile (revision 182150) +++ sr/Makefile (working copy) @@ -10,7 +10,7 @@ .if ${NETGRAPH} != 0 opt_netgraph.h: - echo "#define NETGRAPH ${NETGRAPH}" > opt_netgraph.h + echo "#define NETGRAPH ${NETGRAPH}" > ${.TARGET} .endif .endif Index: hatm/Makefile =================================================================== --- hatm/Makefile (revision 182150) +++ hatm/Makefile (working copy) @@ -13,10 +13,10 @@ .if !defined(KERNBUILDDIR) opt_inet.h: - echo "#define INET 1" > opt_inet.h + echo "#define INET 1" > ${.TARGET} opt_natm.h: - echo "#define NATM 1" > opt_natm.h + echo "#define NATM 1" > ${.TARGET} .endif .include Index: wlan/Makefile =================================================================== --- wlan/Makefile (revision 182150) +++ wlan/Makefile (working copy) @@ -14,14 +14,14 @@ .if !defined(KERNBUILDDIR) opt_wlan.h: - echo "#define IEEE80211_DEBUG 1" > opt_wlan.h - echo "#define IEEE80211_AMDPU_AGE 1" >> opt_wlan.h + echo "#define IEEE80211_DEBUG 1" > ${.TARGET} + echo "#define IEEE80211_AMDPU_AGE 1" >> ${.TARGET} opt_inet.h: - echo "#define INET 1" > opt_inet.h + echo "#define INET 1" > ${.TARGET} opt_ipx.h: - echo "#define IPX 1" > opt_ipx.h + echo "#define IPX 1" > ${.TARGET} .endif .include Index: ath_rate_amrr/Makefile =================================================================== --- ath_rate_amrr/Makefile (revision 182150) +++ ath_rate_amrr/Makefile (working copy) @@ -61,8 +61,8 @@ .if !defined(KERNBUILDDIR) opt_wlan.h: -# echo "#define IEEE80211_DEBUG 1" > opt_wlan.h - echo > opt_wlan.h +# echo "#define IEEE80211_DEBUG 1" > ${.TARGET} + echo > ${.TARGET} .endif .include Index: hifn/Makefile =================================================================== --- hifn/Makefile (revision 182150) +++ hifn/Makefile (working copy) @@ -8,7 +8,7 @@ .if !defined(KERNBUILDDIR) opt_hifn.h: - echo "#define HIFN_DEBUG 1" > opt_hifn.h + echo "#define HIFN_DEBUG 1" > ${.TARGET} .endif .include Index: wlan_tkip/Makefile =================================================================== --- wlan_tkip/Makefile (revision 182150) +++ wlan_tkip/Makefile (working copy) @@ -8,7 +8,7 @@ .if !defined(KERNBUILDDIR) opt_wlan.h: - echo "#define IEEE80211_DEBUG 1" > opt_wlan.h + echo "#define IEEE80211_DEBUG 1" > ${.TARGET} .endif .include Index: linux/Makefile =================================================================== --- linux/Makefile (revision 182150) +++ linux/Makefile (working copy) @@ -54,7 +54,7 @@ .if !defined(KERNBUILDDIR) opt_inet6.h: - echo "#define INET6 1" > opt_inet6.h + echo "#define INET6 1" > ${.TARGET} .endif .include Index: wlan_ccmp/Makefile =================================================================== --- wlan_ccmp/Makefile (revision 182150) +++ wlan_ccmp/Makefile (working copy) @@ -10,7 +10,7 @@ .if !defined(KERNBUILDDIR) opt_wlan.h: - echo "#define IEEE80211_DEBUG 1" > opt_wlan.h + echo "#define IEEE80211_DEBUG 1" > ${.TARGET} .endif .include Index: safe/Makefile =================================================================== --- safe/Makefile (revision 182150) +++ safe/Makefile (working copy) @@ -34,7 +34,7 @@ .if !defined(KERNBUILDDIR) opt_safe.h: - echo "#define SAFE_DEBUG 1" > opt_safe.h + echo "#define SAFE_DEBUG 1" > ${.TARGET} .endif .include Index: if_tap/Makefile =================================================================== --- if_tap/Makefile (revision 182150) +++ if_tap/Makefile (working copy) @@ -12,7 +12,7 @@ echo "#define COMPAT_FREEBSD6 1" > ${.TARGET} opt_inet.h: - echo "#define INET 1" > opt_inet.h + echo "#define INET 1" > ${.TARGET} .endif .include Index: ctau/Makefile =================================================================== --- ctau/Makefile (revision 182150) +++ ctau/Makefile (working copy) @@ -15,12 +15,12 @@ .if ${NETGRAPH} != 0 opt_netgraph.h: - echo "#define NETGRAPH $(NETGRAPH)" > opt_netgraph.h + echo "#define NETGRAPH $(NETGRAPH)" > ${.TARGET} .endif .if ${NG_CRONYX} != 0 opt_ng_cronyx.h: - echo "#define NETGRAPH_CRONYX 1" > opt_ng_cronyx.h + echo "#define NETGRAPH_CRONYX 1" > ${.TARGET} .endif .endif ----Next_Part(Mon_Aug_25_01_15_13_2008_547)----