aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTristan Riehs <tristan.riehs@inria.fr>2026-08-07 11:28:04 +0200
committerTristan Riehs <tristan.riehs@inria.fr>2026-08-07 11:56:22 +0200
commit25246653f9b4a3208fe2288ee369c03cdb018704 (patch)
tree5e74382263c946cc00fa015a44b6e11ddbe25463 /Makefile
parent1666fc55a5f695950c26e5c3d5e1c3c1ab6f6be5 (diff)
Switch to plain makefiles for buildingHEADv1.4master
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile53
1 files changed, 53 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..e6c19b2
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,53 @@
+PREFIX ?= /usr/local
+CFLAGS ?= -O2 -g
+LDFLAGS ?=
+LIBS ?=
+
+
+
+REPEAT_VERSION := 1.4
+DATE := $(shell date '+%Y-%m-%d')
+
+__CFLAGS := -std=c99 -Wall \
+ -DREPEAT_VERSION=\"$(REPEAT_VERSION)\" \
+ -D_POSIX_C_SOURCE=200809L
+__LDFLAGS :=
+__LIBS :=
+
+all: rpt rpt.1.gz
+
+rpt: rpt.o
+ $(CC) -o $@ $^ $(__LDFLAGS) $(__LIBS) $(LDFLAGS) $(LIBS)
+
+rpt.o: rpt.c
+ $(CC) $(__CFLAGS) $(CFLAGS) -o $@ -c $<
+
+rpt.1.gz: rpt.1
+ gzip -9 -c $< > $@
+
+rpt.1: rpt.1.in
+ sed -e "s:@DATE@:$(DATE):" \
+ -e "s:@REPEAT_VERSION@:$(REPEAT_VERSION):" \
+ < $< \
+ > $@
+
+install: all
+ mkdir -p $(PREFIX)/bin
+ install --mode=0755 rpt $(PREFIX)/bin/
+
+ mkdir -p $(PREFIX)/share/man/man1
+ install --mode=0644 rpt.1.gz $(PREFIX)/share/man/man1/
+
+uninstall:
+ rm -rf $(PREFIX)/bin/rpt
+
+clean:
+ rm -rf rpt *.tar.gz rpt.o
+
+dist:
+ git archive \
+ --output="repeat-$(REPEAT_VERSION).tar.gz" \
+ --prefix="repeat-$(REPEAT_VERSION)/" \
+ HEAD
+
+.PHONY: all clean dist install uninstall