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