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 SYSTEM_LD:= ${SYSTEM_LD:$S/conf/ldscript.$M=ldscript.$M}
36 SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/ldscript.$M=ldscript.$M}
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
50 .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 30500
51 # clang < 3.5.0 requires us to tell it to emit assembly with unwind information
52 CFLAGS += -mllvm -arm-enable-ehabi
56 # "makeoptions KERNVIRTADDR=" is now optional, supply the default value.
57 .if empty(KERNVIRTADDR)
58 KERNVIRTADDR= 0xc0000000
61 # hack because genassym.c includes sys/bus.h which includes these.
62 genassym.o: bus_if.h device_if.h
64 SYSTEM_LD_ = ${LD} -m ${LD_EMULATION} -Bdynamic -T ldscript.$M.noheader \
65 ${_LDFLAGS} --no-warn-mismatch --warn-common --export-dynamic \
66 --dynamic-linker /red/herring \
67 -o ${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o
68 SYSTEM_LD_TAIL +=;sed s/" + SIZEOF_HEADERS"// ldscript.$M \
69 >ldscript.$M.noheader; \
71 ${OBJCOPY} -S -O binary ${FULLKERNEL}.noheader \
73 rm ${FULLKERNEL}.noheader
87 CLEAN+= ldscript.$M ${KERNEL_KO}.bin ldscript.$M.noheader
89 ldscript.$M: $S/conf/ldscript.$M
90 sed s/KERNVIRTADDR/${KERNVIRTADDR}/g > ldscript.$M < $S/conf/ldscript.$M
94 .include "$S/conf/kern.post.mk"