]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/conf/Makefile.arm
sys/conf: Move adding kernel.bin earlier
[FreeBSD/FreeBSD.git] / sys / conf / Makefile.arm
1 # Makefile.arm -- with config changes.
2 # Copyright 1990 W. Jolitz
3 #       from: @(#)Makefile.i386 7.1 5/10/91
4 #
5 # Makefile for FreeBSD
6 #
7 # This makefile is constructed from a machine description:
8 #       config machineid
9 # Most changes should be made in the machine description
10 #       /sys/arm/conf/``machineid''
11 # after which you should do
12 #        config machineid
13 # Generic makefile changes should be made in
14 #       /sys/conf/Makefile.arm
15 # after which config should be rerun for all machines.
16 #
17
18 # Which version of config(8) is required.
19 %VERSREQ=       600013
20
21 STD8X16FONT?=   iso
22
23 .if !defined(S)
24 .if exists(./@/.)
25 S=      ./@
26 .else
27 S=      ../../..
28 .endif
29 .endif
30 .include "$S/conf/kern.pre.mk"
31
32 INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include -I$$/dts/include
33
34 LINUX_DTS_VERSION!=     awk '/freebsd,dts-version/ { sub(/;$$/,"", $$NF); print $$NF }' $S/dts/freebsd-compatible.dts
35 CFLAGS += -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\"
36
37 .if !defined(DEBUG)
38 STRIP_FLAGS = -S
39 .endif
40
41 # We don't support gcc's thump interwork stuff, so disable it
42 CFLAGS.gcc += -mno-thumb-interwork
43
44 # We generally don't want fpu instructions in the kernel.
45 CFLAGS.clang += -mfpu=none
46
47 .if !empty(DDB_ENABLED)
48 CFLAGS += -funwind-tables
49 .endif
50
51 # "makeoptions KERNVIRTADDR=" is now optional, supply the default value.
52 .if empty(KERNVIRTADDR)
53 KERNVIRTADDR= 0xc0000000
54 .endif
55
56 # Use a custom SYSTEM_LD command to generate the elf kernel, so we can
57 # set the text segment start address, and also strip the "arm mapping
58 # symbols" which have names like $a.0 and $d.2; see the document
59 # "ELF for the ARM architecture" for more info on the mapping symbols.
60 SYSTEM_LD= \
61         ${SYSTEM_LD_BASECMD} \
62             --defsym='text_start=kernbase + SIZEOF_HEADERS' \
63             -o ${.TARGET} ${SYSTEM_OBJS} vers.o; \
64         $(OBJCOPY) \
65             --wildcard \
66             --strip-symbol='$$[adt]*' \
67             ${.TARGET}
68
69 # Generate the .bin (no elf headers) kernel as an extra build output.
70 # We must relink to generate the .bin kernel, because without headers the
71 # location of everything changes.  We also strip the ARM marker symbols.
72 ${KERNEL_KO}.bin: ${SYSTEM_DEP} vers.o
73         @echo "linking ${.TARGET}"
74         @${SYSTEM_LD_BASECMD} \
75             --defsym='text_start=kernbase' \
76             -o ${.TARGET} ${SYSTEM_OBJS} vers.o
77         ${SIZE} ${.TARGET}
78         @${OBJCOPY} \
79             --wildcard \
80             --strip-symbol='$$[adt]*' \
81             --output-target=binary \
82             ${.TARGET}
83         @chmod 755 ${.TARGET}
84
85 # hack because genassym.c includes sys/bus.h which includes these.
86 genassym.o: bus_if.h device_if.h
87
88 %BEFORE_DEPEND
89
90 %OBJS
91
92 %FILES.c
93
94 %FILES.s
95
96 %FILES.m
97
98 %CLEAN
99
100 %RULES
101         
102 .include "$S/conf/kern.post.mk"