Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- It seems that form like this
- ```
- .PHONY: instrumented-ocamlc
- instrumented-ocamlc:
- $(MAKE) PPX="-ppx ./ppx/printexc_ppx" ocamlc
- ```
- doesn't work at all. It produces an error of wrong `make` argument.
- And if I'm not mistaken, following (and using PPX variable further) works as expected:
- ```
- .PHONY: instrumented.ocamlc
- instrumented.ocamlc: PPX=-ppx ./ppx/printexc_ppx
- instrumented.ocamlc:
- $(MAKE) ocamlc
- ```
- But the full picture of what is happening still does not add up.
- I learned that `.SUFFIXES` produce implicit rules for creating files of source format to target.
- For my situation it means that .cmo files produced from .ml files using
- `$(CAMLC) $(COMPFLAGS) -c $<`
- `CAMLC=$(BOOT_OCAMLC) -g -nostdlib -I boot -use-prims runtime/primitives`
- `BOOT_OCAMLC = $(CAMLRUN) $(ROOTDIR)/boot/ocamlc`
- And ocamlc is created by the
- ```
- ocamlc: compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma $(BYTESTART)
- $(CAMLC) $(LINKFLAGS) -compat-32 -o $@ $^
- ```
- So I guess that I need to place PPX somewhere among these commands.
- When I'm trying this:
- ```
- .ml.cmo:
- $(CAMLC) $(COMPFLAGS) $(PPX) -c $<
- ```
- or that:
- `CAMLC=$(BOOT_OCAMLC) $(PPX) -g -nostdlib -I boot -use-prims runtime/primitives`
- Then call `make world` and `make instrumented.ocamlc`, I'm getting
- ```
- make ocamlc
- make[1]: entering the directory «/home/lereena/ocaml»
- make -C utils config.ml
- make[2]: entering the directory «/home/lereena/ocaml/utils»
- make[2]: «config.ml» does not require updating.
- make[2]: entering the directory «/home/lereena/ocaml/utils»
- make[1]: entering the directory «/home/lereena/ocaml»
- ```
- It seems that it is necessary to inform the project somewhere that it is necessary to recompile ocamlc,
- but it is not very clear where, and whether this is a problem at all.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement