Use MACHINE_CPUARCH in preference to MACHINE_ARCH.  The former is the
source code location of the machine, the latter the binary output.  In
general, we want to use MACHINE_CPUARCH instead of MACHINE_ARCH unless
we're tesitng for a specific target.  The isn't even moot for
i386/amd64 where there's momemntum towards a MACHINE_CPUARCH == x86,
although a specific cleanup for that likely would be needed...
This commit is contained in:
Warner Losh 2010-08-23 06:13:29 +00:00
parent 90db41b62b
commit c09808d0d6
35 changed files with 74 additions and 70 deletions

View File

@ -323,8 +323,8 @@ SUBDIR= ${_3dfx} \
${_zfs} \
zlib \
.if ${MACHINE_CPUARCH} != "powerpc" && ${MACHINE_ARCH} != "arm" && \
${MACHINE_ARCH} != "mips"
.if ${MACHINE_CPUARCH} != "powerpc" && ${MACHINE_CPUARCH} != "arm" && \
${MACHINE_CPUARCH} != "mips"
_syscons= syscons
_vpo= vpo
.endif
@ -360,7 +360,7 @@ _pf= pf
_pflog= pflog
.endif
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
# XXX some of these can move to the general case when de-i386'ed
# XXX some of these can move now, but are untested on other architectures.
_3dfx= 3dfx
@ -500,7 +500,7 @@ _snc= snc
.endif
.endif
.if ${MACHINE_ARCH} == "amd64"
.if ${MACHINE_CPUARCH} == "amd64"
_aac= aac
_acpi= acpi
.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
@ -590,7 +590,7 @@ _zfs= zfs
.endif
.endif
.if ${MACHINE_ARCH} == "ia64"
.if ${MACHINE_CPUARCH} == "ia64"
_aac= aac
_aic= aic
_an= an
@ -647,7 +647,7 @@ _zfs= zfs
.endif
.endif
.if ${MACHINE_ARCH} == "sparc64"
.if ${MACHINE_CPUARCH} == "sparc64"
_auxio= auxio
_em= em
_epic= epic

View File

@ -2,7 +2,7 @@
.PATH: ${.CURDIR}/../../dev/aac
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
SUBDIR= aac_linux
.endif

View File

