Makefile.arm revision 152742
1# Makefile.arm -- with config changes.
2# Copyright 1990 W. Jolitz
3#	from: @(#)Makefile.i386	7.1 5/10/91
4# $FreeBSD: head/sys/conf/Makefile.arm 152742 2005-11-24 02:25:49Z cognet $
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=	600003
21
22# Temporary stuff while we're still embryonic
23NO_MODULES=
24
25STD8X16FONT?=	iso
26
27.if !defined(S)
28.if exists(./@/.)
29S=	./@
30.else
31S=	../../..
32.endif
33.endif
34.include "$S/conf/kern.pre.mk"
35
36SYSTEM_LD:= ${SYSTEM_LD:$S/conf/ldscript.$M=ldscript.$M}
37SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/ldscript.$M=ldscript.$M}
38
39.if defined(ARM_BIG_ENDIAN)
40CC += -mbig-endian
41SYSTEM_LD += -EB
42.endif
43
44
45.if !defined(DEBUG)
46CFLAGS += -mno-apcs-frame
47.endif
48
49DDB_ENABLED!=	grep DDB opt_ddb.h || true
50
51SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.static \
52	  -warn-common -export-dynamic -dynamic-linker /red/herring -o \
53	   ${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o
54SYSTEM_LD_TAIL +=; cat ldscript.$M| \
55		sed s/" + SIZEOF_HEADERS"// \
56		>ldscript.$M.noheader; \
57		${SYSTEM_LD_}; \
58		${OBJCOPY} -S -O binary ${FULLKERNEL}.noheader \
59		${KERNEL_KO}.bin; \
60		rm ${FULLKERNEL}.noheader
61.if ${DDB_ENABLED} != ""
62SYSTEM_LD_TAIL += ;echo "\#define KERNNAME \"${KERNEL_KO}.tmp\"" \
63	>opt_kernname.h ;\
64	${OBJCOPY} --strip-symbol '$$d' --strip-symbol '$$a' \
65	-g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp;\
66	${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.arm \
67	$S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S -o ${KERNEL_KO}.tramp;\
68	${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.arm.noheader \
69	$S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S -o \
70	${KERNEL_KO}.tramp.noheader; \
71	${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \
72	${KERNEL_KO}.tramp.bin; \
73	rm ${KERNEL_KO}.tmp ${KERNEL_KO}.tramp.noheader; \
74
75.endif
76
77CLEANFILES +=	ldscript.$M ldscript.$M.static ${KERNEL_KO}.bin \
78		${KERNEL_KO}.tramp ${KERNEL_KO}.tramp.bin
79%BEFORE_DEPEND
80
81%OBJS
82
83%FILES.c
84
85%FILES.s
86
87%FILES.m
88
89%CLEAN
90
91.if ${DDB_ENABLED} != ""
92CLEAN+=	kernel.tramp
93.endif
94ldscript.$M: $S/conf/ldscript.$M
95	cat $S/conf/ldscript.$M|sed s/KERNPHYSADDR/${KERNPHYSADDR}/g| \
96	  sed s/KERNVIRTADDR/${KERNVIRTADDR}/g > ldscript.$M
97%RULES
98	
99.include "$S/conf/kern.post.mk"
100