unstructured
30 строк · 979.0 Байт
1PIP = pip-compile --upgrade -o $@ $<2SHELL := /bin/bash3# we don't need to make constraints.txt from constraints.in
4REQUIREMENTS := $(filter-out ./constraints.in,$(shell find . -type f -name '*.in'))5REQUIREMENTSTXT := $(patsubst %.in,%.txt,$(REQUIREMENTS))6
7# those dependencies only needs constraint.in to and %.in to compile
8constraint_dependent = base.txt extra-pptx.txt9
10.PHONY: all $(REQUIREMENTSTXT)11
12all: $(REQUIREMENTSTXT)13
14# a special case where the .txt depends on other .txt; here dev.txt depends on test.txt
15dev.txt: dev.in test.txt base.txt constraints.in16$(PIP)17
18# the most common case: an extra (or test.txt) that depends on base.txt and %.in
19$(REQUIREMENTSTXT): %.txt: %.in base.txt constraints.in20$(PIP)21
22# special case where its only extra dependency is constraints.in; here base.txt and extra-ppt.txt
23# only depends on their own .in and constraits.in
24$(constraint_dependent): %.txt: %.in constraints.in25$(PIP)26
27.PHONY: clean28
29clean:30rm $(REQUIREMENTSTXT)31