~strahinja/ufold

641f953d942cbdab5bf0c52265bcc68dbf29e4aa — Страхиња Радић 1 year, 5 months ago acffb51 v0.1.1
Add config.redo, a persistent build configuration file

Signed-off-by: Страхиња Радић <contact@strahinja.org>
6 files changed, 22 insertions(+), 5 deletions(-)

M .gitignore
M INSTALL
M default.o.do
M install.do
M ufold.do
M uninstall.do
M .gitignore => .gitignore +1 -1
@@ 15,9 15,9 @@ nohup.out
*.xz
*.pdf
*.1
config.redo
ufold
ufold.1
date
version
version.h


M INSTALL => INSTALL +9 -0
@@ 4,6 4,7 @@ Prerequisites
* C compiler (GCC-compatible) - ${UFOLD_CC:-gcc -g}
* gzip


Install
-------



@@ 19,3 20,11 @@ if you don't:

	# ./do install


Persistent build configuration file
-----------------------------------

If a file config.redo exists in the build directory, it will be sourced when
building targets which also accept configuration through environment variables.
For example, UFOLD_CC and PREFIX can be specified in config.redo, eliminating
the need to pass them with each build.

M default.o.do => default.o.do +3 -1
@@ 1,6 1,8 @@
if [ -r config.redo ]; then
	. config.redo
fi
for f in *.h; do
	echo $f
done | xargs redo-ifchange
redo-ifchange $2.c
${UFOLD_CC:-gcc -g} -Wall -std=c99 -c $2.c -o $3


M install.do => install.do +3 -1
@@ 1,8 1,10 @@
redo-ifchange all
if [ -r config.redo ]; then
	. config.redo
fi
PREFIX=${PREFIX:-/usr/local}
BINDIR=$PREFIX/bin
MANDIR=$PREFIX/share/man/man1
install -d $BINDIR $MANDIR
install -m 0755 ufold $BINDIR
install -m 0644 ufold.1.gz $MANDIR


M ufold.do => ufold.do +3 -1
@@ 1,3 1,6 @@
if [ -r config.redo ]; then
	. config.redo
fi
for f in *.h.in; do
	echo $f | sed -e's/\.in$//g'
done | xargs redo-ifchange


@@ 6,4 9,3 @@ for f in *.h *.c; do
	echo $f | sed -e's/\.c$/.o/g'
done | xargs redo-ifchange
${UFOLD_CC:-gcc -g} -Wall -std=c99 -o $3 ufold.o utf8.o


M uninstall.do => uninstall.do +3 -1
@@ 1,6 1,8 @@
redo-always
if [ -r config.redo ]; then
	. config.redo
fi
PREFIX=${PREFIX:-/usr/local}
BINDIR=$PREFIX/bin
MANDIR=$PREFIX/share/man/man1
rm -f $BINDIR/ufold $MANDIR/ufold.1.gz