Skip to content
pedwo edited this page Apr 21, 2011 · 1 revision
#!/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/arm-unknown-linux-gnueabi/sysroot

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

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

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

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