summaryrefslogtreecommitdiffstats
path: root/sys/conf/kern.pre.mk
diff options
context:
space:
mode:
Diffstat (limited to 'sys/conf/kern.pre.mk')
-rw-r--r--sys/conf/kern.pre.mk29
1 files changed, 29 insertions, 0 deletions
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index cf1b127..3783881 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -191,6 +191,9 @@ SYSTEM_DEP= Makefile ${SYSTEM_OBJS}
SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS}
SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o}
SYSTEM_OBJS+= hack.So
+.if ${MFS_IMAGE:Uno} != "no"
+SYSTEM_OBJS+= embedfs_${MFS_IMAGE:T:R}.o
+.endif
SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} --no-warn-mismatch \
--warn-common --export-dynamic --dynamic-linker /red/herring \
-o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
@@ -222,6 +225,32 @@ MKMODULESENV+= DEBUG_FLAGS="${DEBUG}"
.endif
MKMODULESENV+= _MPATH="${_MPATH}"
+# Architecture and output format arguments for objdump to convert image to
+# object file
+.if ${MFS_IMAGE:Uno} != "no"
+
+.if !defined(EMBEDFS_FORMAT.${MACHINE_ARCH})
+EMBEDFS_FORMAT.${MACHINE_ARCH}!= awk -F'"' '/OUTPUT_FORMAT/ {print $$2}' ${LDSCRIPT}
+.if empty(EMBEDFS_FORMAT.${MACHINE_ARCH})
+.undef EMBEDFS_FORMAT.${MACHINE_ARCH}
+.endif
+.endif
+
+.if !defined(EMBEDFS_ARCH.${MACHINE_ARCH})
+EMBEDFS_ARCH.${MACHINE_ARCH}!= sed -n '/OUTPUT_ARCH/s/.*(\(.*\)).*/\1/p' ${LDSCRIPT}
+.if empty(EMBEDFS_ARCH.${MACHINE_ARCH})
+.undef EMBEDFS_ARCH.${MACHINE_ARCH}
+.endif
+.endif
+
+EMBEDFS_FORMAT.arm?= elf32-littlearm
+EMBEDFS_FORMAT.armv6?= elf32-littlearm
+EMBEDFS_FORMAT.mips?= elf32-tradbigmips
+EMBEDFS_FORMAT.mipsel?= elf32-tradlittlemips
+EMBEDFS_FORMAT.mips64?= elf64-tradbigmips
+EMBEDFS_FORMAT.mips64el?= elf64-tradlittlemips
+.endif
+
# Detect kernel config options that force stack frames to be turned on.
DDB_ENABLED!= grep DDB opt_ddb.h || true ; echo
DTR_ENABLED!= grep KDTRACE_FRAME opt_kdtrace.h || true ; echo
OpenPOWER on IntegriCloud