чување 3af7e8c7dbcba3cd9f9ca252798e159bee057266
родитељ 90d006dfdc6c499479adf904c95bb3e0dea57246
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Sun, 9 Apr 2023 14:38:58 +0200
Add config.redo, a persistent build configuration file
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 7, додавања: 42(+), брисања: 25(-)
diff --git a/.gitignore b/.gitignore
@@ -15,6 +15,7 @@
nohup.out
*.gz
*.xz
+config.redo
index.html
slweb
slweb.1
diff --git a/INSTALL b/INSTALL
@@ -31,3 +31,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, SLWEB_CC and PREFIX can be specified in config.redo, eliminating
+the need to pass them with each build.
diff --git a/README b/README
@@ -1,13 +1,13 @@
- slweb
- =====
+slweb
+=====
slweb is a static website generator which aims at being simplistic. It
transforms custom Markdown-like syntax into HTML.
- Q&A
- ---
+Q&A
+---
Q: Is this suckless?
A: No. SGML, and by extension, HTML, isn't suckless.
@@ -28,34 +28,32 @@ Q: My static website generator is "truly simple", this is not simple!
A: Good for you. By the way, that is a statement and not a question.
- Install
- -------
+Install
+-------
See the file INSTALL in this repository.
- Examples
- --------
+Examples
+--------
See the examples/ directory in this repository.
- License
- -------
+License
+-------
- slweb - Simple static website generator.
- Copyright (C) 2020, 2021, 2022, 2023 Страхиња Радић
+slweb - Simple static website generator.
+Copyright (C) 2020, 2021, 2022, 2023 Страхиња Радић
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+This program is free software: you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation, either version 3 of the License, or (at your option) any later
+version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>.
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE. See the GNU General Public License for more details.
+You should have received a copy of the GNU General Public License along with
+this program. If not, see <https://www.gnu.org/licenses/>.
diff --git a/default.o.do b/default.o.do
@@ -1,2 +1,5 @@
redo-ifchange $2.c
+if [ -r config.redo ]; then
+ . config.redo
+fi
${SLWEB_CC:-gcc -g} -Wall -std=c99 -o $3 -c $2.c
diff --git a/install.do b/install.do
@@ -1,5 +1,7 @@
-#!/bin/sh
redo-ifchange all
+if [ -r config.redo ]; then
+ . config.redo
+fi
PREFIX=${PREFIX:-/usr/local}
BINDIR=$PREFIX/bin
#DOCDIR=$PREFIX/share/doc/slweb
diff --git a/slweb.do b/slweb.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,5 +1,7 @@
-#!/bin/sh
redo-always
+if [ -r config.redo ]; then
+ . config.redo
+fi
PREFIX=${PREFIX:-/usr/local}
BINDIR=$PREFIX/bin
#DOCDIR=$PREFIX/share/doc/slweb