]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
tools/pygrub: Factor out common setup.py parts
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 14 Mar 2023 11:24:22 +0000 (11:24 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 17 Mar 2023 10:44:16 +0000 (10:44 +0000)
... to mirror the tools/python side in c/s 2b8314a3c354.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
tools/pygrub/Makefile

index 37b214621492025149530cc8793eac781f5b8038..29ad0513212fef420f4a838cde6b123d0e2adced 100644 (file)
@@ -6,19 +6,20 @@ PY_CFLAGS = $(CFLAGS) $(PY_NOOPT_CFLAGS)
 PY_LDFLAGS = $(SHLIB_LDFLAGS) $(APPEND_LDFLAGS)
 INSTALL_LOG = build/installed_files.txt
 
+setup.py = CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDSHARED="$(CC)" LDFLAGS="$(PY_LDFLAGS)" \
+           $(PYTHON) setup.py
+
 .PHONY: all
 all: build
 .PHONY: build
 build:
-       CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDSHARED="$(CC)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py build
+       $(setup.py) build
 
 .PHONY: install
 install: all
        $(INSTALL_DIR) $(DESTDIR)/$(bindir)
-       CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDSHARED="$(CC)" \
-               LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py install \
-               --record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \
-                --root="$(DESTDIR)" --install-scripts=$(LIBEXEC_BIN) --force
+       $(setup.py) install --record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \
+               --root="$(DESTDIR)" --install-scripts=$(LIBEXEC_BIN) --force
        set -e; if [ $(bindir) != $(LIBEXEC_BIN) -a \
                     "`readlink -f $(DESTDIR)/$(bindir)`" != \
                     "`readlink -f $(LIBEXEC_BIN)`" ]; then \