чување c0306c890b3dfee063f1feb1715cef9c67cf88aa
родитељ ad416c0f5488a91a91269c928f54bb32e161f94e
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Sun, 9 Apr 2023 13:19:25 +0200
Add config.redo, a persistent build configuration file; MKPK: Remove file
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 7, додавања: 26(+), брисања: 11(-)
diff --git a/.gitignore b/.gitignore
@@ -19,6 +19,7 @@ nohup.out
*.pdf
*.1
*.pkg.tar.zst
+config.redo
src
PKGBUILD
_config.h
diff --git a/INSTALL b/INSTALL
@@ -21,6 +21,15 @@ if you don't:
# ./do install
+Persistent compilation 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, SLED_CC and PREFIX can be specified in config.redo, eliminating the
+need to pass them with each build.
+
+
OpenBSD
-------
diff --git a/MKPK b/MKPK
@@ -1,9 +0,0 @@
-mkpk_name()
-{
- printf "%s-%s\n" "sled" "$(cat ../version)"
-}
-
-mkpk_install()
-{
- PREFIX=build/usr ./do -c install
-}
diff --git a/default.o.do b/default.o.do
@@ -1,4 +1,8 @@
sed -n '/^#include "/s/^#include "\([^"]*\)"/\1/p' ${2%.o}.c | \
xargs redo-ifchange
redo-ifchange $2.c
-${SLED_CC:-gcc -g} -Wall -std=c99 -c $2.c -o $3
+if [ -r config.redo ]; then
+ . config.redo
+fi
+SLED_CC=${SLED_CC:-gcc -g}
+${SLED_CC} -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/sled.do b/sled.do
@@ -1,2 +1,6 @@
redo-ifchange sled.o draw.o util.o
-${SLED_CC:-gcc -g} -Wall -std=c99 -o $3 sled.o draw.o util.o >/dev/null
+if [ -r config.redo ]; then
+ . config.redo
+fi
+SLED_CC=${SLED_CC:-gcc -g}
+${SLED_CC} -Wall -std=c99 -o $3 sled.o draw.o util.o >/dev/null
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