aboutsummaryrefslogtreecommitdiff
path: root/pylibfdt/Makefile.pylibfdt
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2018-08-10 14:25:42 +1000
committerDavid Gibson <david@gibson.dropbear.id.au>2018-09-25 10:31:00 +1000
commit98972f1b3e33f17d290fc39e037a78b863c92cf6 (patch)
tree0d848d6fcb8e92f40cf4ff86a3879f8c58e6e225 /pylibfdt/Makefile.pylibfdt
parent7ba2be6cda5f3d55aad18f0a5d585c0638e57c95 (diff)
downloaddtc-98972f1b3e33f17d290fc39e037a78b863c92cf6.zip
dtc-98972f1b3e33f17d290fc39e037a78b863c92cf6.tar.gz
dtc-98972f1b3e33f17d290fc39e037a78b863c92cf6.tar.bz2
pylibfdt: Improved version extraction
Currently setup.py expects the library version in a VERSION environment variable, or it exctracts the version from the Makefile. The latter is for the case where the script is run standalone, rather than from make. But parsing the Makefile is ugly and fragile, and won't always get the same version we put into the C code. This changes to instead extracting the version from the trivial .h file we already generate to put the version into C code. It's still slightly ugly, but it's simpler and since we can control the precise format of that .h, not as fragile. This lets us remove the remains of the makefile parsing code from setup.py. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'pylibfdt/Makefile.pylibfdt')
-rw-r--r--pylibfdt/Makefile.pylibfdt3
1 files changed, 1 insertions, 2 deletions
diff --git a/pylibfdt/Makefile.pylibfdt b/pylibfdt/Makefile.pylibfdt
index 005cb25..5fe5c82 100644
--- a/pylibfdt/Makefile.pylibfdt
+++ b/pylibfdt/Makefile.pylibfdt
@@ -12,11 +12,10 @@ SETUPFLAGS += --quiet
endif
define run_setup
- VERSION="$(dtc_version)"
$(SETUP) $(SETUPFLAGS) $(1)
endef
-$(PYMODULE): $(PYLIBFDT_srcs) $(LIBFDT_archive) $(SETUP)
+$(PYMODULE): $(PYLIBFDT_srcs) $(LIBFDT_archive) $(SETUP) $(VERSION_FILE)
@$(VECHO) PYMOD $@
$(call run_setup, build_ext --build-lib=$(PYLIBFDT_objdir))