Makefile 480 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
# 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


12
.PHONY: all FORCE
13 14 15

all: $(REQUIREMENTS_TXT)

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

FORCE: