summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
commit97d5c458cfa039d857301e1ca7d5af3beb37131d (patch)
treeb460cd850d0537eb71806ba30358840377b27688 /build
parentb89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff)
build: Better Build System
Diffstat (limited to 'build')
-rwxr-xr-xbuild81
1 files changed, 0 insertions, 81 deletions
diff --git a/build b/build
deleted file mode 100755
index 15b38182..00000000
--- a/build
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/env bash
-
-SUBDIRS=(static/openbsd static/netbsd static/freebsd static/v10)
-
-create() {
-sqlite3 man.db <<EOF
-CREATE TABLE manpages (
- os TEXT,
- name TEXT,
- section INTEGER,
- path TEXT,
- PRIMARY KEY (os, name, section)
-);
-EOF
-
- if [[ $? != 0 ]];
- then
- printf "Error: error creating table.\n" >&2
- exit 1
- fi
-
- for SUBDIR in ${SUBDIRS[*]};
- do
- make -j "$(nproc)" -C "$SUBDIR"
-
- if [[ $? != 0 ]];
- then
- printf "Error: error building %s man pages.\n" "$SUBDIR" >&2
- exit 1
- fi
-
- HTML=$(find "$SUBDIR" -type f -name '*.html')
-
- for FILE in $HTML;
- do
- SECTION=$(basename "$FILE" | sed -E 's|.*\.([0-9])\..*|\1|')
- NAME=$(basename "$FILE" | sed -E 's|(.*)\.[0-9]\.html|\1|')
- OS=$(basename "$SUBDIR")
-
- if [[ -n "$(echo "$FILE" | grep "man$SECTION\.")" ]];
- then
- NAME="$(echo "$FILE" | sed -E "s|.*man$SECTION\.(.*)/.*|\1|" ).$NAME"
- fi
-
- echo "INSERT INTO manpages (os, name, section, path) VALUES ('"$OS"', '"$NAME"', '"$SECTION"', '"$FILE"');"
- sqlite3 man.db \
- "INSERT INTO manpages (os, name, section, path) VALUES ('"$OS"', '"$NAME"', '"$SECTION"', '"$FILE"');"
-
- if [[ $? != 0 ]];
- then
- printf "Error: error inserting ('%s', '%s', '%s', '%s').\n" "$OS" "$NAME" "$SECTION" "$FILE" >&2
- exit 1
- fi
- done
- done
-
- chmod 400 man.db
-}
-
-clean() {
- for SUBDIR in ${SUBDIRS[*]};
- do
- make -C "$SUBDIR" -j "$(nproc)" clean
- done
-
- rm -f man.db
-}
-
-case "$1" in
- create)
- create
- ;;
- clean)
- clean
- ;;
- *)
- printf "Error: \"%s\" not an option.\n" "$1"
- exit 1
- ;;
-esac
-