diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-05-16 07:23:21 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-05-16 07:23:21 -0700 |
commit | 4d57d98d263a1c685c38fdb9b0af82078612ffd9 (patch) | |
tree | 2d6515a300737b86b8dfae4859203ca25cb088cb /Makefile | |
parent | aa02dc7bf5715d1dfd230c326b9d9788ba1e6261 (diff) | |
download | pw-4d57d98d263a1c685c38fdb9b0af82078612ffd9.tar.gz pw-4d57d98d263a1c685c38fdb9b0af82078612ffd9.tar.bz2 pw-4d57d98d263a1c685c38fdb9b0af82078612ffd9.zip |
Version 1 is released.pw-1
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -1,7 +1,18 @@ +PW_SHA256 := 6675178bf43216cf302d4291269b51dc87eb87235e798c4e3e30b742e458d828 NEEDED_CFLAGS := -std=c99 -D_POSIX_C_SOURCE=200112L -D__EXTENSIONS__ +ifeq ($(shell sha256sum pw.c),$(PW_SHA256) pw.c) +PW_VERSION := 1 +else +PW_VERSION := 1-$(shell git rev-parse --short HEAD) +PW_VERSION := $(PW_VERSION)$(shell git diff --quiet || printf -- "-dirty") +endif CFLAGS ?= -g -O2 -W -Wall -override CFLAGS += $(NEEDED_CFLAGS) +override CFLAGS += $(NEEDED_CFLAGS) -DCONFIG_PW_VER=\"$(PW_VERSION)\" DESTDIR ?= /usr/local +.PHONY: all pw.1 +all: pw pw.1 pw: -clean: ; rm -f pw -install: ; install pw $(DESTDIR)/bin/pw +clean:; rm -f pw +install:; install pw $(DESTDIR)/bin/pw; install pw.1 $(DESTDIR)/share/man/man1 +pw.1:; @sed -e '/^\.TH/s/Version [^"]\+/Version $(PW_VERSION)/' pw.1 > pw.tmp + cmp -s pw.1 pw.tmp && rm pw.tmp || mv pw.tmp pw.1 |