summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a49dc47)
raw | patch | inline | side by side (parent: a49dc47)
author | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 31 May 2007 09:54:51 +0000 (11:54 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 31 May 2007 10:15:02 +0000 (12:15 +0200) |
Makefile | patch | blob | history |
diff --git a/Makefile b/Makefile
index f5c7a9337c58dfd9f7f3c71f7f21b1bbb70d0964..ccc7e09488a95943e7969f8c5eab741636d34dba 100644 (file)
--- a/Makefile
+++ b/Makefile
prefix = $(HOME)
-bindir= $(prefix)/bin
-mandir = $(prefix)/man
-docdir = $(prefix)/share/doc
+bindir = $(prefix)/bin
+mandir = $(prefix)/man
+docdir = $(prefix)/share/doc
# DESTDIR=
# Get version either via git or from VERSION file
ifneq (,$(wildcard .git))
-GITDESC = $(subst tig-,,$(shell git describe))
-WTDIRTY = $(if $(shell git-diff-index HEAD 2>/dev/null),-dirty)
-VERSION = $(GITDESC)$(WTDIRTY)
+GITDESC = $(subst tig-,,$(shell git describe))
+WTDIRTY = $(if $(shell git-diff-index HEAD 2>/dev/null),-dirty)
+VERSION = $(GITDESC)$(WTDIRTY)
else
-VERSION = $(shell test -f VERSION && cat VERSION || echo "unknown-version")
+VERSION = $(shell test -f VERSION && cat VERSION || echo "unknown-version")
endif
RPM_VERSION = $(subst -,.,$(VERSION))
-LDLIBS = -lcurses
+LDLIBS = -lcurses
CFLAGS = -Wall -O2 '-DVERSION="$(VERSION)"'
DFLAGS = -g -DDEBUG -Werror
PROGS = tig
-DOCS_MAN = tig.1 tigrc.5
-DOCS_HTML = tig.1.html tigrc.5.html \
- manual.html \
- README.html
-DOCS = $(DOCS_MAN) $(DOCS_HTML) \
- manual.toc manual.html-chunked manual.pdf
-
-TARNAME = tig-$(RPM_VERSION)
+MANDOC = tig.1 tigrc.5
+HTMLDOC = tig.1.html tigrc.5.html manual.html README.html
+ALLDOC = $(MANDOC) $(HTMLDOC) manual.html-chunked manual.pdf
+TARNAME = tig-$(RPM_VERSION)
all: $(PROGS)
all-debug: $(PROGS)
all-debug: CFLAGS += $(DFLAGS)
-doc: $(DOCS)
-doc-man: $(DOCS_MAN)
-doc-html: $(DOCS_HTML)
+doc: $(ALLDOC)
+doc-man: $(MANDOC)
+doc-html: $(HTMLDOC)
install: all
mkdir -p $(DESTDIR)$(bindir) && \
install-doc-man: doc-man
mkdir -p $(DESTDIR)$(mandir)/man1 \
$(DESTDIR)$(mandir)/man5
- for doc in $(DOCS); do \
+ for doc in $(MANDOC); do \
case "$$doc" in \
*.1) install $$doc $(DESTDIR)$(mandir)/man1 ;; \
*.5) install $$doc $(DESTDIR)$(mandir)/man5 ;; \
install-doc-html: doc-html
mkdir -p $(DESTDIR)$(docdir)/tig
- for doc in $(DOCS); do \
+ for doc in $(HTMLDOC); do \
case "$$doc" in \
*.html) install $$doc $(DESTDIR)$(docdir)/tig ;; \
esac \
install-doc: install-doc-man install-doc-html
clean:
- rm -rf manual.html-chunked
- rm -f $(PROGS) $(DOCS) core *.xml
- rm -f *.spec
- rm -rf $(TARNAME)
- rm -f $(TARNAME).tar.gz
+ rm -rf manual.html-chunked $(TARNAME)
+ rm -f $(PROGS) $(ALLDOC) core *.xml *.toc
+ rm -f *.spec tig-*.tar.gz
spell-check:
aspell --lang=en --check tig.1.txt tigrc.5.txt manual.txt
git checkout release && \
git merge master && \
make clean doc-man doc-html && \
- git add $(DOCS_MAN) $(DOCS_HTML) && \
+ git add $(MANDOC) $(HTMLDOC) && \
git commit -m "Sync docs" && \
git checkout master
-.PHONY: all all-debug doc doc-man doc-html install install-doc install-doc-man install-doc-html clean spell-check dist rpm
+.PHONY: all all-debug doc doc-man doc-html install install-doc \
+ install-doc-man install-doc-html clean spell-check dist rpm
tig.spec: tig.spec.in
- sed -e 's/@@VERSION@@/$(RPM_VERSION)/g' < $< > $@+
- mv $@+ $@
+ sed -e 's/@@VERSION@@/$(RPM_VERSION)/g' < $< > $@
tig: tig.c