1. Adam Hoka
  2. oss4-netbsd

Source

oss4-netbsd / setup / NetBSD / ddk.sh

#!/bin/sh -e

if [ -z $1 ]; then
	DEST=/usr/ddk
else
	DEST=$1
fi

if [ -e $DEST ]
then
    rm -fr $DEST
fi

#if [ ! $(uname -m) = i386 ]; then
#	echo "Platform not supported..."
#	exit
#fi

MACHINE=$(uname -m)

mkdir -p ${DEST}/include
cp -r /usr/src/sys/sys ${DEST}/include/
for i in /usr/src/common/include/*
do
    if [ $i != "CVS" ]
    then
	cp -r $i ${DEST}/include
    fi
done
cp -r /usr/src/sys/arch/amd64/include ${DEST}/include/${MACHINE}
cp -r /usr/src/sys/arch/x86/include ${DEST}/include/x86
mkdir ${DEST}/include/secmodel
cp -r /usr/src/sys/secmodel/secmodel.h ${DEST}/include/secmodel
cp -r ${DEST}/include/${MACHINE} ${DEST}/include/machine
cp /usr/src/sys/sys/bus.h ${DEST}/include/machine
cp /usr/src/sys/sys/stdarg.h ${DEST}/include/machine
#cp /usr/src/sys/sys/bus.h ${DEST}/include/${MACHINE}
#ln -s ${DEST}/include/amd64 ${DEST}/include/machine

mkdir -p ${DEST}/include/lib/libkern
cp -r /usr/src/sys/lib/libkern/libkern.h ${DEST}/include/lib/libkern

for i in $(find /usr/src/sys/crypto/ -name '*.h'); do
	pax -rw -s '/usr\/src\/sys\///' $i ${DEST}/include
done

for i in $(find /usr/src/sys/dev/ -name '*.h'); do
	pax -rw -s '/usr\/src\/sys\///' $i ${DEST}/include
done