MACHINE = evbarm MACHINE_ARCH = earmv7hf KERNEL = RPI2 ROOT = ${.CURDIR} SRCROOT = ${ROOT}/src TOOLROOT = ${ROOT}/tool WORKROOT = ${ROOT}/work DESTROOT = ${WORKROOT}/dest FSROOT = ${WORKROOT}/filesystem MAKE-SCP = ${TOOLROOT}/bin/make-scp make-cmd: (mkdir -p ${WORKROOT}/make ; \ cd ${WORKROOT}/make ; \ sh ${SRCROOT}/tools/make/configure ; \ sh ./buildmake.sh ; \ mkdir -p ${TOOLROOT}/bin ; \ cp nbmake ${TOOLROOT}/bin) make-scp: echo "#!/bin/sh" > ${MAKE-SCP} echo "USETOOLS=yes ; export USETOOLS" >> ${MAKE-SCP} echo "MACHINE=${MACHINE} ; export MACHINE" >> ${MAKE-SCP} echo "MACHINE_ARCH=${MACHINE_ARCH} ; export MACHINE_ARCH" >> ${MAKE-SCP} echo "MAKEWRAPPERMACHINE=${MACHINE} ; export MAKEWRAPPERMACHINE" >> ${MAKE-SCP} echo 'MAKEFLAGS="-m ${SRCROOT}/share/mk MKOBJDIRS=yes" ; export MAKEFLAGS' >> ${MAKE-SCP} echo "TOOLDIR=${TOOLROOT} ; export TOOLDIR" >> ${MAKE-SCP} echo "DESTDIR=${DESTROOT} ; export DESTDIR" >> ${MAKE-SCP} echo "MKUNPRIVED=yes ; export MKUNPRIVED" >> ${MAKE-SCP} echo "UNPRIVED=yes ; export UNPRIVED" >> ${MAKE-SCP} echo 'exec ${TOOLROOT}/bin/nbmake $${1+"$$@"}' >> ${MAKE-SCP} chmod +x ${MAKE-SCP} pre-tool-chain: (MKTOOLS=yes ; export MKTOOLS ; \ cd ${SRCROOT}/tools/host-mkdep ; \ ${MAKE-SCP} all install ; \ cd ${SRCROOT}/tools/compat ; \ ${MAKE-SCP} all install ; \ cd ${SRCROOT}/tools/binstall ; \ ${MAKE-SCP} all install ; \ cd ${SRCROOT}/tools/yacc ; \ ${MAKE-SCP} all install ; \ cd ${SRCROOT}/tools/texinfo ; \ ${MAKE-SCP} all install ; \ cd ${SRCROOT}/tools/gmake ; \ ${MAKE-SCP} all install ; \ cd ${SRCROOT}/tools/gcc ; \ ${MAKE-SCP} all install) tool-chain: (mkdir -p ${TOOLROOT} ; \ cd ${SRCROOT}/tools ; \ MKTOOLS=yes ; export MKTOOLS ; \ MKUPDATE=yes ; export MKUPDATE ; \ MKCROSSGDB=yes ; export MKCROSSGDB ; \ USETOOLS=no ; export USETOOLS ; \ ${MAKE-SCP} build_install) tools: make-cmd make-scp tool-chain include: (mkdir -p ${DESTROOT}/usr/include/arpa ; \ mkdir -p ${DESTROOT}/usr/include/sys ; \ mkdir -p ${DESTROOT}/usr/include/protocols ; \ mkdir -p ${DESTROOT}/usr/include/rpcsvc ; \ mkdir -p ${DESTROOT}/usr/include/rpc ; \ mkdir -p ${DESTROOT}/usr/include/readline ; \ mkdir -p ${DESTROOT}/usr/include/openssl ; \ mkdir -p ${DESTROOT}/usr/include/kerberosIV ; \ mkdir -p ${DESTROOT}/usr/include/krb5 ; \ mkdir -p ${DESTROOT}/usr/include/kadm5 ; \ mkdir -p ${DESTROOT}/usr/include/gssapi ; \ mkdir -p ${DESTROOT}/usr/include/cdk ; \ mkdir -p ${DESTROOT}/usr/include/security ; \ mkdir -p ${DESTROOT}/usr/include/objc ; \ mkdir -p ${DESTROOT}/usr/include/g++/backward ; \ mkdir -p ${DESTROOT}/usr/include/g++/ext ; \ mkdir -p ${DESTROOT}/usr/include/g++/bits ; \ mkdir -p ${DESTROOT}/usr/include/libmilter ; \ mkdir -p ${DESTROOT}/usr/share/tmac ; \ cd ${SRCROOT} ; \ ${MAKE-SCP} includes) lib-csu: (mkdir -p ${DESTROOT}/usr/lib ; \ cd ${SRCROOT}/lib/csu ; \ ${MAKE-SCP} dependall install) lib-crt: (mkdir -p ${DESTROOT}/usr/lib ; \ cd ${SRCROOT}/gnu/lib/crtstuff3 ; \ ${MAKE-SCP} dependall install) lib-gcc3: (mkdir -p ${DESTROOT}/usr/lib ; \ cd ${SRCROOT}/gnu/lib/libgcc3 ; \ ${MAKE-SCP} dependall install) glib: (mkdir -p ${DESTROOT}/usr/lib ; \ mkdir -p ${DESTROOT}/usr/share/info ; \ mkdir -p ${DESTROOT}/usr/libdata ; \ MKMAN=no ; export MKMAN ; \ cd ${SRCROOT}/gnu/lib ; \ ${MAKE-SCP} dependall install) nblib: (MKMAN=no ; export MKMAN ; \ MKSKEY=no ; export MKSKEY ; \ MKCRYPTO=no ; export MKCRYPTO ; \ MKKERBEROS=no ; export MKKERBEROS ; \ cd ${SRCROOT}/lib ; \ ${MAKE-SCP} install) audiolib: (cd ${SRCROOT}/usr.bin/audio/common ; \ MKPIC=no ; export MKPIC ; \ MKPICLIB=no ; export MKPICLIB ; \ MKSHLIBOBJS=no ; export MKSHLIBOBJS ; \ ${MAKE-SCP} dependall) cp ${SRCROOT}/usr.bin/audio/common/libaudio.a ${DESTROOT}/lib smblib: (cd ${SRCROOT}/dist/smbfs ; \ ${MAKE-SCP} configure) (cd ${SRCROOT}/dist/smbfs/lib/smb ; \ ${MAKE-SCP} dependall) cp ${SRCROOT}/dist/smbfs/lib/smb/libsmb.a ${DESTROOT}/lib nblib-install: (mkdir -p ${DESTROOT}/lib ; \ mkdir -p ${DESTROOT}/var/db ; \ mkdir -p ${DESTROOT}/usr/lib/i18n ; \ mkdir -p ${DESTROOT}/usr/lib/security ; \ mkdir -p ${DESTROOT}/usr/share/nls/C ; \ mkdir -p ${DESTROOT}/usr/share/nls/Pig ; \ mkdir -p ${DESTROOT}/usr/share/nls/ca ; \ mkdir -p ${DESTROOT}/usr/share/nls/cs ; \ mkdir -p ${DESTROOT}/usr/share/nls/de ; \ mkdir -p ${DESTROOT}/usr/share/nls/es ; \ mkdir -p ${DESTROOT}/usr/share/nls/fi ; \ mkdir -p ${DESTROOT}/usr/share/nls/fr ; \ mkdir -p ${DESTROOT}/usr/share/nls/nl ; \ mkdir -p ${DESTROOT}/usr/share/nls/no ; \ mkdir -p ${DESTROOT}/usr/share/nls/pl ; \ mkdir -p ${DESTROOT}/usr/share/nls/sk ; \ mkdir -p ${DESTROOT}/usr/share/nls/sv ; \ mkdir -p ${DESTROOT}/usr/share/doc/html/bzip2 ; \ mkdir -p ${DESTROOT}/usr/share/doc/psd/19.curses ; \ mkdir -p ${DESTROOT}/usr/share/misc ; \ MKMAN=no ; export MKMAN ; \ MKSKEY=no ; export MKSKEY ; \ MKCRYPTO=no ; export MKCRYPTO ; \ MKKERBEROS=no ; export MKKERBEROS ; \ cd ${SRCROOT}/lib ; \ ${MAKE-SCP} install) lib: lib-csu lib-crt lib-gcc3 glib nblib nblib-install SYSWORKROOT = ${WORKROOT}/sys SYSSRCROOT = ${SRCROOT}/sys #SYSCONF = ${SYSSRCROOT}/arch/${MACHINE_ARCH}/conf/${KERNEL} #SYSCONF = ${ROOT}/${KERNEL} SYSCONF = ${KERNEL} SYSCONFDIR = ${SYSSRCROOT}/arch/${MACHINE}/conf sys: mkdir -p ${SYSWORKROOT} (cd ${SYSCONFDIR} ; \ ${TOOLROOT}/bin/nbconfig -b ${SYSWORKROOT} -s ${SYSSRCROOT} ${SYSCONF}) (cd ${SYSWORKROOT} ; \ ${MAKE-SCP} dependall) cp ${SYSWORKROOT}/netbsd ${ROOT} USRWORKROOT = ${WORKROOT}/usr USERBIN = usr user-land: mkdir -p ${USRWORKROOT} (cd ${USRWORKROOT} ; \ CRUNCHBIN=${USERBIN} ; export CRUNCHBIN ; \ OBJDIR=${USRWORKROOT} ; export OBJDIR ; \ NETBSDSRCDIR=${SRCROOT} ; export NETBSDSRCDIR ; \ CURDIR=${.CURDIR} ; export CURDIR ; \ awk -f ${SRCROOT}/distrib/common/parselist.awk -v mode=crunch ${ROOT}/list > usr.conf) (cd ${USRWORKROOT} ; \ ${TOOLROOT}/bin/nbcrunchgen -D ${SRCROOT} -m Makefile usr.conf) (cd ${USRWORKROOT} ; \ NETBSDSRCDIR=${SRCROOT} ; export NETBSDSRCDIR ; \ USE_PAM=no ; export USE_PAM ; \ USE_KERBEROS=no ; export USE_KERBEROS ; \ USE_SKEY=no ; export USE_SKEY ; \ ${MAKE-SCP} objs exe) user-land-install: mkdir -p ${FSROOT}/bin mkdir -p ${FSROOT}/sbin mkdir -p ${FSROOT}/usr/bin mkdir -p ${FSROOT}/usr/sbin mkdir -p ${FSROOT}/usr/libexec (cd ${USRWORKROOT} ; \ TARGETDIR=${FSROOT} ; export TARGETDIR ; \ CRUNCHBIN=${USERBIN} ; export CRUNCHBIN ; \ OBJDIR=${USRWORKROOT} ; export OBJDIR ; \ awk -f ${SRCROOT}/distrib/common/parselist.awk -v mode=install ${ROOT}/list > Makefile.install) (cd ${USRWORKROOT} ; \ sudo ${MAKE-SCP} -f Makefile.install install) dev: mkdir -p ${FSROOT}/dev (cd ${SRCROOT}/etc ; \ ${MAKE-SCP} MAKEDEV) mv ${SRCROOT}/etc/MAKEDEV ${FSROOT}/dev/ (cd ${FSROOT}/dev/ ; \ sudo sh ./MAKEDEV all) #ETC_FILES = rc rc.subr rc.conf master.passwd #RCD_FILES = NETWORKING DAEMON inetd fsck root fsetc: mkdir -p ${FSROOT}/etc/rc.d # (cd ${FSROOT}/etc ; \ # echo '/dev/md0a / ffs rw 1 1' > fstab) # for i in ${ETC_FILES} ; \ # do cp ${SRCROOT}/etc/$${i} ${FSROOT}/etc/ ; done # for i in ${RCD_FILES} ; \ # do cp ${SRCROOT}/etc/rc.d/$${i} ${FSROOT}/etc/rc.d ; done cp -R ${ROOT}/etc ${FSROOT} chmod +x ${FSROOT}/etc/rc.d/* ${TOOLROOT}/bin/nbpwd_mkdb -d ${FSROOT} ${FSROOT}/etc/master.passwd echo 'rc_configured=YES' >> ${FSROOT}/etc/rc.conf fsimage: mkdir -p ${FSROOT}/mnt ${TOOLROOT}/bin/nbmakefs -t ffs -B little -s 4m fs.img ${FSROOT} MDSETIMAGE=${TOOLROOT}/bin/${MACHINE_ARCH}--netbsdelf-mdsetimage mdset: ${MDSETIMAGE} netbsd fs.img fs: user-land-install dev etc fsimage mdset all: tools .WAIT include lib sys .WAIT user-land .WAIT clean: (cd ${SRCROOT} ; \ ${MAKE-SCP} cleandir) rm -rf ${WORKROOT} rm -rf ${TOOLROOT} clean-tools: (cd ${SRCROOT}/tools/gdb ; \ ${MAKE-SCP} clean) (cd ${SRCROOT}/tools ; \ TOOLS_BUILDRUMP=no ; export TOOLS_BUILDRUMP ; \ ${MAKE-SCP} cleandir) rm -rf ${WORKROOT} rm -rf ${TOOLROOT}