dtc/pylibfdt/Makefile.pylibfdt
Dan Horák 1df7b047fe pylibfdt/Makefile.pylibfdt: use project's flags to compile the extension
Seems the project's CFLAGS are not used when compiling the python
extension's C code via the setup.py script. Some default flags are used
instead. Thus pass the CFLAGS explicitly. Unfortunately the SWIG generated
code is not clean and requires -Wno-error override to compile successfully,
because -Werror is used in the project's flags.

Signed-off-by: Dan Horák <dan@danny.cz>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-07-06 15:58:06 +10:00

29 lines
846 B
Text

# SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
# Makefile.pylibfdt
#
PYLIBFDT_srcs = $(PYLIBFDT_dir)/libfdt.i
PYMODULE = $(PYLIBFDT_dir)/_libfdt.so
PYLIBFDT_CLEANFILES_L = libfdt_wrap.c libfdt.py *.pyc *.so
PYLIBFDT_CLEANFILES = $(PYLIBFDT_CLEANFILES_L:%=$(PYLIBFDT_dir)/%)
PYLIBFDT_CLEANDIRS_L = __pycache__ libfdt.egg-info
PYLIBFDT_CLEANDIRS = build $(PYLIBFDT_CLEANDIRS_L:%=$(PYLIBFDT_dir)/%)
SETUP = ./setup.py
ifndef V
SETUPFLAGS += --quiet
endif
$(PYMODULE): $(PYLIBFDT_srcs) $(LIBFDT_archive) $(SETUP)
@$(VECHO) PYMOD $@
CFLAGS="$(CFLAGS) -Wno-error" $(PYTHON) $(SETUP) $(SETUPFLAGS) build_ext
install_pylibfdt: $(PYMODULE)
@$(VECHO) INSTALL-PYLIB
$(PYTHON) $(SETUP) $(SETUPFLAGS) install --prefix=$(PREFIX)
pylibfdt_clean:
@$(VECHO) CLEAN "(pylibfdt)"
rm -f $(PYLIBFDT_CLEANFILES)
rm -rf $(PYLIBFDT_CLEANDIRS)