diff options
author | David Allsopp <david.allsopp@metastack.com> | 2018-07-26 16:16:45 +0100 |
---|---|---|
committer | David Allsopp <david.allsopp@metastack.com> | 2018-09-07 08:34:53 +0200 |
commit | 767680794088867ef477efe4eb084bb672ed744e (patch) | |
tree | 1407918f649bf8886d596d2b8a840e35c0559fbe | |
parent | 9da2556825ee333a0133a7529060cadc8844fcbd (diff) | |
download | ocaml-767680794088867ef477efe4eb084bb672ed744e.tar.gz |
Always use ROOTDIR in lex and ocamldoc Makefiles
-rw-r--r-- | lex/Makefile | 19 | ||||
-rw-r--r-- | ocamldoc/Makefile | 49 |
2 files changed, 36 insertions, 32 deletions
diff --git a/lex/Makefile b/lex/Makefile index 0121a6a611..9d54602789 100644 --- a/lex/Makefile +++ b/lex/Makefile @@ -14,12 +14,12 @@ #************************************************************************** # The lexer generator -include ../config/Makefile -CAMLRUN ?= ../boot/ocamlrun -CAMLYACC ?= ../yacc/ocamlyacc ROOTDIR=.. +include $(ROOTDIR)/config/Makefile +include $(ROOTDIR)/Makefile.common + ifeq "$(wildcard $(ROOTDIR)/flexdll/Makefile)" "" FLEXLINK_ENV = else @@ -28,15 +28,18 @@ FLEXLINK_ENV = \ OCAML_FLEXLINK="$(ROOTDIR)/boot/ocamlrun $(ROOTDIR)/flexdll/flexlink.exe" # endif -CAMLC=$(CAMLRUN) ../boot/ocamlc -strict-sequence -nostdlib -I ../boot \ - -use-prims ../runtime/primitives -CAMLOPT=$(CAMLRUN) ../ocamlopt -nostdlib -I ../stdlib +CAMLRUN ?= $(ROOTDIR)/boot/ocamlrun +CAMLYACC ?= $(ROOTDIR)/yacc/ocamlyacc + +CAMLC=$(CAMLRUN) $(ROOTDIR)/boot/ocamlc -strict-sequence -nostdlib \ + -I $(ROOTDIR)/boot -use-prims $(ROOTDIR)/runtime/primitives +CAMLOPT=$(CAMLRUN) $(ROOTDIR)/ocamlopt -nostdlib -I $(ROOTDIR)/stdlib COMPFLAGS=$(INCLUDES) -absname -w +a-4-9-41-42-44-45-48 -warn-error A \ -safe-string -strict-sequence -strict-formats -bin-annot LINKFLAGS= YACCFLAGS=-v -CAMLLEX=$(CAMLRUN) ../boot/ocamllex -CAMLDEP=$(CAMLRUN) ../tools/ocamldep +CAMLLEX=$(CAMLRUN) $(ROOTDIR)/boot/ocamllex +CAMLDEP=$(CAMLRUN) $(ROOTDIR)/tools/ocamldep OBJS=cset.cmo syntax.cmo parser.cmo lexer.cmo table.cmo lexgen.cmo \ diff --git a/ocamldoc/Makefile b/ocamldoc/Makefile index db8960af2f..0a636155a4 100644 --- a/ocamldoc/Makefile +++ b/ocamldoc/Makefile @@ -67,7 +67,8 @@ ifeq "$(UNIX_OR_WIN32)" "unix" OCAMLDOC_RUN=$(OCAMLRUN) ./$(OCAMLDOC) endif else # Windows - OCAMLDOC_RUN = CAML_LD_LIBRARY_PATH="../otherlibs/win32unix;../otherlibs/str" $(OCAMLRUN) ./$(OCAMLDOC) + OCAMLDOC_RUN = \ + CAML_LD_LIBRARY_PATH="$(ROOTDIR)/otherlibs/win32unix;$(ROOTDIR)/otherlibs/str" $(OCAMLRUN) ./$(OCAMLDOC) endif OCAMLDOC_OPT=$(OCAMLDOC).opt @@ -353,17 +354,17 @@ test: test_stdlib: $(MKDIR) $@ $(OCAMLDOC_RUN) -html -colorize-code -sort -d $@ $(INCLUDES) -dump $@/stdlib.odoc -keep-code \ - ../stdlib/*.mli \ - ../otherlibs/$(UNIXLIB)/unix.mli \ - ../otherlibs/str/str.mli + $(ROOTDIR)/stdlib/*.mli \ + $(ROOTDIR)/otherlibs/$(UNIXLIB)/unix.mli \ + $(ROOTDIR)/otherlibs/str/str.mli .PHONY: test_stdlib_code test_stdlib_code: $(MKDIR) $@ $(OCAMLDOC_RUN) -html -colorize-code -sort -d $@ $(INCLUDES) -dump $@/stdlib.odoc -keep-code \ - `ls ../stdlib/*.ml | grep -v Labels` \ - ../otherlibs/$(UNIXLIB)/unix.ml \ - ../otherlibs/str/str.ml + `ls $(ROOTDIR)/stdlib/*.ml | grep -v Labels` \ + $(ROOTDIR)/otherlibs/$(UNIXLIB)/unix.ml \ + $(ROOTDIR)/otherlibs/str/str.ml .PHONY: test_framed test_framed: @@ -374,17 +375,17 @@ test_framed: test_latex: $(MKDIR) $@ $(OCAMLDOC_RUN) -latex -sort -o $@/test.tex -d $@ $(INCLUDES) odoc*.ml \ - odoc*.mli test2.txt ../stdlib/*.mli ../otherlibs/unix/unix.mli + odoc*.mli test2.txt $(ROOTDIR)/stdlib/*.mli $(ROOTDIR)/otherlibs/unix/unix.mli .PHONY: test_latex_simple test_latex_simple: $(MKDIR) $@ $(OCAMLDOC_RUN) -latex -sort -o $@/test.tex -d $@ $(INCLUDES) \ -latextitle 6,subsection -latextitle 7,subsubection \ - ../stdlib/hashtbl.mli \ - ../stdlib/arg.mli \ - ../otherlibs/$(UNIXLIB)/unix.mli \ - ../stdlib/map.mli + $(ROOTDIR)/stdlib/hashtbl.mli \ + $(ROOTDIR)/stdlib/arg.mli \ + $(ROOTDIR)/otherlibs/$(UNIXLIB)/unix.mli \ + $(ROOTDIR)/stdlib/map.mli .PHONY: test_man test_man: @@ -423,9 +424,9 @@ autotest_stdlib: $(MKDIR) $@ $(OCAMLDOC_RUN) -g autotest/odoc_test.cmo\ $(INCLUDES) -keep-code \ - ../stdlib/*.mli \ - ../otherlibs/$(UNIXLIB)/unix.mli \ - ../otherlibs/str/str.mli + $(ROOTDIR)/stdlib/*.mli \ + $(ROOTDIR)/otherlibs/$(UNIXLIB)/unix.mli \ + $(ROOTDIR)/otherlibs/str/str.mli # odoc rules : @@ -436,22 +437,22 @@ odoc: rm -rf odoc $(MKDIR) odoc # .cmti --> .odoc - for fn in ../stdlib/stdlib*.cmti; do \ - odoc compile $(INCLUDES) --package stdlib ../stdlib/$$fn; \ + for fn in $(ROOTDIR)/stdlib/stdlib*.cmti; do \ + odoc compile $(INCLUDES) --package stdlib $(ROOTDIR)/stdlib/$$fn; \ done for lib in str bigarray; do \ - odoc compile $(INCLUDES) --package $$lib ../otherlibs/$$lib/$$lib.cmti; \ + odoc compile $(INCLUDES) --package $$lib $(ROOTDIR)/otherlibs/$$lib/$$lib.cmti; \ done - odoc compile $(INCLUDES) --package unix ../otherlibs/$(UNIXLIB)/unix.cmti - for fn in ../parsing/*.cmti; do \ - odoc compile $(INCLUDES) --package parsing ../parsing/$$fn; \ + odoc compile $(INCLUDES) --package unix $(ROOTDIR)/otherlibs/$(UNIXLIB)/unix.cmti + for fn in $(ROOTDIR)/parsing/*.cmti; do \ + odoc compile $(INCLUDES) --package parsing $(ROOTDIR)/parsing/$$fn; \ done # .odoc --> .html - odoc html $(INCLUDES) --output-dir odoc ../stdlib/stdlib.odoc + odoc html $(INCLUDES) --output-dir odoc $(ROOTDIR)/stdlib/stdlib.odoc for lib in str bigarray $(UNIXLIB); do \ - odoc html $(INCLUDES) --output-dir odoc ../otherlibs/$$lib/$$lib.odoc; \ + odoc html $(INCLUDES) --output-dir odoc $(ROOTDIR)/otherlibs/$$lib/$$lib.odoc; \ done - for fn in ../parsing/*.odoc; do \ + for fn in $(ROOTDIR)/parsing/*.odoc; do \ odoc html $(INCLUDES) --output-dir odoc $$fn; \ done for d in odoc/*; do \ |