]> arthur.barton.de Git - ansible-collection-boilerplate.git/blob - Makefile
Makefile: Fix "distcheck" when there are multiple archives in "dist/" directory
[ansible-collection-boilerplate.git] / Makefile
1 #
2 # Ansible Boilerplate Collection: Makefile for the project itself.
3 #
4
5 DIST_D = $(CURDIR)/dist
6
7 default: all
8
9 # Include the "real" boilerplate Makefile into this "wrapper" Makefile:
10 include Makefile.boilerplate
11
12 check: check-ansible
13
14 install:
15
16 clean:
17
18 distclean: clean distclean-ansible
19 #       Remove distribution directory
20         rm -fr "$(DIST_D)"
21
22 maintainer-clean: distclean
23
24 dist: all $(VENV_BIN)/ansible-galaxy
25 #       Create distribution archive ...
26         mkdir -p "$(DIST_D)"
27         "$(VENV_BIN)"/ansible-galaxy collection build --force --output-path "$(DIST_D)"
28
29 distcheck: dist
30 #       Run tests on distribution archive ...
31         mkdir -p "$(DIST_D)/check"
32         tar -C "$(DIST_D)/check" -xzf $$(find "$(DIST_D)" -name '*.tar.gz' | sort -Vr | head -n1)
33         test -e "$(VENV_D)" && ln -fs "$(VENV_D)" "$(DIST_D)/check/.venv"
34         make -C "$(DIST_D)/check" check
35 #       Clean up ...
36         rm -fr "$(DIST_D)/check"
37
38 .PHONY: default all check install clean distclean maintainer-clean dist distcheck