Skip to content
pedwo edited this page Mar 21, 2011 · 5 revisions
#!/bin/bash
#
# make a Buildroot package
# call as "brmake" and then "brmake install"
# Updated for Buildroot 2011.02
set -e

# Assumptions:
# 1. This script is run from the dir of the package you are configuring
# 2. This is run from a dir that forms part of the standard Buildroot tree unless BUILDROOT_OUTPUT is set
if [ -n "${BUILDROOT_OUTPUT:+}" ]; then
	PKGPATH=$(pwd)
	BRTARGET=${PKGPATH}/../../target
	BRHOST=${PKGPATH}/../../host
else
	BRTARGET="${BUILDROOT_OUTPUT}/target"
	BRHOST="${BUILDROOT_OUTPUT}/host"
fi

SYSROOT=${BRHOST}/usr/sh4-unknown-linux-gnu/sysroot

# make
if [ "$1x" == "x" ]; then
	make -j2
fi

# make install
if [ "$1" == "install" ]; then
	make -j2 DESTDIR=${SYSROOT}  install
	make -j2 DESTDIR=${BRTARGET}  install
	sudo cp -rd ${BRTARGET}/* /tftpboot/rootfs
fi

# make clean
if [ "$1" == "clean" ]; then
	make clean
fi

# make uninstall
if [ "$1" == "uninstall" ]; then
	make -j2 DESTDIR=${SYSROOT} uninstall
	make -j2 DESTDIR=${BRTARGET} uninstall
fi

Clone this wiki locally