summaryrefslogtreecommitdiff
path: root/requirements/Makefile
blob: 2c4a9f0a935d89a7838dbe3c275bace8d8eaa3a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Makefile for updating BuildStream's requirements files.
#

REQUIREMENTS_IN := $(wildcard *.in)
REQUIREMENTS_TXT := $(REQUIREMENTS_IN:.in=.txt)
PYTHON := python3
VENV := $(PYTHON) -m venv

VENV_PIP = $(VENVDIR)/bin/pip


.PHONY: all FORCE

all: $(REQUIREMENTS_TXT)

%.txt: %.in FORCE
	$(eval VENVDIR := $(shell mktemp -d $(CURDIR)/.bst-venv.XXXXXX))
	$(VENV) $(VENVDIR)
	$(VENV_PIP) install -r $<
	$(VENV_PIP) freeze -r $< | grep -v pkg-resources > $@
	rm -rf $(VENVDIR)

FORCE: