чување 641f953d942cbdab5bf0c52265bcc68dbf29e4aa
родитељ acffb511e82bcd8c358fa768e53f2f9aea89d82d
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Sun, 9 Apr 2023 14:31:33 +0200
Add config.redo, a persistent build configuration file
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 6, додавања: 22(+), брисања: 5(-)
diff --git a/.gitignore b/.gitignore
@@ -15,9 +15,9 @@ nohup.out
*.xz
*.pdf
*.1
+config.redo
ufold
ufold.1
date
version
version.h
-
diff --git a/INSTALL b/INSTALL
@@ -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.
diff --git a/default.o.do b/default.o.do
@@ -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
-
diff --git a/install.do b/install.do
@@ -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
-
diff --git a/ufold.do b/ufold.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
@@ -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
-
diff --git a/uninstall.do b/uninstall.do
@@ -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
-