3 ## Copyright (C) 2006 - 2011 Steve Youngs
5 ## Author: Steve Youngs <steve@steveyoungs.com>
6 ## Maintainer: Steve Youngs <steve@steveyoungs.com>
7 ## Created: <2006-08-16>
9 ## This file is part of zcdrip
11 ## Redistribution and use in source and binary forms, with or without
12 ## modification, are permitted provided that the following conditions
15 ## 1. Redistributions of source code must retain the above copyright
16 ## notice, this list of conditions and the following disclaimer.
18 ## 2. Redistributions in binary form must reproduce the above copyright
19 ## notice, this list of conditions and the following disclaimer in the
20 ## documentation and/or other materials provided with the distribution.
22 ## 3. Neither the name of the author nor the names of any contributors
23 ## may be used to endorse or promote products derived from this
24 ## software without specific prior written permission.
26 ## THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
27 ## IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28 ## WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29 ## DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 ## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 ## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 ## SUBSTITUTE GOODS OR SERVICES# LOSS OF USE, DATA, OR PROFITS# OR
33 ## BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34 ## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
35 ## OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
36 ## IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 ## Because I suck at writing makefiles
42 PREFIX=${PREFIX:-/usr/local}
43 BINDIR=${BINDIR:-${PREFIX}/bin}
49 rm -vf zcdrip ecdrip zdiscid
57 rep=$(git describe 2>/dev/null||echo ${tver})
58 zmodload -i zsh/mapfile
59 gcc -Wall -o zdiscid zdiscid.c
60 mapfile[zcdrip]=${mapfile[zcdrip.in]/$sub/$rep}
61 [[ ${ESHELL} -eq 1 ]] && eshell
67 [[ -f zcdrip && -f zdiscid ]] || all
71 INSTALL=${INSTALL:-install}
75 [[ -f zcdrip && -f zdiscid ]] || all
77 $INSTALL -v -m755 -d ${BINDIR}
78 $INSTALL -v -m755 zcdrip zdiscid ${BINDIR}
79 [[ -h ecdrip ]] && ln -svf zcdrip ${BINDIR}/ecdrip
86 Usage: $ourname [OPTION]
90 all -- builds zdiscid and zcdrip, also runs 'clean'
91 eshell -- create eshell symlink workaround
92 clean -- removes objects
93 install -- installs zcdrip
97 If you want to install zcdrip to a directory somewhere in '${HOME}'
100 PREFIX=${HOME} ./build.sh install
102 Which would put everything in ${HOME}/bin
105 BINDIR=${HOME}/some/other/dir ./build.sh install
107 Which would put everything in ${HOME}/some/other/dir
109 Basically, setting PREFIX sets the install directory to PREFIX/bin
110 and setting BINDIR sets the install directory to exactly BINDIR
112 You can also automatically build the eshell version by setting
115 ESHELL=1 ./build.sh install
124 (install) _install ;;
128 ### build.sh ends here