2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 01:51:51 +00:00
criu/crit/Makefile
Radostin Stoyanov 4f15fe8c59 make: improve check for externally managed Python
Move PYTHON_EXTERNALLY_MANAGED and PIP_BREAK_SYSTEM_PACKAGES
into Makefile.install to avoid code duplication. In addition, add
PIPFLAGS variable to enable specifying pip options during installation.
This is particularly useful for packaging, where it is common for `pip install`
to run in an environment with pre-installed dependencies and without internet
access. In such environment, we need to specify the following options:

    --no-build-isolation --no-index --no-deps

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2024-09-11 16:02:11 -07:00

26 lines
620 B
Makefile

VERSION_FILE := $(if $(obj),$(addprefix $(obj)/,crit/version.py),crit/version.py)
all-y += ${VERSION_FILE}
cleanup-y += ${VERSION_FILE}
${VERSION_FILE}:
$(Q) echo "__version__ = '${CRIU_VERSION}'" > $@
install: ${VERSION_FILE}
ifeq ($(SKIP_PIP_INSTALL),0)
$(E) " INSTALL " crit
$(Q) $(PYTHON) -m pip install $(PIPFLAGS) --prefix=$(DESTDIR)$(PREFIX) ./crit
else
$(E) " SKIP INSTALL crit"
endif
.PHONY: install
uninstall:
ifeq ($(SKIP_PIP_INSTALL),0)
$(E) " UNINSTALL" crit
$(Q) $(PYTHON) ./scripts/uninstall_module.py --prefix=$(DESTDIR)$(PREFIX) crit
else
$(E) " SKIP UNINSTALL crit"
endif
.PHONY: uninstall