Home | History | Annotate | Line # | Download | only in m68k
      1 #	$NetBSD: Makefile.cmachflags,v 1.5 2026/07/08 04:26:53 thorpej Exp $
      2 
      3 # Set CMACHFLAGS best target the specific CPU combination, based on
      4 # their "options" setting.
      5 
      6 # This should typically be included iff the config file has not already set
      7 # CMACHFLAGS, eg:
      8 #   .if !defined(CMACHFLAGS)
      9 #   .include "$S/arch/m68k/Makefile.cmachflags"
     10 #   CMACHFLAGS+=    -Wa,-m68030 -Wa,-m68851
     11 #   .endif
     12 
     13 # Table of CPUs targeted vs gcc flags. Note: -m68020 and -m68030 are
     14 # ~identical, but they are both included for completeness.
     15 
     16 # 020 030 040 060 -m68020-60
     17 # 030 040 060     -m68020-60
     18 # 020 040 060     -m68020-60
     19 # 020 030 060     -m68020-60
     20 # 040 060         -m68020-60 (Would have been nice to have a -m68040-60)
     21 # 030 060         -m68020-60
     22 # 020 060         -m68020-60
     23 # 060             -m68060
     24 #
     25 # 020 030 040     -m68020-40
     26 # 030 040         -m68020-40
     27 # 020 040         -m68020-40
     28 # 040             -m68040
     29 #
     30 # 020 030         -m68020
     31 # 030             -m68030
     32 # 020             -m68020
     33 #
     34 # 010             -m68010
     35 
     36 HAVE_M68010!=	grep '\#define[ 	]*M68010' opt_m68k_arch.h 2>/dev/null || echo no
     37 HAVE_M68020!=	grep '\#define[ 	]*M68020' opt_m68k_arch.h 2>/dev/null || echo no
     38 HAVE_M68030!=	grep '\#define[ 	]*M68030' opt_m68k_arch.h 2>/dev/null || echo no
     39 HAVE_M68040!=	grep '\#define[ 	]*M68040' opt_m68k_arch.h 2>/dev/null || echo no
     40 HAVE_M68060!=	grep '\#define[ 	]*M68060' opt_m68k_arch.h 2>/dev/null || echo no
     41 
     42 .if ${HAVE_M68010} != "no"
     43 CMACHFLAGS=	-m68010 -Wa,-m68010
     44 .else
     45 
     46 .if ${HAVE_M68060} != "no"
     47 . if ${HAVE_M68020} != "no" || ${HAVE_M68030} != "no" || ${HAVE_M68040} != "no"
     48 CMACHFLAGS=	-m68020-60
     49 . else
     50 CMACHFLAGS=	-m68060
     51 . endif
     52 .elif ${HAVE_M68040} != "no"
     53 . if ${HAVE_M68020} != "no" || ${HAVE_M68030} != "no"
     54 CMACHFLAGS=	-m68020-40
     55 . else	# !-DM68060
     56 CMACHFLAGS=	-m68040
     57 . endif
     58 .elif ${HAVE_M68020} != "no"
     59 CMACHFLAGS=	-m68020
     60 .else
     61 CMACHFLAGS=	-m68030
     62 .endif	# !-DM68060
     63 
     64 .endif	# HAVE_M68010
     65