ocaml/manual/manual/cmds/Makefile

53 lines
1.4 KiB
Makefile
Raw Normal View History

TOPDIR = ../../..
include $(TOPDIR)/Makefile.tools
LD_PATH = "$(TOPDIR)/otherlibs/str:$(TOPDIR)/otherlibs/unix"
manual Makefiles: set LD_PATH to protect from stale installs Trying to build the manual (make -C manual/manual etex-files) when your current opan switch is stale (for example, 4.05.0 when working on the current 4.07.0+dev trunk) results in the following error: make[1]: Entering directory '/home/gasche/Prog/ocaml/github-trunk/manual/manual/tutorials' Fatal error: cannot load shared library dllunix Reason: /home/gasche/.opam/4.05.0/lib/ocaml/stublibs/dllunix.so: undefined symbol: caml_strdup Failure when generating coreexamples.tex Fatal error: cannot load shared library dllunix Reason: /home/gasche/.opam/4.05.0/lib/ocaml/stublibs/dllunix.so: undefined symbol: caml_strdup Failure when generating lablexamples.tex Fatal error: cannot load shared library dllunix Reason: /home/gasche/.opam/4.05.0/lib/ocaml/stublibs/dllunix.so: undefined symbol: caml_strdup Failure when generating objectexamples.tex Fatal error: cannot load shared library dllunix Reason: /home/gasche/.opam/4.05.0/lib/ocaml/stublibs/dllunix.so: undefined symbol: caml_strdup Failure when generating moduleexamples.tex Fatal error: cannot load shared library dllunix Reason: /home/gasche/.opam/4.05.0/lib/ocaml/stublibs/dllunix.so: undefined symbol: caml_strdup Failure when generating advexamples.tex Fatal error: cannot load shared library dllunix Reason: /home/gasche/.opam/4.05.0/lib/ocaml/stublibs/dllunix.so: undefined symbol: caml_strdup Failure when generating polymorphism.tex make[1]: Leaving directory '/home/gasche/Prog/ocaml/github-trunk/manual/manual/tutorials' This PR fixes the issue by using Makefile.tools' SET_LD_PATH variable to set a LD_PATH containing the required build directory's otherlibs/ libraries, instead of looking in an installed path. (no change entry needed)
2018-04-09 07:17:12 -07:00
TOOLS = ../../tools
CAMLLATEX = $(SET_LD_PATH) \
$(OCAMLRUN) $(TOPDIR)/tools/caml-tex \
-repo-root $(TOPDIR) -n 80 -v false
TEXQUOTE = $(OCAMLRUN) $(TOOLS)/texquote2
TRANSF = $(SET_LD_PATH) $(OCAMLRUN) $(TOOLS)/transf
FILES = comp.tex top.tex runtime.tex native.tex lexyacc.tex intf-c.tex \
2019-07-02 09:42:36 -07:00
ocamldep.tex profil.tex debugger.tex browser.tex ocamldoc.tex \
2020-10-08 06:19:31 -07:00
warnings-help.tex ocamlbuild.tex flambda.tex \
afl-fuzz.tex instrumented-runtime.tex unified-options.tex
2020-10-08 06:19:31 -07:00
WITH_TRANSF = top.tex intf-c.tex flambda.tex \
2016-11-03 07:41:45 -07:00
afl-fuzz.tex lexyacc.tex debugger.tex
2016-08-10 12:47:50 -07:00
WITH_CAMLEXAMPLE = instrumented-runtime.tex ocamldoc.tex
2016-08-10 12:47:50 -07:00
etex-files: $(FILES)
all: $(FILES)
%.tex: %.etex
$(TEXQUOTE) < $< > $*.texquote_error.tex
mv $*.texquote_error.tex $@
$(WITH_TRANSF): %.tex: %.etex
$(TRANSF) < $< > $*.transf_error.tex
mv $*.transf_error.tex $*.transf_gen.tex
$(TEXQUOTE) < $*.transf_gen.tex > $*.texquote_error.tex
mv $*.texquote_error.tex $@
$(WITH_CAMLEXAMPLE): %.tex: %.etex
$(CAMLLATEX) $< -o $*.gen.tex
$(TRANSF) < $*.gen.tex > $*.transf_error.tex
mv $*.transf_error.tex $*.transf_gen.tex
$(TEXQUOTE) < $*.transf_gen.tex > $*.texquote_error.tex
mv $*.texquote_error.tex $@
warnings-help.etex: ../warnings-help.etex
cp $< $@
.PHONY: clean
clean:
rm -f *.tex
rm -f warnings-help.etex