2004-05-14 11:49:40 +00:00
|
|
|
# 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
|
2004-09-23 22:47:57 +00:00
|
|
|
# /sys/arm/conf/``machineid''
|
2004-05-14 11:49:40 +00:00
|
|
|
# after which you should do
|
|
|
|
# config machineid
|
|
|
|
# Generic makefile changes should be made in
|
2004-09-23 22:47:57 +00:00
|
|
|
# /sys/conf/Makefile.arm
|
2004-05-14 11:49:40 +00:00
|
|
|
# after which config should be rerun for all machines.
|
|
|
|
#
|
|
|
|
|
|
|
|
# Which version of config(8) is required.
|
2005-11-28 17:51:31 +00:00
|
|
|
%VERSREQ= 600004
|
2004-05-14 11:49:40 +00:00
|
|
|
|
|
|
|
# Temporary stuff while we're still embryonic
|
2004-10-24 15:33:08 +00:00
|
|
|
NO_MODULES=
|
2004-05-14 11:49:40 +00:00
|
|
|
|
|
|
|
STD8X16FONT?= iso
|
|
|
|
|
|
|
|
.if !defined(S)
|
|
|
|
.if exists(./@/.)
|
|
|
|
S= ./@
|
|
|
|
.else
|
|
|
|
S= ../../..
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.include "$S/conf/kern.pre.mk"
|
|
|
|
|
2004-09-23 22:47:57 +00:00
|
|
|
SYSTEM_LD:= ${SYSTEM_LD:$S/conf/ldscript.$M=ldscript.$M}
|
|
|
|
SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/ldscript.$M=ldscript.$M}
|
2005-01-19 16:43:43 +00:00
|
|
|
|
|
|
|
.if defined(ARM_BIG_ENDIAN)
|
|
|
|
CC += -mbig-endian
|
|
|
|
SYSTEM_LD += -EB
|
|
|
|
.endif
|
|
|
|
|
2005-10-17 18:31:37 +00:00
|
|
|
|
2006-03-27 00:32:46 +00:00
|
|
|
.if !defined(DEBUG) && !defined(PROFLEVEL)
|
2005-06-27 14:33:32 +00:00
|
|
|
CFLAGS += -mno-apcs-frame
|
2005-12-05 12:55:46 +00:00
|
|
|
STRIP_FLAGS = -S
|
2005-06-27 14:33:32 +00:00
|
|
|
.endif
|
2005-10-03 14:09:58 +00:00
|
|
|
|
|
|
|
DDB_ENABLED!= grep DDB opt_ddb.h || true
|
|
|
|
|
2005-11-25 03:30:45 +00:00
|
|
|
SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.noheader \
|
2005-11-24 02:25:49 +00:00
|
|
|
-warn-common -export-dynamic -dynamic-linker /red/herring -o \
|
|
|
|
${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o
|
2005-12-20 01:28:17 +00:00
|
|
|
SYSTEM_LD_TAIL +=;sed s/" + SIZEOF_HEADERS"// ldscript.$M\
|
2005-11-24 02:25:49 +00:00
|
|
|
>ldscript.$M.noheader; \
|
|
|
|
${SYSTEM_LD_}; \
|
|
|
|
${OBJCOPY} -S -O binary ${FULLKERNEL}.noheader \
|
|
|
|
${KERNEL_KO}.bin; \
|
|
|
|
rm ${FULLKERNEL}.noheader
|
2005-12-20 20:57:20 +00:00
|
|
|
|
|
|
|
trampoline: ${KERNEL_KO}.tramp
|
|
|
|
${KERNEL_KO}.tramp: ${KERNEL_KO}
|
|
|
|
echo "#define KERNNAME \"${KERNEL_KO}.tmp\"" >opt_kernname.h
|
|
|
|
sed s/${KERNVIRTADDR}/${KERNPHYSADDR}/ ldscript.$M > ldscript.$M.tramp
|
2005-12-20 01:28:17 +00:00
|
|
|
sed s/" + SIZEOF_HEADERS"// ldscript.$M.tramp > \
|
2005-12-20 20:57:20 +00:00
|
|
|
ldscript.$M.tramp.noheader
|
2005-12-20 01:28:17 +00:00
|
|
|
${OBJCOPY} --strip-symbol '$$d' --strip-symbol '$$a' \
|
2005-12-20 20:57:20 +00:00
|
|
|
-g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp
|
2005-12-20 01:28:17 +00:00
|
|
|
${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.$M.tramp \
|
2005-12-20 20:57:20 +00:00
|
|
|
$S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S -o ${KERNEL_KO}.tramp
|
2005-12-20 01:28:17 +00:00
|
|
|
${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.$M.tramp.noheader \
|
2005-11-24 02:25:49 +00:00
|
|
|
$S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S -o \
|
2005-12-20 20:57:20 +00:00
|
|
|
${KERNEL_KO}.tramp.noheader
|
2005-11-24 02:25:49 +00:00
|
|
|
${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \
|
2005-12-20 20:57:20 +00:00
|
|
|
${KERNEL_KO}.tramp.bin
|
|
|
|
${OBJCOPY} ${STRIP_FLAGS} ${KERNEL_KO}.tmp
|
|
|
|
echo "#define KERNNAME \"${KERNEL_KO}.tmp.gz\"" \
|
|
|
|
>opt_kernname.h
|
2006-01-20 00:46:44 +00:00
|
|
|
eval $$(stat -s ${KERNEL_KO}.tmp) && \
|
|
|
|
echo "#define KERNSIZE $$st_size" >>opt_kernname.h
|
2005-12-20 20:57:20 +00:00
|
|
|
gzip -9 ${KERNEL_KO}.tmp
|
2005-12-05 12:55:46 +00:00
|
|
|
eval $$(stat -s ${KERNEL_KO}.tmp.gz) && \
|
2006-01-20 00:46:44 +00:00
|
|
|
echo "#define KERNCOMPSIZE $$st_size" >>opt_kernname.h
|
2005-12-20 20:57:20 +00:00
|
|
|
${CC} -O2 -DKZIP -I. -c $S/kern/inflate.c -o inflate-tramp.o
|
2005-12-20 01:28:17 +00:00
|
|
|
${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.$M.tramp \
|
|
|
|
-DKZIP $S/$M/$M/elf_trampoline.c inflate-tramp.o $S/$M/$M/inckern.S \
|
2005-12-20 20:57:20 +00:00
|
|
|
-o ${KERNEL_KO}.gz.tramp
|
2005-12-20 01:28:17 +00:00
|
|
|
${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.$M.tramp.noheader \
|
|
|
|
-DKZIP $S/$M/$M/elf_trampoline.c inflate-tramp.o $S/$M/$M/inckern.S \
|
2005-12-20 20:57:20 +00:00
|
|
|
-o ${KERNEL_KO}.tramp.noheader
|
2005-12-05 12:55:46 +00:00
|
|
|
${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \
|
2005-12-20 20:57:20 +00:00
|
|
|
${KERNEL_KO}.gz.tramp.bin
|
2005-12-20 01:28:17 +00:00
|
|
|
rm ${KERNEL_KO}.tmp.gz ${KERNEL_KO}.tramp.noheader opt_kernname.h \
|
2005-12-20 20:57:20 +00:00
|
|
|
inflate-tramp.o
|
2005-10-03 14:09:58 +00:00
|
|
|
|
2004-05-14 11:49:40 +00:00
|
|
|
%BEFORE_DEPEND
|
|
|
|
|
|
|
|
%OBJS
|
|
|
|
|
|
|
|
%FILES.c
|
|
|
|
|
|
|
|
%FILES.s
|
|
|
|
|
|
|
|
%FILES.m
|
|
|
|
|
|
|
|
%CLEAN
|
|
|
|
|
2005-12-20 01:28:17 +00:00
|
|
|
CLEAN+= ldscript.$M ${KERNEL_KO}.bin ldscript.$M.noheader
|
|
|
|
|
2005-10-04 14:38:55 +00:00
|
|
|
.if ${DDB_ENABLED} != ""
|
2005-12-20 01:28:17 +00:00
|
|
|
CLEAN+= ${KERNEL_KO}.tramp ${KERNEL_KO}.tramp.bin ldscript.$M.tramp \
|
|
|
|
ldscript.$M.tramp.noheader ${KERNEL_KO}.gz.tramp \
|
|
|
|
${KERNEL_KO}.gz.tramp.bin
|
|
|
|
|
2005-10-04 14:38:55 +00:00
|
|
|
.endif
|
2004-09-23 22:47:57 +00:00
|
|
|
ldscript.$M: $S/conf/ldscript.$M
|
|
|
|
cat $S/conf/ldscript.$M|sed s/KERNPHYSADDR/${KERNPHYSADDR}/g| \
|
|
|
|
sed s/KERNVIRTADDR/${KERNVIRTADDR}/g > ldscript.$M
|
2004-05-14 11:49:40 +00:00
|
|
|
%RULES
|
|
|
|
|
|
|
|
.include "$S/conf/kern.post.mk"
|