3 camloptfeature = $(if $(shell $(CAMLOPT) -h 2>&1 | grep -w -- $(1)),$(1))
4 COMPFLAGS = -g $(if $(VERBOSE),,-verbose) -warn-error A \
5 -nostdlib -output-obj \
6 $(call camloptfeature,-nodynlink)
8 # the link is done because ocamlopt creates *.cmi and *.cmx in the source dir!
9 %.o: $(SRC_DIR)/%.ml #libasmrun.a
10 @echo -e " ... Compiling Ocaml $@"
11 $(VERBOSE)$(RM) $(notdir $<)
12 $(VERBOSE)$(LN) -sf $(SRC_DIR)/$(notdir $<)
13 $(VERBOSE)$(CAMLOPT) $(COMPFLAGS) -I $(OCAML_INCDIR) -o $@.tmp.o $(notdir $<)
14 $(VERBOSE)$(LD) -m $(LD_EMULATION) -r -N -nostdlib -o $@ $@.tmp.o -L $(OCAML_LIBDIR) -locaml_asmrun
16 # some versions of ocamlopt (e.g. 3.10.2) want to have a libasmrun.a
17 # although we specify -nostdlib...