Browse Source

pylibfdt: Use the call function to simplify the Makefile

This is in a separate patch since I not sure if GNU make features
are permitted in the Makefile.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
Simon Glass 8 years ago committed by David Gibson
parent
commit
ab15256d8d
  1. 14
      pylibfdt/Makefile.pylibfdt

14
pylibfdt/Makefile.pylibfdt

@ -5,11 +5,13 @@ PYLIBFDT_srcs = $(addprefix $(LIBFDT_srcdir)/,$(LIBFDT_SRCS))
WRAP = $(PYLIBFDT_objdir)/libfdt_wrap.c WRAP = $(PYLIBFDT_objdir)/libfdt_wrap.c
PYMODULE = $(PYLIBFDT_objdir)/_libfdt.so PYMODULE = $(PYLIBFDT_objdir)/_libfdt.so


run_setup = SOURCES="$(1)" CPPFLAGS="$(CPPFLAGS)" OBJDIR="$(PYLIBFDT_objdir)" \
VERSION="$(dtc_version)" \
python $(PYLIBFDT_objdir)/setup.py --quiet $(2)

$(PYMODULE): $(PYLIBFDT_srcs) $(WRAP) $(PYMODULE): $(PYLIBFDT_srcs) $(WRAP)
@$(VECHO) PYMOD $@ @$(VECHO) PYMOD $@
SOURCES="$^" CPPFLAGS="$(CPPFLAGS)" OBJDIR="$(PYLIBFDT_objdir)" \ $(call run_setup, $^, build_ext --inplace)
VERSION="$(dtc_version)" \
python $(PYLIBFDT_objdir)/setup.py --quiet build_ext --inplace


$(WRAP): $(PYLIBFDT_srcdir)/libfdt.swig $(WRAP): $(PYLIBFDT_srcdir)/libfdt.swig
@$(VECHO) SWIG $@ @$(VECHO) SWIG $@
@ -17,10 +19,8 @@ $(WRAP): $(PYLIBFDT_srcdir)/libfdt.swig


install_pylibfdt: $(WRAP) $(PYMODULE) install_pylibfdt: $(WRAP) $(PYMODULE)
$(VECHO) INSTALL-PYLIB; \ $(VECHO) INSTALL-PYLIB; \
SOURCES="$(PYLIBFDT_srcs) $(WRAP)" CPPFLAGS="$(CPPFLAGS)" \ $(call run_setup, $(PYLIBFDT_srcs) $(WRAP), \
OBJDIR="$(PYLIBFDT_objdir)" VERSION="$(dtc_version)" \ install $(if $(SETUP_PREFIX),--prefix=$(SETUP_PREFIX)))
python $(PYLIBFDT_objdir)/setup.py --quiet install \
$(if $(SETUP_PREFIX),--prefix=$(SETUP_PREFIX))


maybe_install_pylibfdt: maybe_install_pylibfdt:
if [ -e $(PYMODULE) ]; then \ if [ -e $(PYMODULE) ]; then \

Loading…
Cancel
Save