summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMiyurz <Miyurz@users.noreply.github.com>2017-08-11 03:05:58 +0530
committerSam Doran <sdoran@ansible.com>2017-08-10 17:35:58 -0400
commit3b4ff67b3b1ee0614b7da15f454e3814d146800e (patch)
tree8dcb1478dec5c72bb8c2188076c60d40e4a1442c /Makefile
parent914ae2fb26b97ec10531e29c70bd2f6494380620 (diff)
downloadansible-3b4ff67b3b1ee0614b7da15f454e3814d146800e.tar.gz
Made the applicable targets as PHONY (#27996)
https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 29 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 07b75439b1..84b3c99154 100644
--- a/Makefile
+++ b/Makefile
@@ -117,20 +117,26 @@ TARGET ?=
########################################################
+.PHONY: all
all: clean python
+.PHONY: tests
tests:
$(ANSIBLE_TEST) units -v --python $(PYTHON_VERSION) $(TEST_FLAGS)
+.PHONY: tests-py3
tests-py3:
$(ANSIBLE_TEST) units -v --python $(PYTHON3_VERSION) $(TEST_FLAGS)
+.PHONY: tests-nonet
tests-nonet:
$(ANSIBLE_TEST) units -v --python $(PYTHON_VERSION) $(TEST_FLAGS) --exclude test/units/modules/network/
+.PHONY: integration
integration:
$(ANSIBLE_TEST) integration -v --docker $(IMAGE) $(TARGET) $(TEST_FLAGS)
+.PHONY: authors
authors:
sh hacking/authors.sh
@@ -144,15 +150,19 @@ authors:
%.1: %.1.asciidoc VERSION
$(ASCII2MAN)
+.PHONY: loc
loc:
sloccount lib library bin
+.PHONY: pep8
pep8:
$(ANSIBLE_TEST) sanity --test pep8 --python $(PYTHON_VERSION) $(TEST_FLAGS)
+.PHONY: pyflakes
pyflakes:
pyflakes lib/ansible/*.py lib/ansible/*/*.py bin/*
+.PHONY: clean
clean:
@echo "Cleaning up distutils stuff"
rm -rf build
@@ -190,23 +200,29 @@ clean:
$(MAKE) -C docs/docsite clean
$(MAKE) -C docs/api clean
+.PHONY: python
python:
$(PYTHON) setup.py build
+.PHONY: install
install:
$(PYTHON) setup.py install
+.PHONY: sdist
sdist: clean docs
$(PYTHON) setup.py sdist
+.PHONY: sdist_upload
sdist_upload: clean docs
$(PYTHON) setup.py sdist upload 2>&1 |tee upload.log
+.PHONY: rpmcommon
rpmcommon: sdist
@mkdir -p rpm-build
@cp dist/*.gz rpm-build/
@sed -e 's#^Version:.*#Version: $(VERSION)#' -e 's#^Release:.*#Release: $(RPMRELEASE)%{?dist}$(REPOTAG)#' $(RPMSPEC) >rpm-build/$(NAME).spec
+.PHONY: mock-srpm
mock-srpm: /etc/mock/$(MOCK_CFG).cfg rpmcommon
$(MOCK_BIN) -r $(MOCK_CFG) $(MOCK_ARGS) --resultdir rpm-build/ --buildsrpm --spec rpm-build/$(NAME).spec --sources rpm-build/
@echo "#############################################"
@@ -214,6 +230,7 @@ mock-srpm: /etc/mock/$(MOCK_CFG).cfg rpmcommon
@echo rpm-build/*.src.rpm
@echo "#############################################"
+.PHONY: mock-rpm
mock-rpm: /etc/mock/$(MOCK_CFG).cfg mock-srpm
$(MOCK_BIN) -r $(MOCK_CFG) $(MOCK_ARGS) --resultdir rpm-build/ --rebuild rpm-build/$(NAME)-*.src.rpm
@echo "#############################################"
@@ -221,6 +238,7 @@ mock-rpm: /etc/mock/$(MOCK_CFG).cfg mock-srpm
@echo rpm-build/*.noarch.rpm
@echo "#############################################"
+.PHONY: srpm
srpm: rpmcommon
@rpmbuild --define "_topdir %(pwd)/rpm-build" \
--define "_builddir %{_topdir}" \
@@ -235,6 +253,7 @@ srpm: rpmcommon
@echo " rpm-build/$(RPMNVR).src.rpm"
@echo "#############################################"
+.PHONY: rpm
rpm: rpmcommon
@rpmbuild --define "_topdir %(pwd)/rpm-build" \
--define "_builddir %{_topdir}" \
@@ -251,6 +270,7 @@ rpm: rpmcommon
@echo " rpm-build/$(RPMNVR).noarch.rpm"
@echo "#############################################"
+.PHONY: debian
debian: sdist
@for DIST in $(DEB_DIST) ; do \
mkdir -p deb-build/$${DIST} ; \
@@ -259,6 +279,7 @@ debian: sdist
sed -ie "s|%VERSION%|$(VERSION)|g;s|%RELEASE%|$(DEB_RELEASE)|;s|%DIST%|$${DIST}|g;s|%DATE%|$(DEB_DATE)|g" deb-build/$${DIST}/$(NAME)-$(VERSION)/debian/changelog ; \
done
+.PHONY: deb
deb: deb-src
@for DIST in $(DEB_DIST) ; do \
PBUILDER_OPTS="$(PBUILDER_OPTS) --distribution $${DIST} --basetgz $(PBUILDER_CACHE_DIR)/$${DIST}-$(PBUILDER_ARCH)-base.tgz --buildresult $(CURDIR)/deb-build/$${DIST}" ; \
@@ -275,6 +296,7 @@ deb: deb-src
# Build package outside of pbuilder, with locally installed dependencies.
# Install BuildRequires as noted in packaging/debian/control.
+.PHONY: local_deb
local_deb: debian
@for DIST in $(DEB_DIST) ; do \
(cd deb-build/$${DIST}/$(NAME)-$(VERSION)/ && $(DEBUILD) -b) ; \
@@ -286,6 +308,7 @@ local_deb: debian
done
@echo "#############################################"
+.PHONY: deb-src
deb-src: debian
@for DIST in $(DEB_DIST) ; do \
(cd deb-build/$${DIST}/$(NAME)-$(VERSION)/ && $(DEBUILD) -S) ; \
@@ -297,23 +320,28 @@ deb-src: debian
done
@echo "#############################################"
+.PHONY: deb-upload
deb-upload: deb
@for DIST in $(DEB_DIST) ; do \
$(DPUT_BIN) $(DPUT_OPTS) $(DEB_PPA) deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}_amd64.changes ; \
done
+.PHONY: deb-src-upload
deb-src-upload: deb-src
@for DIST in $(DEB_DIST) ; do \
$(DPUT_BIN) $(DPUT_OPTS) $(DEB_PPA) deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}_source.changes ; \
done
+.PHONY: epub
epub:
(cd docs/docsite/; CPUS=$(CPUS) make epub)
# for arch or gentoo, read instructions in the appropriate 'packaging' subdirectory directory
+.PHONY: webdocs
webdocs:
(cd docs/docsite/; CPUS=$(CPUS) make docs)
+.PHONY: generate_asciidoc
generate_asciidoc: lib/ansible/cli/*.py
mkdir -p ./docs/man/man1/
PYTHONPATH=./lib ./docs/bin/generate_man.py
@@ -321,6 +349,7 @@ generate_asciidoc: lib/ansible/cli/*.py
docs: generate_asciidoc
make $(MANPAGES)
+.PHONY: alldocs
alldocs: docs webdocs
version: