aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2024-03-12 21:51:37 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2024-03-12 21:51:37 -0700
commit80ac76208eade31ad0df6b347481049c20608a39 (patch)
treed2e87432153326d58d54189c3ca41e04add7b35e
parentbuild: add simple install target (diff)
downloadfifo-cronolog-master.tar.gz
fifo-cronolog-master.tar.bz2
fifo-cronolog-master.zip
build: add hacky dist ruleHEADmaster
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r--.gitignore4
-rw-r--r--Makefile8
2 files changed, 11 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 29b8ac9..718dc26 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
-
*.o
fifo-cronolog
+*.tgz
+*.tar.gz
+*.tar
diff --git a/Makefile b/Makefile
index 7894e74..74c132a 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,14 @@ BINDIR = /usr/sbin/
SYSTEMD_TARGET = /usr/lib/systemd/system/
SYSTEMD_UNIT = systemd/fifo-cronolog@.service
+VERSION = $(shell awk -F'"' '/#define VERSION/{print $$2}' $(SRC) )
+DISTFILE_EXT = tar.gz
+DISTFILE = $(BIN)-$(VERSION).$(DISTFILE_EXT)
+
+dist:
+ if test -e $(DISTFILE) ; then echo "$(DISTFILE) already exists" ; exit 1 ; fi
+ git archive --format $(DISTFILE_EXT) --prefix $(BIN)-$(VERSION)/ v$(VERSION) >$(DISTFILE).tmp && mv $(DISTFILE).tmp $(DISTFILE)
+
all: $(BIN)
$(BIN): $(OBJ)