чување 943aae90129c2fdaada76d9387233950b80d5ab2
родитељ 422adcb603ecbd70f9ce8abd04e8249309e2fb3e
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Thu, 28 Sep 2023 14:44:01 +0200
Make config.redo behave more like config.mk; synchronize changes to build
scripts and INSTALL from sled
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 10, додавања: 15(+), брисања: 34(-)
diff --git a/.gitignore b/.gitignore
@@ -18,7 +18,6 @@ nohup.out
*.pdf
*.1
*.pkg.tar.zst
-config.redo
src
PKGBUILD
_config.h
diff --git a/INSTALL b/INSTALL
@@ -1,7 +1,7 @@
Prerequisites
=============
-* C compiler (GCC-compatible) - ${POE_CC:-gcc -g}
+* C compiler - defaults in config.redo
* gzip
@@ -24,7 +24,6 @@ if you don't:
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, POE_CC and PREFIX can be specified in config.redo, eliminating the
-need to pass them with each build.
+The file config.redo will be sourced when building targets which also accept
+configuration through environment variables. For example, CC and PREFIX
+are specified in config.redo.
diff --git a/config.redo b/config.redo
@@ -0,0 +1,4 @@
+PREFIX=${PREFIX:-/usr/local}
+CC=${CC:-gcc -g -Wall -pedantic -std=c99 -D_POSIX_C_SOURCE=200809L \
+-D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE}
+STRIP=${STRIP:-:}
diff --git a/default.o.do b/default.o.do
@@ -1,7 +1,5 @@
sed -n '/^#include "/s/^#include "\([^"]*\)"/\1/p' ${2%.o}.c | \
xargs redo-ifchange
redo-ifchange $2.c
-if [ -r ./config.redo ]; then
- . ./config.redo
-fi
-${POE_CC:-gcc -g} -Wall -std=c99 -c $2.c -o $3
+. ./config.redo
+${CC} -c $2.c -o $3
diff --git a/draw.c b/draw.c
@@ -2,10 +2,6 @@
* any later version. Copyright (C) 2021-2023 Страхиња Радић.
* See the file LICENSE for exact copyright and license details. */
-#define _POSIX_C_SOURCE 200809L
-#define _DEFAULT_SOURCE
-#define _XOPEN_SOURCE
-
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/install.do b/install.do
@@ -1,8 +1,5 @@
redo-ifchange all
-if [ -r ./config.redo ]; then
- . ./config.redo
-fi
-PREFIX=${PREFIX:-/usr/local}
+. ./config.redo
BINDIR=$PREFIX/bin
#DOCDIR=$PREFIX/share/doc/poe
MANDIR=$PREFIX/share/man/man1
diff --git a/po.c b/po.c
@@ -2,10 +2,6 @@
* any later version. Copyright (C) 2021-2023 Страхиња Радић.
* See the file LICENSE for exact copyright and license details. */
-#define _POSIX_C_SOURCE 200809L
-#define _DEFAULT_SOURCE
-#define _XOPEN_SOURCE
-
#include <libgen.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/poe.c b/poe.c
@@ -2,10 +2,6 @@
* any later version. Copyright (C) 2021-2023 Страхиња Радић.
* See the file LICENSE for exact copyright and license details. */
-#define _POSIX_C_SOURCE 200809L
-#define _DEFAULT_SOURCE
-#define _XOPEN_SOURCE
-
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
diff --git a/poe.do b/poe.do
@@ -1,5 +1,4 @@
redo-ifchange po.o poe.o draw.o util.o
-if [ -r ./config.redo ]; then
- . ./config.redo
-fi
-${POE_CC:-gcc -g} -Wall -std=c99 -o $3 po.o poe.o draw.o util.o >/dev/null
+. ./config.redo
+${CC} -o $3 po.o poe.o draw.o util.o >/dev/null
+${STRIP} $3
diff --git a/uninstall.do b/uninstall.do
@@ -1,8 +1,5 @@
redo-always
-if [ -r ./config.redo ]; then
- . ./config.redo
-fi
-PREFIX=${PREFIX:-/usr/local}
+. ./config.redo
BINDIR=$PREFIX/bin
#DOCDIR=$PREFIX/share/doc/poe
MANDIR=$PREFIX/share/man/man1