hgopenurl / Makefile

Full commit
# If you want to change PREFIX, do not just edit it below. The changed
# value wont get passed on to recursive make calls. You should instead
# override the variable on the command like:
# % make PREFIX=/opt/ install



	@echo 'Commonly used make targets:'
	@echo '  all          - build program and documentation'
	@echo '  install      - install program and man pages to PREFIX ($(PREFIX))'
	@echo '  install-home - install with install --home=HOME ($(HOME))'
	@echo '  tests        - run all tests in the automatic test suite'
	@echo '  test-foo     - run only specified tests (e.g. test-merge1)'
	@echo '  dist         - run all tests and create a source tarball in dist/'
	@echo '  clean        - remove files created by other targets'
	@echo '                 (except installed files or dist source tarball)'
	@echo 'Example for a system-wide installation under /usr/local:'
	@echo '  make all && su -c "make install" && hg version'

all: build

build: tests
	$(PYTHON) build

	-$(PYTHON) clean --all # ignore errors from this command
	find . \( -name '*.py[cdo]' -o -name '*.so' \) -exec rm -f '{}' ';'
	rm -f MANIFEST hgopenurl/ tests/*.err
	rm -rf build

install: build
	$(PYTHON) install --root="$(DESTDIR)/" --prefix="$(PREFIX)" --force

install-home: build
	$(PYTHON) install --home="$(HOME)" --force

	hg manifest > MANIFEST
	echo hgopenurl/ >> MANIFEST

dist:	tests dist-notests

dist-notests: MANIFEST
	TAR_OPTIONS="--owner=root --group=root --mode=u+w,go-w,a+rX-s" \
	  $(PYTHON) -q sdist

check tests:
	$(PYTHON) tests/cram/ $(TESTFLAGS) $(TESTS)

	$(PYTHON) tests/cram/ $(TESTFLAGS) $@

.PHONY: help all build clean install install-home dist dist-notests tests