freebsd-skq/sys/conf/Makefile.arm

113 lines
3.1 KiB
Makefile

# Makefile.arm -- with config changes.
# Copyright 1990 W. Jolitz
# from: @(#)Makefile.i386 7.1 5/10/91
# $FreeBSD$
#
# Makefile for FreeBSD
#
# This makefile is constructed from a machine description:
# config machineid
# Most changes should be made in the machine description
# /sys/arm/conf/``machineid''
# after which you should do
# config machineid
# Generic makefile changes should be made in
# /sys/conf/Makefile.arm
# after which config should be rerun for all machines.
#
# Which version of config(8) is required.
%VERSREQ= 600004
# Temporary stuff while we're still embryonic
NO_MODULES=
STD8X16FONT?= iso
.if !defined(S)
.if exists(./@/.)
S= ./@
.else
S= ../../..
.endif
.endif
.include "$S/conf/kern.pre.mk"
SYSTEM_LD:= ${SYSTEM_LD:$S/conf/ldscript.$M=ldscript.$M}
SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/ldscript.$M=ldscript.$M}
.if defined(ARM_BIG_ENDIAN)
CC += -mbig-endian
SYSTEM_LD += -EB
.endif
.if !defined(DEBUG)
CFLAGS += -mno-apcs-frame
STRIP_FLAGS = -S
.endif
DDB_ENABLED!= grep DDB opt_ddb.h || true
SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.noheader \
-warn-common -export-dynamic -dynamic-linker /red/herring -o \
${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o
SYSTEM_LD_TAIL +=; cat ldscript.$M| \
sed s/" + SIZEOF_HEADERS"// \
>ldscript.$M.noheader; \
${SYSTEM_LD_}; \
${OBJCOPY} -S -O binary ${FULLKERNEL}.noheader \
${KERNEL_KO}.bin; \
rm ${FULLKERNEL}.noheader
.if ${DDB_ENABLED} != "" || defined(BUILD_ELF_TRAMPOLINE)
SYSTEM_LD_TAIL += ;echo "\#define KERNNAME \"${KERNEL_KO}.tmp\"" \
>opt_kernname.h ;\
${OBJCOPY} ${STRIP_FLAGS} --strip-symbol '$$d' --strip-symbol '$$a' \
-g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp;\
${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.arm \
$S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S -o ${KERNEL_KO}.tramp;\
${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.arm.noheader \
$S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S -o \
${KERNEL_KO}.tramp.noheader; \
${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \
${KERNEL_KO}.tramp.bin; \
gzip -9 ${KERNEL_KO}.tmp; \
echo "\#define KERNNAME \"${KERNEL_KO}.tmp.gz\"" \
>opt_kernname.h ;\
eval $$(stat -s ${KERNEL_KO}.tmp.gz) && \
echo "\#define KERNSIZE $$st_size" >>opt_kernname.h;\
${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.arm \
-DKZIP $S/$M/$M/elf_trampoline.c $S/kern/inflate.c $S/$M/$M/inckern.S \
-o ${KERNEL_KO}.gz.tramp;\
${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.arm.noheader \
-DKZIP $S/$M/$M/elf_trampoline.c $S/kern/inflate.c $S/$M/$M/inckern.S \
-o ${KERNEL_KO}.tramp.noheader; \
${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \
${KERNEL_KO}.gz.tramp.bin; \
rm ${KERNEL_KO}.tmp.gz ${KERNEL_KO}.tramp.noheader opt_kernname.h;
.endif
CLEANFILES += ldscript.$M ldscript.$M.noheader ${KERNEL_KO}.bin \
${KERNEL_KO}.tramp ${KERNEL_KO}.tramp.bin
%BEFORE_DEPEND
%OBJS
%FILES.c
%FILES.s
%FILES.m
%CLEAN
.if ${DDB_ENABLED} != ""
CLEAN+= kernel.tramp
.endif
ldscript.$M: $S/conf/ldscript.$M
cat $S/conf/ldscript.$M|sed s/KERNPHYSADDR/${KERNPHYSADDR}/g| \
sed s/KERNVIRTADDR/${KERNVIRTADDR}/g > ldscript.$M
%RULES
.include "$S/conf/kern.post.mk"