]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/conf/Makefile.mips
Add ar5416RestoreChainMask() which will undo any AR5416 specific chainmask
[FreeBSD/FreeBSD.git] / sys / conf / Makefile.mips
1 # Makefile.mips
2 # $FreeBSD$
3 #
4 # Makefile for FreeBSD
5 #
6 # This makefile is constructed from a machine description:
7 #       config machineid
8 # Most changes should be made in the machine description
9 #       /sys/mips/conf/``machineid''
10 # after which you should do
11 #        config machineid
12 # Generic makefile changes should be made in
13 #       /sys/conf/Makefile.mips
14 # after which config should be rerun for all machines.
15 #
16
17 # Which version of config(8) is required.
18 %VERSREQ=       600004
19
20 STD8X16FONT?=   iso
21
22 .if !defined(S)
23 .if exists(./@/.)
24 S=      ./@
25 .else
26 S=      ../../..
27 .endif
28 .endif
29 .include "$S/conf/kern.pre.mk"
30
31 LDSCRIPT_NAME?=ldscript.$M
32 SYSTEM_LD:= ${SYSTEM_LD:$S/conf/${LDSCRIPT_NAME}=${LDSCRIPT_NAME}}
33 SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/${LDSCRIPT_NAME}=${LDSCRIPT_NAME}}
34
35 KERNLOADADDR?=0x80001000
36 # This obscure value is defined by CFE for WR160N
37 # To be changed later
38 TRAMPLOADADDR?=0x807963c0
39
40 MKMODULESENV+=  MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH}
41
42 # We default to the MIPS32 ISA, if none specified in the
43 # kernel configuration file.
44 ARCH_FLAGS?=-march=mips32
45 EXTRA_FLAGS=-fno-pic -mno-abicalls -G0
46
47 HACK_EXTRA_FLAGS=-shared
48
49 # We add the -fno-pic flag to kernels because otherwise performance
50 # is extremely poor, as well as -mno-abicalls to force no ABI usage.
51 CFLAGS+=${EXTRA_FLAGS} $(ARCH_FLAGS)
52 HACK_EXTRA_FLAGS+=${EXTRA_FLAGS} $(ARCH_FLAGS)
53 TRAMP_EXTRA_FLAGS=${EXTRA_FLAGS} $(ARCH_FLAGS)
54
55 # XXX hardcoded kernel entry point
56 ASM_CFLAGS+=${CFLAGS} -D_LOCORE -DLOCORE
57
58 KERNEL_EXTRA=trampoline
59 trampoline: ${KERNEL_KO}.tramp.bin
60 ${KERNEL_KO}.tramp.bin: ${KERNEL_KO} $S/$M/$M/elf_trampoline.c \
61         $S/$M/$M/inckern.S 
62         ${OBJCOPY} --strip-symbol '$$d' --strip-symbol '$$a' \
63                 -g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp
64         sed -e s/${KERNLOADADDR}/${TRAMPLOADADDR}/ -e s/" + SIZEOF_HEADERS"// \
65                  ${LDSCRIPT_NAME} > ${LDSCRIPT_NAME}.tramp.noheader
66         ${CC} -O -nostdlib -I. -I$S ${TRAMP_EXTRA_FLAGS} ${TRAMP_LDFLAGS} -Xlinker \
67                 -T -Xlinker ${LDSCRIPT_NAME}.tramp.noheader  \
68                 -DKERNNAME="\"${KERNEL_KO}.tmp\"" $S/$M/$M/elf_trampoline.c \
69                 $S/$M/$M/inckern.S  -o ${KERNEL_KO}.tramp.noheader 
70         ${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \
71                 ${KERNEL_KO}.tramp.bin \
72
73 %BEFORE_DEPEND
74
75 %OBJS
76
77 %FILES.c
78
79 %FILES.s
80
81 %FILES.m
82
83 %CLEAN
84
85 CLEAN+= ${LDSCRIPT_NAME} ${LDSCRIPT_NAME}.tramp.noheader \
86         ${KERNEL_KO}.tramp.noheader ${KERNEL_KO}.tramp.bin
87
88 ${LDSCRIPT_NAME}: $S/conf/${LDSCRIPT_NAME}
89         sed s/KERNLOADADDR/${KERNLOADADDR}/g $S/conf/${LDSCRIPT_NAME} \
90                 > ${LDSCRIPT_NAME}
91 %RULES
92
93 .include "$S/conf/kern.post.mk"