[MERGED] osmo-gsm-manuals[master]: Makefile: Add check-deps target and run it by default

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Jul 20 16:58:47 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: Makefile: Add check-deps target and run it by default
......................................................................


Makefile: Add check-deps target and run it by default

This target will do several quick tests to ensure all the required
dependencies needed to build all documents are installed on the system.
If a dependency is missing, we abort the build early. Otherwise we can
end up building documents which some content missing.

Change-Id: I9b86aedd3bfccd7ac00343c16b9d25adc605808d
---
M Makefile
1 file changed, 20 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/Makefile b/Makefile
index fc8ebbf..a870bef 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-all:
+all: check-deps
 	cd OsmoBTS; $(MAKE)
 	cd OsmoNITB; $(MAKE)
 	cd OsmoBSC; $(MAKE)
@@ -38,3 +38,22 @@
 	#cd OsmoMGCP; $(MAKE) check
 	#cd OsmoNAT; $(MAKE) check
 	cd OsmoGSMTester; $(MAKE) check
+
+define check_dep_bin
+    @type $(1) >/dev/null 2>&1 || { echo >&2 "Binary '$(1)' not found in path, please install $(2)."; exit 1; }
+endef
+define check_dep_python2_module
+    @echo "import $(1)" | python2 - >/dev/null 2>&1 || { echo >&2 "Failed to import '$(1)' module, please install $(2)."; exit 1; }
+endef
+
+check-deps:
+	$(call check_dep_bin,mscgen,mscgen)
+	$(call check_dep_bin,xsltproc,libxslt)
+	$(call check_dep_bin,git,git)
+	$(call check_dep_bin,a2x,asciidoc)
+	$(call check_dep_bin,asciidoc,asciidoc)
+	$(call check_dep_bin,dblatex,dblatex)
+	$(call check_dep_bin,packetdiag,nwdiag)
+	$(call check_dep_bin,dot,graphviz)
+	$(call check_dep_bin,python2,python2)
+	$(call check_dep_python2_module,pychart,python2-pychart)

-- 
To view, visit https://gerrit.osmocom.org/3315
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9b86aedd3bfccd7ac00343c16b9d25adc605808d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list