чување 26eb4535f16b721d11060bc2f59f7dccdf691782
родитељ beb1cf78934cec1e0193550d05c768f413539ead
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Sun, 9 Apr 2023 14:22:56 +0200
Add config.redo, a persistent build configuration file
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 6, додавања: 22(+), брисања: 1(-)
diff --git a/.gitignore b/.gitignore
@@ -15,9 +15,9 @@ nohup.out
*.xz
*.pdf
*.1
+config.redo
reflow
reflow.1
date
version
version.h
-
diff --git a/INSTALL b/INSTALL
@@ -4,6 +4,7 @@ Prerequisites
* C compiler (GCC-compatible) - ${REFLOW_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, REFLOW_CC and PREFIX can be specified in config.redo, eliminating the
+need to pass them with each build.
diff --git a/default.o.do b/default.o.do
@@ -2,4 +2,7 @@ for f in *.h; do
echo $f
done | xargs redo-ifchange
redo-ifchange $2.c
+if [ -r config.redo ]; then
+ . config.redo
+fi
${REFLOW_CC:-gcc -g} -Wall -std=c99 -c $2.c -o $3
diff --git a/install.do b/install.do
@@ -1,4 +1,7 @@
redo-ifchange all
+if [ -r config.redo ]; then
+ . config.redo
+fi
PREFIX=${PREFIX:-/usr/local}
BINDIR=$PREFIX/bin
MANDIR=$PREFIX/share/man/man1
diff --git a/reflow.do b/reflow.do
@@ -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
diff --git a/uninstall.do b/uninstall.do
@@ -1,4 +1,7 @@
redo-always
+if [ -r config.redo ]; then
+ . config.redo
+fi
PREFIX=${PREFIX:-/usr/local}
BINDIR=$PREFIX/bin
MANDIR=$PREFIX/share/man/man1