1 # Makefile.arm -- with config changes.
2 # Copyright 1990 W. Jolitz
3 # from: @(#)Makefile.i386 7.1 5/10/91
8 # This makefile is constructed from a machine description:
10 # Most changes should be made in the machine description
11 # /sys/arm/conf/``machineid''
12 # after which you should do
14 # Generic makefile changes should be made in
15 # /sys/conf/Makefile.arm
16 # after which config should be rerun for all machines.
19 # Which version of config(8) is required.
31 .include "$S/conf/kern.pre.mk"
33 INCLUDES+= -I$S/contrib/libfdt -I$S/gnu/dts/include
35 LINUX_DTS_VERSION!= make -C $S/gnu/dts/ -V LINUX_DTS_VERSION
36 CFLAGS += -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\"
38 .if !defined(DEBUG) && !defined(PROFLEVEL)
42 # We don't support gcc's thump interwork stuff, so disable it
43 CFLAGS.gcc += -mno-thumb-interwork
45 # We generally don't want fpu instructions in the kernel.
46 CFLAGS.clang += -mfpu=none
48 .if !empty(DDB_ENABLED)
49 CFLAGS += -funwind-tables
52 # "makeoptions KERNVIRTADDR=" is now optional, supply the default value.
53 .if empty(KERNVIRTADDR)
54 KERNVIRTADDR= 0xc0000000
57 # Use a custom SYSTEM_LD command to generate the elf kernel, so we can
58 # set the text segment start address, and also strip the "arm mapping
59 # symbols" which have names like $a.0 and $d.2; see the document
60 # "ELF for the ARM architecture" for more info on the mapping symbols.
62 ${SYSTEM_LD_BASECMD} \
63 --defsym='text_start=kernbase + SIZEOF_HEADERS' \
64 -o ${.TARGET} ${SYSTEM_OBJS} vers.o; \
67 --strip-symbol='$$[adt]*' \
70 # Generate the .bin (no elf headers) kernel as an extra build output.
71 # We must relink to generate the .bin kernel, because without headers the
72 # location of everything changes. We also strip the ARM marker symbols.
73 KERNEL_EXTRA+= ${KERNEL_KO}.bin
74 KERNEL_EXTRA_INSTALL+= ${KERNEL_KO}.bin
76 ${KERNEL_KO}.bin: ${SYSTEM_DEP} vers.o
77 @echo "linking ${.TARGET}"
78 @${SYSTEM_LD_BASECMD} \
79 --defsym='text_start=kernbase' \
80 -o ${.TARGET} ${SYSTEM_OBJS} vers.o
84 --strip-symbol='$$[adt]*' \
85 --output-target=binary \
89 # hack because genassym.c includes sys/bus.h which includes these.
90 genassym.o: bus_if.h device_if.h
104 CLEAN+= ${KERNEL_KO}.bin
108 .include "$S/conf/kern.post.mk"