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