Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. It seems that form like this
  2. ```
  3. .PHONY: instrumented-ocamlc
  4. instrumented-ocamlc:
  5. $(MAKE) PPX="-ppx ./ppx/printexc_ppx" ocamlc
  6. ```
  7. doesn't work at all. It produces an error of wrong `make` argument.
  8. And if I'm not mistaken, following (and using PPX variable further) works as expected:
  9. ```
  10. .PHONY: instrumented.ocamlc
  11. instrumented.ocamlc: PPX=-ppx ./ppx/printexc_ppx
  12. instrumented.ocamlc:
  13. $(MAKE) ocamlc
  14. ```
  15. But the full picture of what is happening still does not add up.
  16.  
  17.  
  18. I learned that `.SUFFIXES` produce implicit rules for creating files of source format to target.
  19. For my situation it means that .cmo files produced from .ml files using
  20. `$(CAMLC) $(COMPFLAGS) -c $<`
  21. `CAMLC=$(BOOT_OCAMLC) -g -nostdlib -I boot -use-prims runtime/primitives`
  22. `BOOT_OCAMLC = $(CAMLRUN) $(ROOTDIR)/boot/ocamlc`
  23.  
  24. And ocamlc is created by the
  25. ```
  26. ocamlc: compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma $(BYTESTART)
  27. $(CAMLC) $(LINKFLAGS) -compat-32 -o $@ $^
  28. ```
  29. So I guess that I need to place PPX somewhere among these commands.
  30.  
  31. When I'm trying this:
  32. ```
  33. .ml.cmo:
  34. $(CAMLC) $(COMPFLAGS) $(PPX) -c $<
  35. ```
  36. or that:
  37. `CAMLC=$(BOOT_OCAMLC) $(PPX) -g -nostdlib -I boot -use-prims runtime/primitives`
  38.  
  39. Then call `make world` and `make instrumented.ocamlc`, I'm getting
  40. ```
  41. make ocamlc
  42. make[1]: entering the directory «/home/lereena/ocaml»
  43. make -C utils config.ml
  44. make[2]: entering the directory «/home/lereena/ocaml/utils»
  45. make[2]: «config.ml» does not require updating.
  46. make[2]: entering the directory «/home/lereena/ocaml/utils»
  47. make[1]: entering the directory «/home/lereena/ocaml»
  48. ```
  49.  
  50. It seems that it is necessary to inform the project somewhere that it is necessary to recompile ocamlc,
  51. 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