]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/conf/Makefile.arm64
login(1): when exporting variables check the result of setenv(3)
[FreeBSD/FreeBSD.git] / sys / conf / Makefile.arm64
1 # Makefile.arm64 -- with config changes.
2 # Copyright 1990 W. Jolitz
3 #       from: @(#)Makefile.i386 7.1 5/10/91
4 #       from FreeBSD: src/sys/conf/Makefile.i386,v 1.255 2002/02/20 23:35:49
5 # $FreeBSD$
6 #
7 # Makefile for FreeBSD
8 #
9 # This makefile is constructed from a machine description:
10 #       config machineid
11 # Most changes should be made in the machine description
12 #       /sys/arm64/conf/``machineid''
13 # after which you should do
14 #        config machineid
15 # Generic makefile changes should be made in
16 #       /sys/conf/Makefile.arm64
17 # after which config should be rerun for all machines.
18 #
19
20 # Which version of config(8) is required.
21 %VERSREQ=       600012
22
23 .if !defined(S)
24 S=      ../../..
25 .endif
26 .include "$S/conf/kern.pre.mk"
27
28 INCLUDES+= -I$S/contrib/libfdt
29
30 # Use a custom SYSTEM_LD command to generate the elf kernel, so we can
31 # set the text segment start address, and also strip the "arm mapping
32 # symbols" which have names like $a.0 and $d.2; see the document
33 # "ELF for the ARM architecture" for more info on the mapping symbols.
34 SYSTEM_LD= \
35         ${SYSTEM_LD_BASECMD} \
36             --defsym='text_start=kernbase + SIZEOF_HEADERS' \
37             -o ${.TARGET} ${SYSTEM_OBJS} vers.o; \
38         $(OBJCOPY) \
39             --wildcard \
40             --strip-symbol='$$[adtx]*' \
41             ${.TARGET}
42
43 # Generate the .bin (no elf headers) kernel as an extra build output.
44 # We must relink to generate the .bin kernel, because without headers the
45 # location of everything changes.  We also strip the ARM marker symbols.
46 KERNEL_EXTRA+= ${KERNEL_KO}.bin
47 KERNEL_EXTRA_INSTALL+= ${KERNEL_KO}.bin
48
49 ${KERNEL_KO}.bin: ${SYSTEM_DEP} vers.o
50         @echo "linking ${.TARGET}"
51         @${SYSTEM_LD_BASECMD} \
52             --defsym='text_start=kernbase' \
53             -o ${.TARGET} ${SYSTEM_OBJS} vers.o
54         ${SIZE} ${.TARGET}
55         @${OBJCOPY} \
56             --wildcard \
57             --strip-symbol='$$[adtx]*' \
58             --output-target=binary \
59             ${.TARGET}
60         @chmod 755 ${.TARGET}
61
62 .if !empty(DDB_ENABLED)
63 CFLAGS += -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
64 .endif
65
66 %BEFORE_DEPEND
67
68 %OBJS
69
70 %FILES.c
71
72 %FILES.s
73
74 %FILES.m
75
76 %CLEAN
77 CLEAN+= ${KERNEL_KO}.bin
78
79 %RULES
80
81 .include "$S/conf/kern.post.mk"