diff options
author | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-02-03 17:54:02 +0100 |
---|---|---|
committer | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-02-03 17:54:02 +0100 |
commit | fc4f1875fe57c39bf122cfb43a30893fef58c157 (patch) | |
tree | 7a84c5bcacec39b2bb7d6c8250a23da780009ef6 | |
parent | 18a47f8b4bf99366beea3b9486566ebe26f7de5d (diff) |
reapeat now built using the GNU Autotools
-rw-r--r-- | Makefile | 37 | ||||
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | configure.ac | 11 | ||||
-rw-r--r-- | rpt.1.in (renamed from rpt.1) | 4 | ||||
-rw-r--r-- | rpt.c | 6 |
5 files changed, 19 insertions, 43 deletions
diff --git a/Makefile b/Makefile deleted file mode 100644 index 1f59519..0000000 --- a/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -PREFIX = /usr/local - -CFLAGS = -std=c99 -Wall -Wextra -pedantic -O0 -ggdb - -BIN = rpt -SRC = rpt.c -OBJ = rpt.o - -MAN_SRC = rpt.1 -MAN_PAGE = rpt.1.gz - -.PHONY: all compile man clean install uninstall - -all: compile man - -compile: $(BIN) - -$(BIN): $(OBJ) - cc $^ -o $@ - -%.o: %.c - cc $(CFLAGS) -c $< -o $@ - -man: $(MAN_PAGE) - -%.1.gz: %.1 - gzip -9 -c $< > $@ - -clean: - rm -f $(BIN) $(OBJ) $(MAN_PAGE) - -install: compile man - cp -f $(BIN) $(PREFIX)/bin - cp -f $(MAN_PAGE) $(PREFIX)/share/man/man1 - -uninstall: - rm -f $(PREFIX)/bin/$(BIN) $(PREFIX)/share/man/man1/$(MAN_PAGE) diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..1eb2838 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,4 @@ +bin_PROGRAMS = rpt +rpt_SOURCES = rpt.c +AM_CFLAGS = -std=c99 -Wall -Wextra -D_GNU_SOURCE +dist_man1_MANS = rpt.1 diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..5461c4a --- /dev/null +++ b/configure.ac @@ -0,0 +1,11 @@ +AC_INIT([repeat], [1.2.0]) +AM_INIT_AUTOMAKE([-Wall -Werror, foreign]) +: ${CFLAGS=""} +AC_PROG_CC +AM_SILENT_RULES([yes]) +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_FILES([ + Makefile + rpt.1 +]) +AC_OUTPUT @@ -1,9 +1,9 @@ .\" Written by Tristan Riehs. .\" This file is part of repeat and is licensed under the MIT License. -.TH rpt 1 2023-09-27 +.TH repeat @VERSION@ 2023-09-27 .SH NAME -rpt \- repeat a shell command +repeat \- repeat a shell command .SH SYNOPSIS .B rpt @@ -1,4 +1,4 @@ -#define _GNU_SOURCE /* getopt_long */ +#include "config.h" #include <errno.h> #include <fcntl.h> @@ -10,10 +10,8 @@ #include <sys/wait.h> #include <unistd.h> -#define VERSION "1.1.3" - /* Size of the buffer used to clone stdin. */ -#define BUFSIZE 8000 +#define BUFSIZE (1 << 12) /* Exit status */ #define EXIT_SUCCESS 0 |