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.
|
2018-07-17 14:11:30 +00:00
|
|
|
%VERSREQ= 600012
|
2008-04-13 06:25:43 +00:00
|
|
|
|
|
|
|
STD8X16FONT?= iso
|
|
|
|
|
|
|
|
.if !defined(S)
|
|
|
|
.if exists(./@/.)
|
|
|
|
S= ./@
|
|
|
|
.else
|
|
|
|
S= ../../..
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.include "$S/conf/kern.pre.mk"
|
|
|
|
|
2011-10-18 07:29:21 +00:00
|
|
|
INCLUDES+= -I$S/contrib/libfdt
|
|
|
|
|
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
|
|
|
|
2019-10-15 17:11:42 +00:00
|
|
|
# We default to the MIPS32 ISA for O32 and MIPS64 ISA for N64 and N32
|
|
|
|
# if none is specified in the kernel configuration file.
|
|
|
|
.if ${MACHINE_ARCH:Mmips64*} != "" || ${MACHINE_ARCH:Mmipsn32*} != ""
|
|
|
|
ARCH_FLAGS?=-march=mips64
|
|
|
|
.else
|
2008-04-13 06:25:43 +00:00
|
|
|
ARCH_FLAGS?=-march=mips32
|
2019-10-15 17:11:42 +00:00
|
|
|
.endif
|
|
|
|
ARCH_FLAGS+=-mabi=${MIPS_ABI}
|
2015-12-21 20:36:01 +00:00
|
|
|
EXTRA_FLAGS=-fno-pic -mno-abicalls -G0 -DKERNLOADADDR=${KERNLOADADDR}
|
2019-10-15 17:11:42 +00:00
|
|
|
EXTRA_FLAGS+=-${MIPS_ENDIAN}
|
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)
|
2011-07-16 17:22:01 +00:00
|
|
|
TRAMP_ARCH_FLAGS?=$(ARCH_FLAGS)
|
|
|
|
TRAMP_EXTRA_FLAGS=${EXTRA_FLAGS} ${TRAMP_ARCH_FLAGS}
|
2016-11-16 03:24:20 +00:00
|
|
|
# Kernel code is always compiled with soft-float on MIPS
|
|
|
|
TRAMP_EXTRA_FLAGS+=-msoft-float
|
2011-07-16 17:22:01 +00:00
|
|
|
.if ${MACHINE_ARCH:Mmips64*} != ""
|
|
|
|
TRAMP_ELFSIZE=64
|
|
|
|
.else
|
|
|
|
TRAMP_ELFSIZE=32
|
|
|
|
.endif
|
2008-04-13 06:25:43 +00:00
|
|
|
|
|
|
|
ASM_CFLAGS+=${CFLAGS} -D_LOCORE -DLOCORE
|
|
|
|
|
2012-03-13 06:22:49 +00:00
|
|
|
.if !defined(WITHOUT_KERNEL_TRAMPOLINE)
|
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
|
2016-05-16 23:56:31 +00:00
|
|
|
KERNEL_EXTRA_INSTALL=${KERNEL_KO}.tramp.bin
|
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
|
|
|
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 \
|
2011-07-16 17:22:01 +00:00
|
|
|
-T -Xlinker ${LDSCRIPT_NAME}.tramp.noheader \
|
|
|
|
-DKERNNAME="\"${KERNEL_KO}.tmp\"" -DELFSIZE=${TRAMP_ELFSIZE} \
|
2020-01-15 15:59:32 +00:00
|
|
|
-fno-asynchronous-unwind-tables \
|
2016-05-16 23:56:31 +00:00
|
|
|
$S/$M/$M/inckern.S $S/$M/$M/elf_trampoline.c \
|
2011-07-16 17:22:01 +00:00
|
|
|
-o ${KERNEL_KO}.tramp.elf
|
|
|
|
${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.elf \
|
|
|
|
${KERNEL_KO}.tramp.bin
|
2012-03-13 06:22:49 +00:00
|
|
|
.endif
|
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
|
|
|
%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 \
|
2011-07-16 17:22:01 +00:00
|
|
|
${KERNEL_KO}.tramp.elf ${KERNEL_KO}.tramp.bin
|
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}: $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"
|