11.4Sandvar#	$NetBSD: Makefile.cmachflags,v 1.4 2022/01/26 11:48:53 andvar Exp $
21.1Sabs
31.1Sabs# Set CMACHFLAGS best target the specific CPU combination, based on
41.2Smrg# their "options" setting.
51.1Sabs
61.1Sabs# This should typically be included iff the config file has not already set
71.1Sabs# CMACHFLAGS, eg:
81.1Sabs#   .if !defined(CMACHFLAGS)
91.1Sabs#   .include "$S/arch/m68k/Makefile.cmachflags"
101.1Sabs#   CMACHFLAGS+=    -Wa,-m68030 -Wa,-m68851
111.1Sabs#   .endif
121.1Sabs
131.4Sandvar# Table of CPUs targeted vs gcc flags. Note: -m68020 and -m68030 are
141.1Sabs# ~identical, but they are both included for completeness.
151.1Sabs
161.1Sabs# 020 030 040 060 -m68020-60
171.1Sabs# 030 040 060     -m68020-60
181.1Sabs# 020 040 060     -m68020-60
191.1Sabs# 020 030 060     -m68020-60
201.1Sabs# 040 060         -m68020-60 (Would have been nice to have a -m68040-60)
211.1Sabs# 030 060         -m68020-60
221.1Sabs# 020 060         -m68020-60
231.1Sabs# 060             -m68060
241.1Sabs#
251.1Sabs# 020 030 040     -m68020-40
261.1Sabs# 030 040         -m68020-40
271.1Sabs# 020 040         -m68020-40
281.1Sabs# 040             -m68040
291.1Sabs#
301.1Sabs# 020 030         -m68020
311.1Sabs# 030             -m68030
321.1Sabs# 020             -m68020
331.1Sabs
341.2SmrgHAVE_M68020!=	grep '\#define[ 	]*M68020' opt_m68k_arch.h 2>/dev/null || echo no
351.2SmrgHAVE_M68030!=	grep '\#define[ 	]*M68030' opt_m68k_arch.h 2>/dev/null || echo no
361.2SmrgHAVE_M68040!=	grep '\#define[ 	]*M68040' opt_m68k_arch.h 2>/dev/null || echo no
371.2SmrgHAVE_M68060!=	grep '\#define[ 	]*M68060' opt_m68k_arch.h 2>/dev/null || echo no
381.2Smrg
391.2Smrg.if ${HAVE_M68060} != "no"
401.2Smrg. if ${HAVE_M68020} != "no" || ${HAVE_M68030} != "no" || ${HAVE_M68040} != "no"
411.2SmrgCMACHFLAGS=	-m68020-60
421.2Smrg. else
431.1SabsCMACHFLAGS=	-m68060
441.2Smrg. endif
451.2Smrg.elif ${HAVE_M68040} != "no"
461.2Smrg. if ${HAVE_M68020} != "no" || ${HAVE_M68030} != "no"
471.2SmrgCMACHFLAGS=	-m68020-40
481.3Smartin. else	# !-DM68060
491.1SabsCMACHFLAGS=	-m68040
501.2Smrg. endif
511.2Smrg.elif ${HAVE_M68020} != "no"
521.1SabsCMACHFLAGS=	-m68020
531.1Sabs.else
541.1SabsCMACHFLAGS=	-m68030
551.3Smartin.endif	# !-DM68060
56