How to check in a Makefile that the compiler supports bin-annot?

I’d like to use the option in case it is supported.
Thanks!

Something like this?

OPTS += $(shell ocamlc --help | grep -q bin-annot && echo "-bin-annot")

all:
	echo "OPTS=$(OPTS)"

1 Like