X-Git-Url: https://git.distorted.org.uk/~mdw/tig/blobdiff_plain/b8ae93466d333ed4f0016842a7d6355f71e195fd..3df9850aa21a39e42ed4e720ad08c98610166a28:/Makefile diff --git a/Makefile b/Makefile index c3e2a11..1d8e180 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,15 @@ PREFIX = $(HOME) -LDFLAGS = -lcurses -CFLAGS = '-DVERSION="$(VERSION)"' -Wall -DFLAGS = -g -DDEBUG +LDLIBS = -lcurses +CFLAGS = -Wall -O2 +DFLAGS = -g -DDEBUG -Werror PROGS = tig DOCS = tig.1.txt tig.1.html tig.1 README.html -VERSION = $(shell git-describe) + +ifneq (,$(wildcard .git)) +VERSION = $(shell git-describe) +WTDIRTY = $(shell git-diff-index --name-only HEAD 2>/dev/null) +CFLAGS += '-DVERSION="$(VERSION)$(if $(WTDIRTY),-dirty)"' +endif all: $(PROGS) all-debug: $(PROGS) @@ -35,7 +40,7 @@ tig: tig.c tig.1.txt: tig.c sed -n '/\/\*\*/,/\*\*\//p' < $< | \ - sed 's/.*\*\*\///' | \ + sed 's/.*\*\*\/.*//' | \ sed '/^[^*]*\*\*/d' | \ sed 's/\*\///;s/^[^*]*\* *//' > $@