]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/conf/Makefile.arm
[PowerPC] Work around -O miscompile on powerpc 32 bit.
[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 # $FreeBSD$
5 #
6 # Makefile for FreeBSD
7 #
8 # This makefile is constructed from a machine description:
9 #       config machineid
10 # Most changes should be made in the machine description
11 #       /sys/arm/conf/``machineid''
12 # after which you should do
13 #        config machineid
14 # Generic makefile changes should be made in
15 #       /sys/conf/Makefile.arm
16 # after which config should be rerun for all machines.
17 #
18
19 # Which version of config(8) is required.
20 %VERSREQ=       600013
21
22 STD8X16FONT?=   iso
23
24 .if !defined(S)
25 .if exists(./@/.)
26 S=      ./@
27 .else
28 S=      ../../..
29 .endif
30 .endif
31 .include "$S/conf/kern.pre.mk"
32
33 INCLUDES+= -I$S/contrib/libfdt -I$S/gnu/dts/include 
34
35 .if !defined(DEBUG) && !defined(PROFLEVEL)
36 STRIP_FLAGS = -S
37 .endif
38
39 # We don't support gcc's thump interwork stuff, so disable it
40 CFLAGS.gcc += -mno-thumb-interwork
41
42 # We generally don't want fpu instructions in the kernel.
43 CFLAGS.clang += -mfpu=none
44
45 .if !empty(DDB_ENABLED)
46 CFLAGS += -funwind-tables
47 .endif
48
49 # "makeoptions KERNVIRTADDR=" is now optional, supply the default value.
50 .if empty(KERNVIRTADDR)
51 KERNVIRTADDR= 0xc0000000
52 .endif
53
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}
66
67 # Generate the .bin (no elf headers) kernel as an extra build output.
68 # We must relink to generate the .bin kernel, because without headers the
69 # location of everything changes.  We also strip the ARM marker symbols.
70 KERNEL_EXTRA+= ${KERNEL_KO}.bin
71 KERNEL_EXTRA_INSTALL+= ${KERNEL_KO}.bin
72
73 ${KERNEL_KO}.bin: ${SYSTEM_DEP} vers.o
74         @echo "linking ${.TARGET}"
75         @${SYSTEM_LD_BASECMD} \
76             --defsym='text_start=kernbase' \
77             -o ${.TARGET} ${SYSTEM_OBJS} vers.o
78         ${SIZE} ${.TARGET}
79         @${OBJCOPY} \
80             --wildcard \
81             --strip-symbol='$$[adt]*' \
82             --output-target=binary \
83             ${.TARGET}
84         @chmod 755 ${.TARGET}
85
86 # hack because genassym.c includes sys/bus.h which includes these.
87 genassym.o: bus_if.h device_if.h
88
89 %BEFORE_DEPEND
90
91 %OBJS
92
93 %FILES.c
94
95 %FILES.s
96
97 %FILES.m
98
99 %CLEAN
100
101 CLEAN+= ${KERNEL_KO}.bin
102
103 %RULES
104         
105 .include "$S/conf/kern.post.mk"