3 # The purpose of this script is to step in if no version of the "redo" build
4 # system is installed on your system to interpret the files that (Makefile-like)
5 # build the PlomRogue system: ./all.do, ./roguelike-client.do and
6 # ./roguelike-server.do.
8 # If a version of "redo" is installed on your system and in your $PATH, just run
9 # "redo roguelike-client", "redo roguelike-server" or plain "redo" (to build
10 # both via all.do). Otherwise, run this very script with the very same
11 # arguments. It uses parts of a basic "redo" implementation written by Nils
12 # Dagsson Moskopp a.k.a. erlehmann, snapshots of which are stored in
13 # build/redo_scripts/. For details on this version, see:
14 # - <http://news.dieweltistgarnichtso.net/bin/redo.html>
15 # - <http://news.dieweltistgarnichtso.net/bin/redo-ifchange.html>
17 # Some tests first: for gcc, and certain necessary header files. (This is not
18 # strictly the responsibility of a mere redo wrapper. But those using a
19 # pre-installed redo probably will be fine with the error messages thrown by it
21 test=`command -v gcc | wc -l`
25 echo "No gcc installed, but it's needed!"
30 test=`echo $code | cpp -H -o /dev/null 2>&1 | head -n1 | grep error | wc -l`
34 echo "No $1 header file found, but it's needed!"
35 echo "Maybe install some $2 package?"
39 test_header stdlib.h libc6-dev # Assume stdlib.h guarantees full libc6-dev.
40 test_header ncurses.h libncurses5-dev
42 # The actual redo calling.
43 export PATH=$PATH:$PWD/build/redo_scripts