xref: /freebsd/tools/tinder.sh (revision bc14d7f4c495c72d252c5e1dfe1a36c5589c3255)
1*bc14d7f4SMax Khon#!/bin/sh
2*bc14d7f4SMax Khon#
3*bc14d7f4SMax Khon# Copyright (c) 2011 Max Khon, The FreeBSD Project
4*bc14d7f4SMax Khon# All rights reserved.
5*bc14d7f4SMax Khon#
6*bc14d7f4SMax Khon# Redistribution and use in source and binary forms, with or without
7*bc14d7f4SMax Khon# modification, are permitted provided that the following conditions
8*bc14d7f4SMax Khon# are met:
9*bc14d7f4SMax Khon# 1. Redistributions of source code must retain the above copyright
10*bc14d7f4SMax Khon#    notice, this list of conditions and the following disclaimer.
11*bc14d7f4SMax Khon# 2. Redistributions in binary form must reproduce the above copyright
12*bc14d7f4SMax Khon#    notice, this list of conditions and the following disclaimer in the
13*bc14d7f4SMax Khon#    documentation and/or other materials provided with the distribution.
14*bc14d7f4SMax Khon#
15*bc14d7f4SMax Khon# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16*bc14d7f4SMax Khon# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17*bc14d7f4SMax Khon# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18*bc14d7f4SMax Khon# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19*bc14d7f4SMax Khon# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20*bc14d7f4SMax Khon# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21*bc14d7f4SMax Khon# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22*bc14d7f4SMax Khon# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23*bc14d7f4SMax Khon# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24*bc14d7f4SMax Khon# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25*bc14d7f4SMax Khon# SUCH DAMAGE.
26*bc14d7f4SMax Khon#
27*bc14d7f4SMax Khon# $FreeBSD$
28*bc14d7f4SMax Khon#
29*bc14d7f4SMax Khon
30*bc14d7f4SMax Khon#
31*bc14d7f4SMax Khon# Utility script to build specific parts of the source tree on all arches
32*bc14d7f4SMax Khon#
33*bc14d7f4SMax Khon# Example:
34*bc14d7f4SMax Khon#
35*bc14d7f4SMax Khon# cd /usr/src
36*bc14d7f4SMax Khon# make toolchains		# build toolchain for all arches
37*bc14d7f4SMax Khon# sh tools/tinder.sh gnu/lib/libdialog usr.sbin/sade NO_CLEAN=yes
38*bc14d7f4SMax Khon#				# build libdialog and sade for all architectures
39*bc14d7f4SMax Khon#				# without making clean
40*bc14d7f4SMax Khon#
41*bc14d7f4SMax Khon
42*bc14d7f4SMax Khonif [ $# -eq 0 ]; then
43*bc14d7f4SMax Khon	echo 1>&2 "Usage: `basename $0` [MAKEVAR=value...] path..."
44*bc14d7f4SMax Khon	exit 1
45*bc14d7f4SMax Khonfi
46*bc14d7f4SMax Khon
47*bc14d7f4SMax Khon# MAKE_ARGS is intentionally not reset to allow caller to specify additional MAKE_ARGS
48*bc14d7f4SMax KhonSUBDIR=
49*bc14d7f4SMax Khonfor i in "$@"; do
50*bc14d7f4SMax Khon	case "$i" in
51*bc14d7f4SMax Khon	*=*)
52*bc14d7f4SMax Khon		MAKE_ARGS="$MAKE_ARGS $i"
53*bc14d7f4SMax Khon		;;
54*bc14d7f4SMax Khon	*)
55*bc14d7f4SMax Khon		SUBDIR="$SUBDIR $i"
56*bc14d7f4SMax Khon	esac
57*bc14d7f4SMax Khondone
58*bc14d7f4SMax Khonmake tinderbox UNIVERSE_TARGET="_cleanobj _obj _depend everything" $MAKE_ARGS SUBDIR_OVERRIDE="$SUBDIR"
59