mtw(4) remove misplaced DEBUG_FLAGS
[freebsd/src.git] / sys / conf / Makefile.arm
blob216f012d688e9f77f8d2d4156b76f03f0860d2ac
1 # Makefile.arm -- with config changes.
2 # Copyright 1990 W. Jolitz
3 # Makefile for FreeBSD
5 # This makefile is constructed from a machine description:
6 # config machineid
7 # Most changes should be made in the machine description
8 # /sys/arm/conf/``machineid''
9 # after which you should do
10 # config machineid
11 # Generic makefile changes should be made in
12 # /sys/conf/Makefile.arm
13 # after which config should be rerun for all machines.
16 # Which version of config(8) is required.
17 %VERSREQ= 600013
19 STD8X16FONT?= iso
21 .if !defined(S)
22 .if exists(./@/.)
23 S= ./@
24 .else
25 S= ../../..
26 .endif
27 .endif
28 .include "$S/conf/kern.pre.mk"
30 INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include -I$S/dts/include
32 LINUX_DTS_VERSION!= awk '/freebsd,dts-version/ { sub(/;$$/,"", $$NF); print $$NF }' $S/dts/freebsd-compatible.dts
33 CFLAGS += -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\"
35 .if !defined(DEBUG)
36 STRIP_FLAGS = -S
37 .endif
39 # We don't support gcc's thump interwork stuff, so disable it
40 CFLAGS.gcc += -mno-thumb-interwork
42 # We generally don't want fpu instructions in the kernel.
43 CFLAGS.clang += -mfpu=none
45 .if !empty(DDB_ENABLED)
46 CFLAGS += -funwind-tables
47 .endif
49 # "makeoptions KERNVIRTADDR=" is now optional, supply the default value.
50 .if empty(KERNVIRTADDR)
51 KERNVIRTADDR= 0xc0000000
52 .endif
54 # Use a custom SYSTEM_LD command to generate the elf kernel, so we can
55 # set the text segment start address, and also strip the "arm mapping
56 # symbols" which have names like $a.0 and $d.2; see the document
57 # "ELF for the ARM architecture" for more info on the mapping symbols.
58 SYSTEM_LD= \
59 ${SYSTEM_LD_BASECMD} \
60 --defsym='text_start=kernbase + SIZEOF_HEADERS' \
61 -o ${.TARGET} ${SYSTEM_OBJS} vers.o; \
62 $(OBJCOPY) \
63 --wildcard \
64 --strip-symbol='$$[adt]*' \
65 ${.TARGET}
67 %BEFORE_DEPEND
69 %OBJS
71 %FILES.c
73 %FILES.s
75 %FILES.m
77 %CLEAN
79 %RULES
81 .include "$S/conf/kern.post.mk"
83 # Generate the .bin (no elf headers) kernel
84 # Copy the kernel to directly executable format (the elf headers are
85 # stripped and a binary head blob with jump to kernel start address is
86 # prepended), saving the output in a temp file.
87 # We also strip arm "marker" symbols which are used only by elf toolchains. Read
88 # the symbols from kernel.full and pass them to arm_kernel_boothdr.awk, which
89 # generates a binary header blob that goes on the front of the stripped kernel.
90 # Cat the header blob and the temp file together to make the kernel.bin file.
91 ${KERNEL_KO}.bin: ${FULLKERNEL}
92 @${OBJCOPY} --wildcard --strip-symbol='$$[adtx]*' \
93 --output-target=binary ${FULLKERNEL} ${.TARGET}.temp
94 @{ ${NM} ${FULLKERNEL} | \
95 LC_ALL=C \
96 ${AWK} -f $S/tools/arm_kernel_boothdr.awk -v hdrtype=v7jump && \
97 cat ${.TARGET}.temp; \
98 } > ${.TARGET}
99 @rm ${.TARGET}.temp
100 @echo "created ${.TARGET} from ${.ALLSRC}"