Home | History | Annotate | Line # | Download | only in conf
Makefile.aarch64 revision 1.8.2.4
      1  1.8.2.4  pgoyette #	$NetBSD: Makefile.aarch64,v 1.8.2.4 2018/11/26 01:52:16 pgoyette Exp $
      2      1.1      matt 
      3      1.1      matt # Makefile for NetBSD
      4      1.1      matt #
      5      1.1      matt # This makefile is constructed from a machine description:
      6      1.1      matt #	config machineid
      7      1.1      matt # Most changes should be made in the machine description
      8      1.1      matt #	/sys/arch/<arch>/conf/``machineid''
      9      1.1      matt # after which you should do
     10      1.1      matt #	config machineid
     11      1.1      matt # Machine generic makefile changes should be made in
     12      1.1      matt #	/sys/arch/arm/conf/Makefile.arm
     13      1.1      matt # after which config should be rerun for all machines of that type.
     14      1.1      matt #
     15      1.1      matt # To specify debugging, add the config line: makeoptions DEBUG="-g"
     16      1.1      matt # A better way is to specify -g only for a few files.
     17      1.1      matt #
     18      1.1      matt #	makeoptions DEBUGLIST="uvm* trap if_*"
     19      1.1      matt 
     20      1.1      matt USETOOLS?=	no
     21      1.1      matt NEED_OWN_INSTALL_TARGET?=no
     22      1.1      matt .include <bsd.own.mk>
     23      1.1      matt 
     24      1.1      matt ##
     25      1.1      matt ## (1) port identification
     26      1.1      matt ##
     27  1.8.2.1  pgoyette THISARM=	$S/arch/${MACHINE}
     28  1.8.2.3  pgoyette ARM=		$S/arch/aarch64
     29  1.8.2.3  pgoyette GENASSYM_CONF=	${ARM}/aarch64/genassym.cf
     30      1.1      matt .-include "$S/arch/${MACHINE}/conf/Makefile.${MACHINE}.inc"
     31      1.1      matt 
     32      1.1      matt ##
     33      1.1      matt ## (2) compile settings
     34      1.1      matt ##
     35      1.1      matt # CPPFLAGS set by platform-specific Makefile fragment.
     36  1.8.2.1  pgoyette CFLAGS+=	-march=armv8-a+nofp+nosimd
     37  1.8.2.1  pgoyette #CFLAGS+=	-fomit-frame-pointer
     38  1.8.2.1  pgoyette CFLAGS+=	-fno-omit-frame-pointer
     39  1.8.2.1  pgoyette CFLAGS+=	-mno-omit-leaf-frame-pointer
     40  1.8.2.1  pgoyette #CFLAGS+=	-mno-unaligned-access
     41  1.8.2.1  pgoyette 
     42  1.8.2.4  pgoyette .if ${KASAN:U0} > 0 && ${HAVE_GCC:U0} > 0
     43  1.8.2.4  pgoyette KASANFLAGS=	-fsanitize=kernel-address \
     44  1.8.2.4  pgoyette 		--param asan-globals=1 --param asan-stack=1 \
     45  1.8.2.4  pgoyette 		-fasan-shadow-offset=0xDFFF208000000000
     46  1.8.2.4  pgoyette .for f in subr_asan.c
     47  1.8.2.4  pgoyette KASANFLAGS.${f}=	# empty
     48  1.8.2.4  pgoyette .endfor
     49  1.8.2.4  pgoyette CFLAGS+=	${KASANFLAGS.${.IMPSRC:T}:U${KASANFLAGS}}
     50  1.8.2.4  pgoyette .endif
     51      1.1      matt 
     52      1.1      matt ##
     53      1.1      matt ## (3) libkern and compat
     54      1.1      matt ##
     55  1.8.2.3  pgoyette OPT_MODULAR=	%MODULAR%
     56      1.1      matt 
     57      1.1      matt ##
     58      1.1      matt ## (4) local objects, compile rules, and dependencies
     59      1.1      matt ##
     60      1.1      matt MD_OBJS+=	${SYSTEM_FIRST_OBJ} locore.o
     61      1.1      matt MD_CFILES+=
     62  1.8.2.3  pgoyette MD_SFILES+=	${SYSTEM_FIRST_SFILE} ${ARM}/aarch64/locore.S
     63      1.1      matt 
     64      1.1      matt .if defined(SYSTEM_FIRST_OBJ)
     65      1.1      matt ${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h
     66      1.1      matt 	${NORMAL_S}
     67      1.1      matt .endif
     68      1.1      matt 
     69  1.8.2.3  pgoyette locore.o: ${ARM}/aarch64/locore.S assym.h
     70      1.1      matt 	${NORMAL_S}
     71      1.1      matt 
     72      1.1      matt ##
     73      1.1      matt ## (5) link settings
     74      1.1      matt ##
     75  1.8.2.3  pgoyette KERNLDSCRIPT?=	${ARM}/conf/kern.ldscript
     76  1.8.2.1  pgoyette LOADADDRESS?=	0xffffffc000000040
     77      1.1      matt LINKFLAGS_NORMAL=	-X
     78      1.1      matt 
     79      1.1      matt # Strip AArch64 mapping symbols from the kernel image, as they interfere
     80      1.1      matt # with ddb. Do it differently if 'makeoptions DEBUG="-g"' was specified.
     81      1.1      matt .if !defined(DEBUG) || empty(DEBUG:M-g*)
     82      1.3     joerg SYSTEM_LD_TAIL?=	${OBJCOPY} -w --strip-symbol='[$$][dx]'	\
     83      1.2     joerg 				   --strip-symbol='[$$][dx]\.*' $@ ;\
     84      1.1      matt 			${SIZE} $@; chmod 755 $@
     85      1.1      matt .else
     86      1.1      matt STRIPFLAGS=-g --strip-symbol='$$x' --strip-symbol='$$d'
     87      1.1      matt .endif
     88      1.1      matt 
     89      1.1      matt ##
     90      1.1      matt ## (6) port specific target dependencies
     91      1.1      matt ##
     92      1.1      matt 
     93      1.1      matt # depend on DIAGNOSTIC etc.
     94      1.1      matt cpuswitch.o fault.o machdep.o: Makefile
     95      1.1      matt 
     96      1.1      matt # various assembly files that depend on assym.h
     97      1.1      matt atomic.o bcopy_page.o bcopyinout.o copystr.o cpuswitch.o cpu_in_cksum.o: assym.h
     98      1.1      matt exception.o sigcode.o: assym.h
     99      1.1      matt spl.o vectors.o: assym.h
    100      1.1      matt 
    101      1.1      matt ##
    102      1.1      matt ## (7) misc settings
    103      1.1      matt ##
    104      1.1      matt 
    105      1.7       rjs # define .MAIN _before_ the make() check, so that implicit target
    106      1.7       rjs # would be defined
    107      1.7       rjs .MAIN: all
    108      1.7       rjs 
    109      1.8  christos .if !make(obj) && !make(clean) && !make(cleandir)
    110      1.8  christos .BEGIN::
    111      1.8  christos 	-@rm -f arm && \
    112      1.7       rjs 		ln -s $S/arch/arm/include arm
    113      1.7       rjs .endif
    114      1.7       rjs 
    115      1.1      matt ##
    116      1.1      matt ## (8) config(8) generated machinery
    117      1.1      matt ##
    118      1.1      matt %INCLUDES
    119      1.1      matt 
    120      1.1      matt %OBJS
    121      1.1      matt 
    122      1.1      matt %CFILES
    123      1.1      matt 
    124      1.1      matt %SFILES
    125      1.1      matt 
    126      1.1      matt %LOAD
    127      1.1      matt 
    128      1.1      matt %RULES
    129      1.1      matt 
    130      1.1      matt ##
    131      1.1      matt ## (9) after the config file is inserted
    132      1.1      matt ##
    133      1.1      matt 
    134      1.1      matt ##
    135      1.1      matt ## (10) port independent kernel machinery
    136      1.1      matt ##
    137      1.1      matt 
    138      1.1      matt .include "$S/conf/Makefile.kern.inc"
    139      1.1      matt 
    140      1.1      matt ##
    141      1.1      matt ## (11) Appending make options.
    142      1.1      matt ##
    143      1.1      matt %MAKEOPTIONSAPPEND
    144