]> arthur.barton.de Git - ansible-collection-boilerplate.git/commitdiff
Makefile.boilerplate: Let Python "venv targets" depend on "requirements.txt"
authorAlexander Barton <alex@barton.de>
Sat, 29 Jul 2023 16:33:45 +0000 (18:33 +0200)
committerAlexander Barton <alex@barton.de>
Sat, 29 Jul 2023 17:00:39 +0000 (19:00 +0200)
This allows dependent projects to actually provide a Makefile target to
generate the "requirements.txt" from an other package manager.

With this change, both the "this_makefile_path" and "this_dir" variables
are no longer used (never have been?) and therefore have been removed.

Makefile.boilerplate

index d4697050295e0f0ea72d9a9ba08f86a4805792b2..2342c2b235acd1964041116fae65a7efe0f90bb6 100644 (file)
@@ -7,9 +7,6 @@ SOURCE_ROOT ?= $(CURDIR)
 VENV_D = $(SOURCE_ROOT)/.venv
 VENV_BIN = $(VENV_D)/bin
 
-this_makefile_path:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
-this_dir:=$(shell cd $(dir $(this_makefile_path));pwd)
-
 check-ansible: $(VENV_BIN)/ansible-lint
 #      Check Ansible executable ...
        "$(VENV_BIN)"/ansible --version
@@ -37,12 +34,12 @@ distclean-ansible:
          test -h "$$cmd" && rm -f "$$cmd" || true; \
         done
 
-$(VENV_BIN)/ansible $(VENV_BIN)/ansible-galaxy $(VENV_BIN)/ansible-lint venv: $(VENV_BIN)/pip
+$(VENV_BIN)/ansible $(VENV_BIN)/ansible-galaxy $(VENV_BIN)/ansible-lint venv: $(SOURCE_ROOT)/requirements.txt $(VENV_BIN)/pip
 #      Install/upgrade Python package manager
        "$(VENV_BIN)"/pip install --upgrade pip wheel
        touch "$(VENV_BIN)/pip" "$(VENV_BIN)/wheel"
 #      Install/upgrade Python dependencies ...
-       "$(VENV_BIN)"/pip install --upgrade --requirement $(this_dir)/requirements.txt
+       "$(VENV_BIN)"/pip install --upgrade --requirement $(SOURCE_ROOT)/requirements.txt
        touch "$(VENV_BIN)/ansible" "$(VENV_BIN)/ansible-galaxy" "$(VENV_BIN)/ansible-lint"
 
 $(VENV_BIN)/pip: