1# SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) 2# Makefile.pylibfdt 3# 4 5PYLIBFDT_srcs = $(PYLIBFDT_dir)/libfdt.i 6PYMODULE = $(PYLIBFDT_dir)/_libfdt.so 7PYLIBFDT_CLEANFILES_L = libfdt_wrap.c libfdt.py *.pyc *.so 8PYLIBFDT_CLEANFILES = $(PYLIBFDT_CLEANFILES_L:%=$(PYLIBFDT_dir)/%) 9PYLIBFDT_CLEANDIRS_L = build __pycache__ 10PYLIBFDT_CLEANDIRS = $(PYLIBFDT_CLEANDIRS_L:%=$(PYLIBFDT_dir)/%) 11 12SETUP = $(PYLIBFDT_dir)/setup.py 13SETUPFLAGS = 14 15ifndef V 16SETUPFLAGS += --quiet 17endif 18 19$(PYMODULE): $(PYLIBFDT_srcs) $(LIBFDT_archive) $(SETUP) $(VERSION_FILE) 20 @$(VECHO) PYMOD $@ 21 $(PYTHON) $(SETUP) $(SETUPFLAGS) build_ext --build-lib=../$(PYLIBFDT_dir) 22 23install_pylibfdt: $(PYMODULE) 24 @$(VECHO) INSTALL-PYLIB 25 $(PYTHON) $(SETUP) $(SETUPFLAGS) install --prefix=$(PREFIX) 26 27pylibfdt_clean: 28 @$(VECHO) CLEAN "(pylibfdt)" 29 rm -f $(PYLIBFDT_CLEANFILES) 30 rm -rf $(PYLIBFDT_CLEANDIRS) 31