@ -117,20 +117,26 @@ TARGET ?=
########################################################
########################################################
.PHONY : all
all : clean python
all : clean python
.PHONY : tests
tests :
tests :
$( ANSIBLE_TEST) units -v --python $( PYTHON_VERSION) $( TEST_FLAGS)
$( ANSIBLE_TEST) units -v --python $( PYTHON_VERSION) $( TEST_FLAGS)
.PHONY : tests -py 3
tests-py3 :
tests-py3 :
$( ANSIBLE_TEST) units -v --python $( PYTHON3_VERSION) $( TEST_FLAGS)
$( ANSIBLE_TEST) units -v --python $( PYTHON3_VERSION) $( TEST_FLAGS)
.PHONY : tests -nonet
tests-nonet :
tests-nonet :
$( ANSIBLE_TEST) units -v --python $( PYTHON_VERSION) $( TEST_FLAGS) --exclude test/units/modules/network/
$( ANSIBLE_TEST) units -v --python $( PYTHON_VERSION) $( TEST_FLAGS) --exclude test/units/modules/network/
.PHONY : integration
integration :
integration :
$( ANSIBLE_TEST) integration -v --docker $( IMAGE) $( TARGET) $( TEST_FLAGS)
$( ANSIBLE_TEST) integration -v --docker $( IMAGE) $( TARGET) $( TEST_FLAGS)
.PHONY : authors
authors :
authors :
sh hacking/authors.sh
sh hacking/authors.sh
@ -144,15 +150,19 @@ authors:
%.1 : %.1.asciidoc VERSION
%.1 : %.1.asciidoc VERSION
$( ASCII2MAN)
$( ASCII2MAN)
.PHONY : loc
loc :
loc :
sloccount lib library bin
sloccount lib library bin
.PHONY : pep 8
pep8 :
pep8 :
$( ANSIBLE_TEST) sanity --test pep8 --python $( PYTHON_VERSION) $( TEST_FLAGS)
$( ANSIBLE_TEST) sanity --test pep8 --python $( PYTHON_VERSION) $( TEST_FLAGS)
.PHONY : pyflakes
pyflakes :
pyflakes :
pyflakes lib/ansible/*.py lib/ansible/*/*.py bin/*
pyflakes lib/ansible/*.py lib/ansible/*/*.py bin/*
.PHONY : clean
clean :
clean :
@echo "Cleaning up distutils stuff"
@echo "Cleaning up distutils stuff"
rm -rf build
rm -rf build
@ -190,23 +200,29 @@ clean:
$( MAKE) -C docs/docsite clean
$( MAKE) -C docs/docsite clean
$( MAKE) -C docs/api clean
$( MAKE) -C docs/api clean
.PHONY : python
python :
python :
$( PYTHON) setup.py build
$( PYTHON) setup.py build
.PHONY : install
install :
install :
$( PYTHON) setup.py install
$( PYTHON) setup.py install
.PHONY : sdist
sdist : clean docs
sdist : clean docs
$( PYTHON) setup.py sdist
$( PYTHON) setup.py sdist
.PHONY : sdist_upload
sdist_upload : clean docs
sdist_upload : clean docs
$( PYTHON) setup.py sdist upload 2>& 1 | tee upload.log
$( PYTHON) setup.py sdist upload 2>& 1 | tee upload.log
.PHONY : rpmcommon
rpmcommon : sdist
rpmcommon : sdist
@mkdir -p rpm-build
@mkdir -p rpm-build
@cp dist/*.gz 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
@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-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/
$( MOCK_BIN) -r $( MOCK_CFG) $( MOCK_ARGS) --resultdir rpm-build/ --buildsrpm --spec rpm-build/$( NAME) .spec --sources rpm-build/
@echo "#############################################"
@echo "#############################################"
@ -214,6 +230,7 @@ mock-srpm: /etc/mock/$(MOCK_CFG).cfg rpmcommon
@echo rpm-build/*.src.rpm
@echo rpm-build/*.src.rpm
@echo "#############################################"
@echo "#############################################"
.PHONY : mock -rpm
mock-rpm : /etc /mock /$( MOCK_CFG ) .cfg mock -srpm
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
$( MOCK_BIN) -r $( MOCK_CFG) $( MOCK_ARGS) --resultdir rpm-build/ --rebuild rpm-build/$( NAME) -*.src.rpm
@echo "#############################################"
@echo "#############################################"
@ -221,6 +238,7 @@ mock-rpm: /etc/mock/$(MOCK_CFG).cfg mock-srpm
@echo rpm-build/*.noarch.rpm
@echo rpm-build/*.noarch.rpm
@echo "#############################################"
@echo "#############################################"
.PHONY : srpm
srpm : rpmcommon
srpm : rpmcommon
@rpmbuild --define "_topdir %(pwd)/rpm-build" \
@rpmbuild --define "_topdir %(pwd)/rpm-build" \
--define "_builddir %{_topdir}" \
--define "_builddir %{_topdir}" \
@ -235,6 +253,7 @@ srpm: rpmcommon
@echo " rpm-build/ $( RPMNVR) .src.rpm "
@echo " rpm-build/ $( RPMNVR) .src.rpm "
@echo "#############################################"
@echo "#############################################"
.PHONY : rpm
rpm : rpmcommon
rpm : rpmcommon
@rpmbuild --define "_topdir %(pwd)/rpm-build" \
@rpmbuild --define "_topdir %(pwd)/rpm-build" \
--define "_builddir %{_topdir}" \
--define "_builddir %{_topdir}" \
@ -251,6 +270,7 @@ rpm: rpmcommon
@echo " rpm-build/ $( RPMNVR) .noarch.rpm "
@echo " rpm-build/ $( RPMNVR) .noarch.rpm "
@echo "#############################################"
@echo "#############################################"
.PHONY : debian
debian : sdist
debian : sdist
@for DIST in $( DEB_DIST) ; do \
@for DIST in $( DEB_DIST) ; do \
mkdir -p deb-build/$$ { DIST} ; \
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 ; \
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
done
.PHONY : deb
deb : deb -src
deb : deb -src
@for DIST in $( DEB_DIST) ; do \
@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} " ; \
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.
# Build package outside of pbuilder, with locally installed dependencies.
# Install BuildRequires as noted in packaging/debian/control.
# Install BuildRequires as noted in packaging/debian/control.
.PHONY : local_deb
local_deb : debian
local_deb : debian
@for DIST in $( DEB_DIST) ; do \
@for DIST in $( DEB_DIST) ; do \
( cd deb-build/$$ { DIST} /$( NAME) -$( VERSION) / && $( DEBUILD) -b) ; \
( cd deb-build/$$ { DIST} /$( NAME) -$( VERSION) / && $( DEBUILD) -b) ; \
@ -286,6 +308,7 @@ local_deb: debian
done
done
@echo "#############################################"
@echo "#############################################"
.PHONY : deb -src
deb-src : debian
deb-src : debian
@for DIST in $( DEB_DIST) ; do \
@for DIST in $( DEB_DIST) ; do \
( cd deb-build/$$ { DIST} /$( NAME) -$( VERSION) / && $( DEBUILD) -S) ; \
( cd deb-build/$$ { DIST} /$( NAME) -$( VERSION) / && $( DEBUILD) -S) ; \
@ -297,23 +320,28 @@ deb-src: debian
done
done
@echo "#############################################"
@echo "#############################################"
.PHONY : deb -upload
deb-upload : deb
deb-upload : deb
@for DIST in $( DEB_DIST) ; do \
@for DIST in $( DEB_DIST) ; do \
$( DPUT_BIN) $( DPUT_OPTS) $( DEB_PPA) deb-build/$$ { DIST} /$( NAME) _$( VERSION) -$( DEB_RELEASE) ~$$ { DIST} _amd64.changes ; \
$( DPUT_BIN) $( DPUT_OPTS) $( DEB_PPA) deb-build/$$ { DIST} /$( NAME) _$( VERSION) -$( DEB_RELEASE) ~$$ { DIST} _amd64.changes ; \
done
done
.PHONY : deb -src -upload
deb-src-upload : deb -src
deb-src-upload : deb -src
@for DIST in $( DEB_DIST) ; do \
@for DIST in $( DEB_DIST) ; do \
$( DPUT_BIN) $( DPUT_OPTS) $( DEB_PPA) deb-build/$$ { DIST} /$( NAME) _$( VERSION) -$( DEB_RELEASE) ~$$ { DIST} _source.changes ; \
$( DPUT_BIN) $( DPUT_OPTS) $( DEB_PPA) deb-build/$$ { DIST} /$( NAME) _$( VERSION) -$( DEB_RELEASE) ~$$ { DIST} _source.changes ; \
done
done
.PHONY : epub
epub :
epub :
( cd docs/docsite/; CPUS = $( CPUS) make epub)
( cd docs/docsite/; CPUS = $( CPUS) make epub)
# for arch or gentoo, read instructions in the appropriate 'packaging' subdirectory directory
# for arch or gentoo, read instructions in the appropriate 'packaging' subdirectory directory
.PHONY : webdocs
webdocs :
webdocs :
( cd docs/docsite/; CPUS = $( CPUS) make docs)
( cd docs/docsite/; CPUS = $( CPUS) make docs)
.PHONY : generate_asciidoc
generate_asciidoc : lib /ansible /cli /*.py
generate_asciidoc : lib /ansible /cli /*.py
mkdir -p ./docs/man/man1/
mkdir -p ./docs/man/man1/
PYTHONPATH = ./lib ./docs/bin/generate_man.py
PYTHONPATH = ./lib ./docs/bin/generate_man.py
@ -321,6 +349,7 @@ generate_asciidoc: lib/ansible/cli/*.py
docs : generate_asciidoc
docs : generate_asciidoc
make $( MANPAGES)
make $( MANPAGES)
.PHONY : alldocs
alldocs : docs webdocs
alldocs : docs webdocs
version :
version :