Author: Ralf Treinen <treinen@debian.org>
Description: autodetection of bytecode-only architectures

Index: camlpdf/Makefile
===================================================================
--- camlpdf.orig/Makefile	2019-11-13 20:43:12.669682441 +0100
+++ camlpdf/Makefile	2019-11-13 20:43:17.741704301 +0100
@@ -11,15 +11,21 @@
 
 RESULT = camlpdf
 
-LIBINSTALL_FILES = camlpdf.a camlpdf.cma camlpdf.cmxa libcamlpdf_stubs.a \
-dllcamlpdf_stubs.* $(foreach x,$(PDFMODS),$x.mli)  $(foreach x,$(PDFMODS),$x.cmt) \
-$(foreach x,$(PDFMODS),$x.cmi) $(foreach x,$(PDFMODS),$x.cmx)
+LIBINSTALL_FILES = camlpdf.cma libcamlpdf_stubs.a \
+  dllcamlpdf_stubs.* $(foreach x,$(PDFMODS),$x.mli) \
+  $(foreach x,$(PDFMODS),$x.cmt) $(foreach x,$(PDFMODS),$x.cmi)
+TARGETS := byte-code-library htdoc
 
 OCAMLNCFLAGS = -g -safe-string -bin-annot -w -3
 OCAMLBCFLAGS = -g -safe-string -bin-annot -w -3
 OCAMLLDFLAGS = -g
 
-all : native-code-library byte-code-library htdoc
+ifneq ($(shell which ocamlopt),)
+  TARGETS += native-code-library
+  LIBINSTALL_FILES += camlpdf.a camlpdf.cmxa $(foreach x,$(PDFMODS),$x.cmx)
+endif
+
+all : $(TARGETS)
 
 clean ::
 	rm -rf doc foo foo2 out.pdf out2.pdf *.cmt
