2008-04-13 06:25:43 +00:00
|
|
|
# Makefile.mips
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
# Makefile for FreeBSD
|
|
|
|
#
|
|
|
|
# This makefile is constructed from a machine description:
|
|
|
|
# config machineid
|
|
|
|
# Most changes should be made in the machine description
|
|
|
|
# /sys/mips/conf/``machineid''
|
|
|
|
# after which you should do
|
|
|
|
# config machineid
|
|
|
|
# Generic makefile changes should be made in
|
|
|
|
# /sys/conf/Makefile.mips
|
|
|
|
# after which config should be rerun for all machines.
|
|
|
|
#
|
|
|
|
|
|
|
|
# Which version of config(8) is required.
|
|
|
|
%VERSREQ= 600004
|
|
|
|
|
|
|
|
STD8X16FONT?= iso
|
|
|
|
|
|
|
|
.if !defined(S)
|
|
|
|
.if exists(./@/.)
|
|
|
|
S= ./@
|
|
|
|
.else
|
|
|
|
S= ../../..
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.include "$S/conf/kern.pre.mk"
|
|
|
|
|
Merge r187428, r191079, r195533, r195669, r197004, r197012 and r197015
from projects/mips to head by hand:
r197015 | imp | 2009-09-08 21:59:46 -0600 (Tue, 08 Sep 2009) | 2 lines
Prefer PTR_LA over a naked la to work with 64-bits..
r197012 | imp | 2009-09-08 21:46:04 -0600 (Tue, 08 Sep 2009) | 3 lines
Use proper set of flags to build the tramp. this gets 64-bit almost
building and lets me debug the 'almost' :)
r197004 | imp | 2009-09-08 18:47:12 -0600 (Tue, 08 Sep 2009) | 2 lines
Use ${LDSCRIPT_NAME} in preference to ldscript.$M.
r195669 | gonzo | 2009-07-13 17:03:44 -0600 (Mon, 13 Jul 2009) | 3 lines
- Remove -mno-dsp from CFLAGS. MIPS DSP ASE is off by default
now (as it should be)
r195533 | imp | 2009-07-10 01:21:26 -0600 (Fri, 10 Jul 2009) | 4 lines
Add in the emulation selection when linking... We're still not 100%
of the way there, but we're better with it. hack.so build now, but
we die when we try to link it in.
r191079 | gonzo | 2009-04-14 16:53:22 -0600 (Tue, 14 Apr 2009) | 2 lines
- Revert changes accidentally killed by merge operation
r187418 | gonzo | 2009-01-18 19:37:10 -0700 (Sun, 18 Jan 2009) | 4 lines
- Add trampoline stuff for bootloaders that do not support ELF
- Replace arm'ish KERNPHYSADDR/KERNVIRTADDR with
KERNLOADADDR/TRAMPLOADADDR and clean configs
2010-01-10 05:34:46 +00:00
|
|
|
LDSCRIPT_NAME?=ldscript.$M
|
|
|
|
SYSTEM_LD:= ${SYSTEM_LD:$S/conf/${LDSCRIPT_NAME}=${LDSCRIPT_NAME}}
|
|
|
|
SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/${LDSCRIPT_NAME}=${LDSCRIPT_NAME}}
|
|
|
|
|
|
|
|
KERNLOADADDR?=0x80001000
|
|
|
|
# This obscure value is defined by CFE for WR160N
|
|
|
|
# To be changed later
|
|
|
|
TRAMPLOADADDR?=0x807963c0
|
2008-04-13 06:25:43 +00:00
|
|
|
|
|
|
|
MKMODULESENV+= MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH}
|
|
|
|
|
|
|
|
# We default to the MIPS32 ISA, if none specified in the
|
|
|
|
# kernel configuration file.
|
|
|
|
ARCH_FLAGS?=-march=mips32
|
Merge r187428, r191079, r195533, r195669, r197004, r197012 and r197015
from projects/mips to head by hand:
r197015 | imp | 2009-09-08 21:59:46 -0600 (Tue, 08 Sep 2009) | 2 lines
Prefer PTR_LA over a naked la to work with 64-bits..
r197012 | imp | 2009-09-08 21:46:04 -0600 (Tue, 08 Sep 2009) | 3 lines
Use proper set of flags to build the tramp. this gets 64-bit almost
building and lets me debug the 'almost' :)
r197004 | imp | 2009-09-08 18:47:12 -0600 (Tue, 08 Sep 2009) | 2 lines
Use ${LDSCRIPT_NAME} in preference to ldscript.$M.
r195669 | gonzo | 2009-07-13 17:03:44 -0600 (Mon, 13 Jul 2009) | 3 lines
- Remove -mno-dsp from CFLAGS. MIPS DSP ASE is off by default
now (as it should be)
r195533 | imp | 2009-07-10 01:21:26 -0600 (Fri, 10 Jul 2009) | 4 lines
Add in the emulation selection when linking... We're still not 100%
of the way there, but we're better with it. hack.so build now, but
we die when we try to link it in.
r191079 | gonzo | 2009-04-14 16:53:22 -0600 (Tue, 14 Apr 2009) | 2 lines
- Revert changes accidentally killed by merge operation
r187418 | gonzo | 2009-01-18 19:37:10 -0700 (Sun, 18 Jan 2009) | 4 lines
- Add trampoline stuff for bootloaders that do not support ELF
- Replace arm'ish KERNPHYSADDR/KERNVIRTADDR with
KERNLOADADDR/TRAMPLOADADDR and clean configs
2010-01-10 05:34:46 +00:00
|
|
|
EXTRA_FLAGS=-fno-pic -mno-abicalls -G0
|
2008-04-13 06:25:43 +00:00
|
|
|
|
|
|
|
HACK_EXTRA_FLAGS=-shared
|
Merge r187428, r191079, r195533, r195669, r197004, r197012 and r197015
from projects/mips to head by hand:
r197015 | imp | 2009-09-08 21:59:46 -0600 (Tue, 08 Sep 2009) | 2 lines
Prefer PTR_LA over a naked la to work with 64-bits..
r197012 | imp | 2009-09-08 21:46:04 -0600 (Tue, 08 Sep 2009) | 3 lines
Use proper set of flags to build the tramp. this gets 64-bit almost
building and lets me debug the 'almost' :)
r197004 | imp | 2009-09-08 18:47:12 -0600 (Tue, 08 Sep 2009) | 2 lines
Use ${LDSCRIPT_NAME} in preference to ldscript.$M.
r195669 | gonzo | 2009-07-13 17:03:44 -0600 (Mon, 13 Jul 2009) | 3 lines
- Remove -mno-dsp from CFLAGS. MIPS DSP ASE is off by default
now (as it should be)
r195533 | imp | 2009-07-10 01:21:26 -0600 (Fri, 10 Jul 2009) | 4 lines
Add in the emulation selection when linking... We're still not 100%
of the way there, but we're better with it. hack.so build now, but
we die when we try to link it in.
r191079 | gonzo | 2009-04-14 16:53:22 -0600 (Tue, 14 Apr 2009) | 2 lines
- Revert changes accidentally killed by merge operation
r187418 | gonzo | 2009-01-18 19:37:10 -0700 (Sun, 18 Jan 2009) | 4 lines
- Add trampoline stuff for bootloaders that do not support ELF
- Replace arm'ish KERNPHYSADDR/KERNVIRTADDR with
KERNLOADADDR/TRAMPLOADADDR and clean configs
2010-01-10 05:34:46 +00:00
|
|
|
|
2008-04-13 06:25:43 +00:00
|
|
|
# We add the -fno-pic flag to kernels because otherwise performance
|
|
|
|
# is extremely poor, as well as -mno-abicalls to force no ABI usage.
|
Merge r187428, r191079, r195533, r195669, r197004, r197012 and r197015
from projects/mips to head by hand:
r197015 | imp | 2009-09-08 21:59:46 -0600 (Tue, 08 Sep 2009) | 2 lines
Prefer PTR_LA over a naked la to work with 64-bits..
r197012 | imp | 2009-09-08 21:46:04 -0600 (Tue, 08 Sep 2009) | 3 lines
Use proper set of flags to build the tramp. this gets 64-bit almost
building and lets me debug the 'almost' :)
r197004 | imp | 2009-09-08 18:47:12 -0600 (Tue, 08 Sep 2009) | 2 lines
Use ${LDSCRIPT_NAME} in preference to ldscript.$M.
r195669 | gonzo | 2009-07-13 17:03:44 -0600 (Mon, 13 Jul 2009) | 3 lines
- Remove -mno-dsp from CFLAGS. MIPS DSP ASE is off by default
now (as it should be)
r195533 | imp | 2009-07-10 01:21:26 -0600 (Fri, 10 Jul 2009) | 4 lines
Add in the emulation selection when linking... We're still not 100%
of the way there, but we're better with it. hack.so build now, but
we die when we try to link it in.
r191079 | gonzo | 2009-04-14 16:53:22 -0600 (Tue, 14 Apr 2009) | 2 lines
- Revert changes accidentally killed by merge operation
r187418 | gonzo | 2009-01-18 19:37:10 -0700 (Sun, 18 Jan 2009) | 4 lines
- Add trampoline stuff for bootloaders that do not support ELF
- Replace arm'ish KERNPHYSADDR/KERNVIRTADDR with
KERNLOADADDR/TRAMPLOADADDR and clean configs
2010-01-10 05:34:46 +00:00
|
|
|
CFLAGS+=${EXTRA_FLAGS} $(ARCH_FLAGS)
|
|
|
|
HACK_EXTRA_FLAGS+=${EXTRA_FLAGS} $(ARCH_FLAGS)
|
2010-12-16 04:56:03 +00:00
|
|
|
TRAMP_EXTRA_FLAGS=${EXTRA_FLAGS} $(ARCH_FLAGS)
|
2008-04-13 06:25:43 +00:00
|
|
|
|
|
|
|
# XXX hardcoded kernel entry point
|
|
|
|
ASM_CFLAGS+=${CFLAGS} -D_LOCORE -DLOCORE
|
|
|
|
|
Merge r187428, r191079, r195533, r195669, r197004, r197012 and r197015
from projects/mips to head by hand:
r197015 | imp | 2009-09-08 21:59:46 -0600 (Tue, 08 Sep 2009) | 2 lines
Prefer PTR_LA over a naked la to work with 64-bits..
r197012 | imp | 2009-09-08 21:46:04 -0600 (Tue, 08 Sep 2009) | 3 lines
Use proper set of flags to build the tramp. this gets 64-bit almost
building and lets me debug the 'almost' :)
r197004 | imp | 2009-09-08 18:47:12 -0600 (Tue, 08 Sep 2009) | 2 lines
Use ${LDSCRIPT_NAME} in preference to ldscript.$M.
r195669 | gonzo | 2009-07-13 17:03:44 -0600 (Mon, 13 Jul 2009) | 3 lines
- Remove -mno-dsp from CFLAGS. MIPS DSP ASE is off by default
now (as it should be)
r195533 | imp | 2009-07-10 01:21:26 -0600 (Fri, 10 Jul 2009) | 4 lines
Add in the emulation selection when linking... We're still not 100%
of the way there, but we're better with it. hack.so build now, but
we die when we try to link it in.
r191079 | gonzo | 2009-04-14 16:53:22 -0600 (Tue, 14 Apr 2009) | 2 lines
- Revert changes accidentally killed by merge operation
r187418 | gonzo | 2009-01-18 19:37:10 -0700 (Sun, 18 Jan 2009) | 4 lines
- Add trampoline stuff for bootloaders that do not support ELF
- Replace arm'ish KERNPHYSADDR/KERNVIRTADDR with
KERNLOADADDR/TRAMPLOADADDR and clean configs
2010-01-10 05:34:46 +00:00
|
|
|
KERNEL_EXTRA=trampoline
|
|
|
|
trampoline: ${KERNEL_KO}.tramp.bin
|
|
|
|
${KERNEL_KO}.tramp.bin: ${KERNEL_KO} $S/$M/$M/elf_trampoline.c \
|
|
|
|
$S/$M/$M/inckern.S
|
|
|
|
${OBJCOPY} --strip-symbol '$$d' --strip-symbol '$$a' \
|
2010-12-17 09:14:25 +00:00
|
|
|
-g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp
|
|
|
|
sed -e s/${KERNLOADADDR}/${TRAMPLOADADDR}/ -e s/" + SIZEOF_HEADERS"// \
|
|
|
|
${LDSCRIPT_NAME} > ${LDSCRIPT_NAME}.tramp.noheader
|
2010-12-16 04:56:03 +00:00
|
|
|
${CC} -O -nostdlib -I. -I$S ${TRAMP_EXTRA_FLAGS} ${TRAMP_LDFLAGS} -Xlinker \
|
|
|
|
-T -Xlinker ${LDSCRIPT_NAME}.tramp.noheader \
|
|
|
|
-DKERNNAME="\"${KERNEL_KO}.tmp\"" $S/$M/$M/elf_trampoline.c \
|
|
|
|
$S/$M/$M/inckern.S -o ${KERNEL_KO}.tramp.noheader
|
Merge r187428, r191079, r195533, r195669, r197004, r197012 and r197015
from projects/mips to head by hand:
r197015 | imp | 2009-09-08 21:59:46 -0600 (Tue, 08 Sep 2009) | 2 lines
Prefer PTR_LA over a naked la to work with 64-bits..
r197012 | imp | 2009-09-08 21:46:04 -0600 (Tue, 08 Sep 2009) | 3 lines
Use proper set of flags to build the tramp. this gets 64-bit almost
building and lets me debug the 'almost' :)
r197004 | imp | 2009-09-08 18:47:12 -0600 (Tue, 08 Sep 2009) | 2 lines
Use ${LDSCRIPT_NAME} in preference to ldscript.$M.
r195669 | gonzo | 2009-07-13 17:03:44 -0600 (Mon, 13 Jul 2009) | 3 lines
- Remove -mno-dsp from CFLAGS. MIPS DSP ASE is off by default
now (as it should be)
r195533 | imp | 2009-07-10 01:21:26 -0600 (Fri, 10 Jul 2009) | 4 lines
Add in the emulation selection when linking... We're still not 100%
of the way there, but we're better with it. hack.so build now, but
we die when we try to link it in.
r191079 | gonzo | 2009-04-14 16:53:22 -0600 (Tue, 14 Apr 2009) | 2 lines
- Revert changes accidentally killed by merge operation
r187418 | gonzo | 2009-01-18 19:37:10 -0700 (Sun, 18 Jan 2009) | 4 lines
- Add trampoline stuff for bootloaders that do not support ELF
- Replace arm'ish KERNPHYSADDR/KERNVIRTADDR with
KERNLOADADDR/TRAMPLOADADDR and clean configs
2010-01-10 05:34:46 +00:00
|
|
|
${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \
|
|
|
|
${KERNEL_KO}.tramp.bin \
|
|
|
|
|
2008-04-13 06:25:43 +00:00
|
|
|
%BEFORE_DEPEND
|
|
|
|
|
|
|
|
%OBJS
|
|
|
|
|
|
|
|
%FILES.c
|
|
|
|
|
|
|
|
%FILES.s
|
|
|
|
|
|
|
|
%FILES.m
|
|
|
|
|
|
|
|
%CLEAN
|
|
|
|
|
Merge r187428, r191079, r195533, r195669, r197004, r197012 and r197015
from projects/mips to head by hand:
r197015 | imp | 2009-09-08 21:59:46 -0600 (Tue, 08 Sep 2009) | 2 lines
Prefer PTR_LA over a naked la to work with 64-bits..
r197012 | imp | 2009-09-08 21:46:04 -0600 (Tue, 08 Sep 2009) | 3 lines
Use proper set of flags to build the tramp. this gets 64-bit almost
building and lets me debug the 'almost' :)
r197004 | imp | 2009-09-08 18:47:12 -0600 (Tue, 08 Sep 2009) | 2 lines
Use ${LDSCRIPT_NAME} in preference to ldscript.$M.
r195669 | gonzo | 2009-07-13 17:03:44 -0600 (Mon, 13 Jul 2009) | 3 lines
- Remove -mno-dsp from CFLAGS. MIPS DSP ASE is off by default
now (as it should be)
r195533 | imp | 2009-07-10 01:21:26 -0600 (Fri, 10 Jul 2009) | 4 lines
Add in the emulation selection when linking... We're still not 100%
of the way there, but we're better with it. hack.so build now, but
we die when we try to link it in.
r191079 | gonzo | 2009-04-14 16:53:22 -0600 (Tue, 14 Apr 2009) | 2 lines
- Revert changes accidentally killed by merge operation
r187418 | gonzo | 2009-01-18 19:37:10 -0700 (Sun, 18 Jan 2009) | 4 lines
- Add trampoline stuff for bootloaders that do not support ELF
- Replace arm'ish KERNPHYSADDR/KERNVIRTADDR with
KERNLOADADDR/TRAMPLOADADDR and clean configs
2010-01-10 05:34:46 +00:00
|
|
|
CLEAN+= ${LDSCRIPT_NAME} ${LDSCRIPT_NAME}.tramp.noheader \
|
|
|
|
${KERNEL_KO}.tramp.noheader ${KERNEL_KO}.tramp.bin
|
|
|
|
|
|
|
|
${LDSCRIPT_NAME}: $S/conf/${LDSCRIPT_NAME}
|
2011-01-10 05:13:06 +00:00
|
|
|
sed s/KERNLOADADDR/${KERNLOADADDR}/g $S/conf/${LDSCRIPT_NAME} \
|
Merge r187428, r191079, r195533, r195669, r197004, r197012 and r197015
from projects/mips to head by hand:
r197015 | imp | 2009-09-08 21:59:46 -0600 (Tue, 08 Sep 2009) | 2 lines
Prefer PTR_LA over a naked la to work with 64-bits..
r197012 | imp | 2009-09-08 21:46:04 -0600 (Tue, 08 Sep 2009) | 3 lines
Use proper set of flags to build the tramp. this gets 64-bit almost
building and lets me debug the 'almost' :)
r197004 | imp | 2009-09-08 18:47:12 -0600 (Tue, 08 Sep 2009) | 2 lines
Use ${LDSCRIPT_NAME} in preference to ldscript.$M.
r195669 | gonzo | 2009-07-13 17:03:44 -0600 (Mon, 13 Jul 2009) | 3 lines
- Remove -mno-dsp from CFLAGS. MIPS DSP ASE is off by default
now (as it should be)
r195533 | imp | 2009-07-10 01:21:26 -0600 (Fri, 10 Jul 2009) | 4 lines
Add in the emulation selection when linking... We're still not 100%
of the way there, but we're better with it. hack.so build now, but
we die when we try to link it in.
r191079 | gonzo | 2009-04-14 16:53:22 -0600 (Tue, 14 Apr 2009) | 2 lines
- Revert changes accidentally killed by merge operation
r187418 | gonzo | 2009-01-18 19:37:10 -0700 (Sun, 18 Jan 2009) | 4 lines
- Add trampoline stuff for bootloaders that do not support ELF
- Replace arm'ish KERNPHYSADDR/KERNVIRTADDR with
KERNLOADADDR/TRAMPLOADADDR and clean configs
2010-01-10 05:34:46 +00:00
|
|
|
> ${LDSCRIPT_NAME}
|
2008-04-13 06:25:43 +00:00
|
|
|
%RULES
|
|
|
|
|
|
|
|
.include "$S/conf/kern.post.mk"
|