# Set default values for essential variables
: ${GENERATE_MAP="no"}
-: ${C="servers,drivers"}
+: ${C="servers,fs,net,drivers"}
function usage()
{
OPTFLAGS=" ${OPTFLAGS} ${LLVMPASS_PATHS} ${LLVMARGS}"
fi
-TARGET_MODULES=`echo $C | sed -e "s/,/ /g"`
+TARGET_MODULES=`echo " $C " | sed -e "s/,/ /g" -e "s/ rd / ramdisk memory /g"`
for m in ${TARGET_MODULES}
do
echo "Error: Couldn't fetch the module name for $m"
continue
fi
+ if [ "$n" == "ramdisk" ] || [ "$n" == "memory" ]; then
+ (cd minix/llvm && C=$n ./relink.llvm)
+ continue
+ fi
clean_module $n $m
OPTFLAGS=`echo ${OPTFLAGS} | sed -e "s/\ /\\\ /g"`
OPTFLAGS_PLACEHOLDER="OPTFLAGS.$n=${OPTFLAGS}"
sed -i "s/ROOT=.*$/ROOT=\"${ROOT_1}\"/g" ${MINIX_LLVM_DIR}/common.inc
. ${MINIX_LLVM_DIR}/minix.inc
-# Configure llvm-apps
-cp ${ROOT}/conf/common.overrides.llvm-minix.inc ${ROOT}/common.overrides.llvm.inc
-MINIX_ROOT_1=`readlink -f ${MINIX_ROOT}`
-echo "_MINIX_ROOT=\"${MINIX_ROOT_1}\"" > ${ROOT}/common.overrides.minix.inc
-
if [ ! -d ${ROOT}/.tmp ]; then
mkdir ${ROOT}/.tmp 2>/dev/null || true
fi
cd ${MYPWD}
if [ "$EXITCODE" != "0" ]; then
echo "Error: Failed building Minix source code."
- exit $EXITCODE
else
echo "Completed building Minix source code."
- exit $EXITCODE
fi
else
echo "Building Minix: NO"
fi
-# Reconfigure llvm-apps
+# Configure llvm-apps
+cp ${ROOT}/conf/common.overrides.llvm-minix.inc ${ROOT}/common.overrides.llvm.inc
+MINIX_ROOT_1=`readlink -f ${MINIX_ROOT}`
MINIX_TOOLS_DIR=$(readlink -f ${MINIX_ROOT}/../obj.i386/tooldir.*)
-echo "MINIX_TOOLS_DIR=\"${MINIX_TOOLS_DIR}\"" >> ${ROOT}/common.overrides.minix.inc
+echo "_MINIX_ROOT=\"${MINIX_ROOT_1}\"" > ${ROOT}/common.overrides.minix.inc
+echo "_MINIX_TOOLS_DIR=\"${MINIX_TOOLS_DIR}\"" >> ${ROOT}/common.overrides.minix.inc
+exit $EXITCODE
echo "Generating Minix modules map..." 1>&2
cd ${MINIX_ROOT}
- grep -r "^PROG=" . --include=Makefile | sed -e "s/\s*//g" | sed -e "s/PROG=//g" > ${TMPFILE}
- grep -r "^PROGS=" . --include=Makefile | sed -e "s/\s\s*/ /g" | sed -e "s/PROGS=//g" | sed -e "s/\.\///g" | (
+ grep -r "^PROG *=" . --include=Makefile | sed -e "s/\s*//g" | sed -e "s/PROG *=//g" > ${TMPFILE}
+ grep -r "^PROGS *=" . --include=Makefile | sed -e "s/\s\s*/ /g" | sed -e "s/PROGS *=//g" | sed -e "s/\.\///g" | (
while read line; do
path=$(echo $line | cut -d' ' -f 1)
progs=$(echo $line | cut -d' ' -f 2-)
blacklist="$blacklist -e ^tps65950="
blacklist="$blacklist -e ^tsl2550="
blacklist="$blacklist -e ^usbd="
- grep -v -e ^${GREP_FILTER}= -e ^memory= $blacklist ${TMPFILE}.2 > ${OUTFILE}
+ grep -v -e ^${GREP_FILTER}= -e ^ramdisk -e ^memory= $blacklist ${TMPFILE}.2 > ${OUTFILE}
+ echo ramdisk=minix/drivers/storage/ramdisk >> ${OUTFILE} # ramdisk always second last
echo memory=minix/drivers/storage/memory >> ${OUTFILE} # memory always last
rm -rf ${TMPFILE} ${TMPFILE}.1 ${TMPFILE}.2
if [ ! -f "${MINIX_MODULES_MAPFILE}" ]; then
generate_modules_map
fi
- if [ $MODULE_NAME == "servers" ] || [ $MODULE_NAME == "drivers" ]; then
+ if [ $MODULE_NAME == "servers" ] || [ $MODULE_NAME == "drivers" ] || [ $MODULE_NAME == "fs" ] || [ $MODULE_NAME == "net" ] || [ $MODULE_NAME == "commands" ]; then
MODULE_NAME="=minix/${MODULE_NAME}/"
else
MODULE_NAME="^${MODULE_NAME}="
# Set default values to essential variables.
: ${GENERATE_MAP="no"}
-: ${C="servers,drivers"}
+: ${C="servers,fs,net,drivers"}
function usage()
{
STATIC_LIBS=`find_static_libs $*`
-TARGET_MODULES=`echo $C | sed -e "s/,/ /g"`
+TARGET_MODULES=`echo " $C " | sed -e "s/,/ /g" -e "s/ rd / ramdisk memory /g"`
for m in ${TARGET_MODULES}
do
fi
env "`echo ${LDFLAGS_PLACEHOLDER}`" MKBITCODE=yes \
- ${TOOLDIR}/nbmake-${ARCH} -C $m
+ ${TOOLDIR}/nbmake-${ARCH} -C $m all install
echo
done