X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/c8a4777f93c66181a78c25d292be3681ecf3adaa..03fc3b26aee0b216513b2077c6b009f896458ca1:/Makefile diff --git a/Makefile b/Makefile index df77d97..0fa5c6a 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,57 @@ -PREFIX = $(HOME) -DESTDIR = / -PYTHON = python +prefix ?= $(HOME) +DESTDIR ?= / +PYTHON ?= python -all: +TEST_PATCHES ?= .. + +all: build $(PYTHON) setup.py build -install: - $(PYTHON) setup.py install --prefix=$(PREFIX) --root=$(DESTDIR) +build: stgit/commands/cmdlist.py stgit-completion.bash + +ALL_PY = $(shell find stgit -name '*.py') + +stgit/commands/cmdlist.py: $(ALL_PY) + $(PYTHON) stg-build --py-cmd-list > $@ + +stgit-completion.bash: $(ALL_PY) + $(PYTHON) stg-build --bash-completion > $@ + +install: build + $(PYTHON) setup.py install --prefix=$(prefix) --root=$(DESTDIR) --force doc: - cd doc && $(MAKE) all + cd Documentation && $(MAKE) all + +install-doc: + $(MAKE) -C Documentation install -test: +install-html: + $(MAKE) -C Documentation install-html + +test: build cd t && $(MAKE) all +test_patches: build + for patch in $$(stg series --noprefix $(TEST_PATCHES)); do \ + stg goto $$patch && $(MAKE) test || break; \ + done + clean: - for dir in doc t; do \ + for dir in Documentation t; do \ (cd $$dir && $(MAKE) clean); \ done rm -rf build rm -f stgit/*.pyc rm -f stgit/commands/*.pyc + rm -f TAGS + rm -f stgit/commands/cmdlist.py + +tags: + ctags -R stgit/* + +TAGS: + ctags -e -R stgit/* + +.PHONY: all build install doc install-doc install-html test test_patches \ + clean tags TAGS