libwhenjobsdir = $(libdir)/$(PACKAGE_NAME)
libwhenjobs_SCRIPTS = whenlib.cma pa_when.cmo $(CMI_FILES)
+if HAVE_OCAMLOPT
+libwhenjobs_SCRIPTS += whenlib.cmxa
+endif
+
OCAMLPACKAGES = -package unix,num,camlp4.lib,calendar,rpc
OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES)
whentools.cmo \
whenlock.cmo
+XOBJECTS = $(OBJECTS:.cmo=.cmx)
+
# Library.
noinst_LIBRARIES = liblibrary.a
liblibrary_a_SOURCES = flock.c
whenlib.cma: $(OBJECTS) liblibrary.a
$(OCAMLFIND) c -a $(OCAMLCFLAGS) $(OBJECTS) -cclib -llibrary -o $@
+whenlib.cmxa: $(XOBJECTS) liblibrary.a
+ $(OCAMLFIND) opt -a $(OCAMLOPTFLAGS) $(XOBJECTS) -cclib -llibrary -o $@
+
whenproto_aux.ml whenproto_aux.mli: whenproto.x
$(OCAMLRPCGEN) -int int32 -hyper int64 -aux $<