@ -1,6 +1,6 @@
# $FreeBSD$
.if ${MACHINE_ARCH} == "ia64"
.if ${MACHINE_CPUARCH} == "ia64"
.error "ACPI can only be compiled into the kernel on the ia64 platform"
.endif
@ -22,7 +22,7 @@
${.CURDIR}/../../../pci \
${.CURDIR}/../../../dev/acpica \
${.CURDIR}/../../../dev/acpica/Osd \
${.CURDIR}/../../../${MACHINE_ARCH}/acpica
${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica
KMOD= acpi
@ -98,7 +98,10 @@ SRCS+= acpi_machdep.c acpi_wakecode.h acpi_wakeup.c
SRCS+= assym.s madt.c
CLEANFILES+= acpi_wakecode.bin acpi_wakecode.h acpi_wakecode.o
.if ${MACHINE_ARCH} == "amd64"
SRCS+= opt_global.h
.if ${MACHINE_CPUARCH} == "amd64"
SRCS+= acpi_switch.S opt_global.h
.if !defined(KERNBUILDDIR)
CFLAGS+=-DSMP
.endif
@ -119,8 +122,8 @@ acpi_wakedata.h: acpi_wakecode.o
echo "#define $${what} 0x$${offset}"; done > ${.TARGET}
.else
acpi_wakecode.h: acpi_wakecode.S assym.s
${MAKE} -f ${.CURDIR}/../../../${MACHINE_ARCH}/acpica/Makefile \
MAKESRCPATH=${.CURDIR}/../../../${MACHINE_ARCH}/acpica
${MAKE} -f ${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica/Makefile \
MAKESRCPATH=${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica
.endif
.include <bsd.kmod.mk>

View File

@ -4,14 +4,14 @@
KMOD= agp
SRCS= agp.c agp_if.c
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
SRCS+= agp_i810.c agp_intel.c agp_via.c agp_sis.c agp_ali.c agp_amd.c \
agp_nvidia.c agp_ati.c
.endif
.if ${MACHINE} == "i386"
SRCS+= agp_amd64.c
.endif
.if ${MACHINE_ARCH} == "amd64"
.if ${MACHINE_CPUARCH} == "amd64"
SRCS+= agp_amd64.c agp_i810.c agp_via.c
.endif
SRCS+= device_if.h bus_if.h agp_if.h pci_if.h

View File

@ -3,7 +3,7 @@
.PATH: ${.CURDIR}/../../dev/amr
SUBDIR= amr_cam
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
SUBDIR+= amr_linux
.endif

View File

@ -7,7 +7,7 @@ SRCS= asr.c
SRCS+= opt_scsi.h opt_cam.h
SRCS+= device_if.h bus_if.h pci_if.h
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
SRCS+= opt_asr.h
.endif

View File

@ -5,7 +5,7 @@
KMOD= if_bge
SRCS= if_bge.c miibus_if.h miidevs.h device_if.h bus_if.h pci_if.h
.if ${MACHINE_ARCH} == sparc64
.if ${MACHINE_CPUARCH} == sparc64
SRCS+= ofw_bus_if.h
.endif

View File

@ -1,7 +1,7 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../dev/cpufreq \
${.CURDIR}/../../${MACHINE_ARCH}/cpufreq
${.CURDIR}/../../${MACHINE_CPUARCH}/cpufreq
KMOD= cpufreq
SRCS= ichss.c

View File

@ -28,11 +28,11 @@ _toecore = toecore
#_tom = tom
.endif
.if ${MACHINE_ARCH} == "i386" && exists(${_toe_header})
.if ${MACHINE_CPUARCH} == "i386" && exists(${_toe_header})
_iw_cxgb = iw_cxgb
.endif
.if ${MACHINE_ARCH} == "amd64" && exists(${_toe_header})
.if ${MACHINE_CPUARCH} == "amd64" && exists(${_toe_header})
_iw_cxgb = iw_cxgb
.endif

View File

@ -4,13 +4,13 @@
KMOD= cyclic
SRCS= cyclic.c
SRCS+= vnode_if.h
CFLAGS+= -I${.CURDIR}/../../cddl/compat/opensolaris \
-I${.CURDIR}/../../cddl/contrib/opensolaris/uts/common \
-I${.CURDIR}/../.. \
-I${.CURDIR}/../../cddl/dev/cyclic/${MACHINE_ARCH:S/amd64/i386/}
-I${.CURDIR}/../../cddl/dev/cyclic/${MACHINE_CPUARCH:S/amd64/i386/}
CFLAGS+= -DDEBUG=1

View File

@ -14,7 +14,7 @@ SUBDIR= dtmalloc \
sdt \
systrace
.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
SUBDIR+= fbt
.endif

View File

@ -5,7 +5,7 @@ IGNORE_PRAGMA= 1
load :
-kldload cyclic
-kldload dtrace
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
-kldload sdt
-kldload lockstat
-kldload fbt
@ -18,7 +18,7 @@ load :
unload :
-kldunload systrace
-kldunload profile
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
-kldunload prototype
-kldunload fbt
-kldunload lockstat

View File

@ -1,6 +1,6 @@
# $FreeBSD$
ARCHDIR= ${MACHINE_ARCH}
ARCHDIR= ${MACHINE_CPUARCH}
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common/dtrace
.PATH: ${.CURDIR}/../../../cddl/kern
@ -12,7 +12,7 @@ SRCS= dtrace.c \
dtrace_asm.S \
dtrace_subr.c
.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
SRCS+= dis_tables.c \
instr_size.c
.endif
@ -25,7 +25,7 @@ SRCS+= assym.s
# These are needed for assym.s
SRCS+= opt_compat.h opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
SRCS+= opt_apic.h
.endif

View File

@ -10,7 +10,7 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
-I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
-I${.CURDIR}/../../..
.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel
.endif

View File

@ -13,7 +13,7 @@ SRCS+= bus_if.h device_if.h pci_if.h
SRCS+= mv.c entry.c ioctl.c hptproc.c gui_lib.c
OBJS+= hptmvraid.o
.if $(MACHINE_ARCH) == "amd64"
.if $(MACHINE_CPUARCH) == "amd64"
HPTMV_RAID_O = amd64-elf.raid.o.uu
.else
HPTMV_RAID_O = i386-elf.raid.o.uu
@ -48,5 +48,5 @@ DEBUGOPT += -DFOR_DEMO
.endif
CFLAGS = ${DEBUGOPT}
.include <bsd.kmod.mk>

View File

@ -9,6 +9,6 @@ SRCS+= hptrr_os_bsd.c hptrr_osm_bsd.c hptrr_config.c
OBJS = hptrr_lib.o
hptrr_lib.o:
uudecode -p < ${HPTRR}/$(MACHINE_ARCH)-elf.hptrr_lib.o.uu > hptrr_lib.o
uudecode -p < ${HPTRR}/$(MACHINE_CPUARCH)-elf.hptrr_lib.o.uu > hptrr_lib.o
.include <bsd.kmod.mk>

View File

@ -8,23 +8,23 @@ KMOD= hwpmc
SRCS= hwpmc_mod.c hwpmc_logging.c vnode_if.h
.if ${MACHINE_ARCH} == "amd64"
.if ${MACHINE_CPUARCH} == "amd64"
SRCS+= hwpmc_amd.c hwpmc_core.c hwpmc_intel.c hwpmc_piv.c hwpmc_tsc.c
SRCS+= hwpmc_x86.c hwpmc_uncore.c
SRCS+= device_if.h bus_if.h
.endif
.if ${MACHINE_ARCH} == "arm"
.if ${MACHINE_CPUARCH} == "arm"
SRCS+= hwpmc_arm.c
.endif
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
SRCS+= hwpmc_amd.c hwpmc_core.c hwpmc_intel.c hwpmc_piv.c hwpmc_ppro.c
SRCS+= hwpmc_pentium.c hwpmc_tsc.c hwpmc_x86.c hwpmc_uncore.c
SRCS+= device_if.h bus_if.h
.endif
.if ${MACHINE_ARCH} == "ia64"
.if ${MACHINE_CPUARCH} == "ia64"
SRCS+= hwpmc_ia64.c
.endif
@ -32,7 +32,7 @@ SRCS+= hwpmc_ia64.c
SRCS+= hwpmc_powerpc.c
.endif
.if ${MACHINE_ARCH} == "sparc64"
.if ${MACHINE_CPUARCH} == "sparc64"
SRCS+= hwpmc_sparc64.c
.endif

View File

@ -6,12 +6,12 @@ KMOD= pcf
SRCS= ${envctrl} pcf.c ${pcf_ebus} ${pcf_isa}
SRCS+= bus_if.h device_if.h iicbus_if.h ${isa_if} ${ofw_bus_if}
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
isa_if= isa_if.h
pcf_isa= pcf_isa.c
.endif
.if ${MACHINE_ARCH} == "sparc64"
.if ${MACHINE_CPUARCH} == "sparc64"
envctrl= envctrl.c
ofw_bus_if= ofw_bus_if.h
pcf_ebus= pcf_ebus.c

View File

@ -1,7 +1,7 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../dev/io
.PATH: ${.CURDIR}/../../${MACHINE_ARCH}/${MACHINE_ARCH}
.PATH: ${.CURDIR}/../../${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
KMOD= io
SRCS= iodev.c io.c

View File

@ -7,7 +7,7 @@ SRCS= am7990.c am79900.c ${if_le_cbus} ${if_le_isa} ${if_le_lebuffer}
SRCS+= ${if_le_ledma} if_le_pci.c lance.c ${lebuffer_sbus}
SRCS+= bus_if.h device_if.h ${isa_if} ${ofw_bus_if} pci_if.h
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
.if ${MACHINE} == "pc98"
if_le_cbus= if_le_cbus.c
.else

View File

@ -8,7 +8,7 @@ SRCS= vnode_if.h \
linprocfs.c \
opt_compat.h
.if ${MACHINE_ARCH} == "amd64"
.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+=-DCOMPAT_LINUX32
.endif

View File

@ -8,7 +8,7 @@ SRCS= vnode_if.h \
linsysfs.c \
opt_compat.h
.if ${MACHINE_ARCH} == "amd64"
.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+=-DCOMPAT_LINUX32
.endif

View File

@ -1,11 +1,11 @@
# $FreeBSD$
.if ${MACHINE_ARCH} == "amd64"
.if ${MACHINE_CPUARCH} == "amd64"
SFX= 32
CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32
.endif
.PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_ARCH}/linux${SFX}
.PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_CPUARCH}/linux${SFX}
KMOD= linux
SRCS= linux${SFX}_dummy.c linux_emul.c linux_file.c \
@ -18,13 +18,13 @@ SRCS= linux${SFX}_dummy.c linux_emul.c linux_file.c \
# XXX: for assym.s
SRCS+= opt_kstack_pages.h opt_nfs.h opt_compat.h opt_hwpmc_hooks.h
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
SRCS+= opt_apic.h
.endif
OBJS= linux${SFX}_locore.o linux${SFX}_support.o
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
SRCS+= linux_ptrace.c imgact_linux.c opt_cpu.h
.endif

View File

@ -2,17 +2,17 @@
.PATH: ${.CURDIR}/../../dev/mem
.PATH: ${.CURDIR}/../../${MACHINE}/${MACHINE}
.PATH: ${.CURDIR}/../../${MACHINE_ARCH}/${MACHINE_ARCH}
.PATH: ${.CURDIR}/../../${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
KMOD= mem
SRCS= memdev.c mem.c
.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
SRCS+= memutil.c
.endif
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
SRCS+= i686_mem.c k6_mem.c
.endif
.if ${MACHINE_ARCH} == "amd64"
.if ${MACHINE_CPUARCH} == "amd64"
SRCS+= amd64_mem.c
.endif
SRCS+= bus_if.h device_if.h

View File

@ -4,7 +4,7 @@
SUBDIR= mfip
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
SUBDIR+= mfi_linux
.endif

View File

@ -8,11 +8,11 @@ SRCS+= kern_windrv.c subr_usbd.c
SRCS+= device_if.h bus_if.h pci_if.h vnode_if.h
SRCS+= opt_bus.h opt_usb.h usb_if.h usbdevs.h
.if ${MACHINE_ARCH} == "amd64"
.if ${MACHINE_CPUARCH} == "amd64"
SRCS+= winx64_wrap.S
.endif
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
SRCS+= winx32_wrap.S
.endif

View File

@ -6,18 +6,18 @@ SRCS= bus_if.h device_if.h ppbus_if.h isa_if.h pci_if.h serdev_if.h \
opt_ppc.h opt_isa.h \
ppc.c ppc_pci.c ppc_puc.c
.if ${MACHINE_ARCH} == "amd64"
.if ${MACHINE_CPUARCH} == "amd64"
SRCS+= ppc_acpi.c ppc_isa.c
.endif
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
.if ${MACHINE} != "pc98"
SRCS+= ppc_acpi.c
.endif
SRCS+= ppc_isa.c
.endif
.if ${MACHINE_ARCH} == "ia64"
.if ${MACHINE_CPUARCH} == "ia64"
SRCS+= ppc_acpi.c
.endif

View File

@ -34,7 +34,7 @@ opt_compat.h:
echo "#define COMPAT_FREEBSD4 1" >> ${.TARGET}
echo "#define COMPAT_FREEBSD5 1" >> ${.TARGET}
echo "#define COMPAT_FREEBSD6 1" >> ${.TARGET}
.if ${MACHINE_ARCH} == "amd64"
.if ${MACHINE_CPUARCH} == "amd64"
echo "#define COMPAT_FREEBSD32 1" >> ${.TARGET}
echo "#define COMPAT_LINUX32 1" >> ${.TARGET}
.endif

View File

@ -1,7 +1,7 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../crypto/des \
${.CURDIR}/../../crypto/des/arch/${MACHINE_ARCH} \
${.CURDIR}/../../crypto/des/arch/${MACHINE_CPUARCH} \
${.CURDIR}/../../kern \
${.CURDIR}/../../libkern \
${.CURDIR}/../../netsmb \
@ -21,7 +21,7 @@ SRCS= vnode_if.h \
# NETSMBCRYPTO
SRCS+= des_ecb.c des_setkey.c
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
SRCS+= des_enc.S
.else
SRCS+= des_enc.c

View File

@ -5,11 +5,11 @@ SUBDIR+= envy24 envy24ht es137x ess fm801 hda ich maestro maestro3
SUBDIR+= neomagic sb16 sb8 sbc solo spicds t4dwave via8233
SUBDIR+= via82c686 vibes driver uaudio
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
SUBDIR+= cmi mss
.endif
.if ${MACHINE_ARCH} == "sparc64"
.if ${MACHINE_CPUARCH} == "sparc64"
.if ${MACHINE} == "sparc64"
SUBDIR+= audiocs
.endif

View File

@ -1,6 +1,6 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../${MACHINE_ARCH}/svr4 ${.CURDIR}/../../compat/svr4
.PATH: ${.CURDIR}/../../${MACHINE_CPUARCH}/svr4 ${.CURDIR}/../../compat/svr4
KMOD= svr4
SRCS= svr4_sysent.c svr4_sysvec.c opt_compat.h opt_svr4.h \
vnode_if.h imgact_svr4.c svr4_signal.c svr4_fcntl.c \

View File

@ -14,11 +14,12 @@ SUBDIR= ${_apm} \
${_star} \
${_warp}
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
_apm= apm
.endif
.if ${MACHINE_ARCH} != "sparc64"
.if ${MACHINE_CPUARCH} != "sparc64"
_beastie= beastie
_beastie= beastie
_daemon= daemon
_dragon= dragon

View File

@ -2,7 +2,7 @@
.PATH: ${.CURDIR}/../../dev/uart
.if ${MACHINE_ARCH} == "sparc64"
.if ${MACHINE_CPUARCH} == "sparc64"
uart_bus_ebus= uart_bus_ebus.c
ofw_bus_if= ofw_bus_if.h
.endif

View File

@ -35,16 +35,16 @@ SUBDIR += uether aue axe cdce cue kue rue udav uhso
SUBDIR += usfs umass urio
SUBDIR += quirk template
.if ${MACHINE_ARCH} == "amd64"
.if ${MACHINE_CPUARCH} == "amd64"
_urtw= urtw
.endif
.if ${MACHINE_ARCH} == "arm"
.if ${MACHINE_CPUARCH} == "arm"
_at91dci= at91dci
_atmegadci= atmegadci
.endif
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
_urtw= urtw
.endif

View File

@ -4,7 +4,7 @@
KMOD= if_vx
SRCS= if_vx.c if_vx_pci.c
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_CPUARCH} == "i386"
SRCS+= if_vx_eisa.c
.endif
SRCS+= device_if.h bus_if.h pci_if.h eisa_if.h