Commit e10ffbbd authored by Yann REGIS-GIANAS's avatar Yann REGIS-GIANAS Committed by POTTIER Francois

Make MenhirLib and MenhirSdk both install their .cmxs files.

parent d7886203
...@@ -168,7 +168,7 @@ all: ...@@ -168,7 +168,7 @@ all:
MENHIRLIB := menhirLib.mli menhirLib.ml menhirLib.cmi menhirLib.cmo MENHIRLIB := menhirLib.mli menhirLib.ml menhirLib.cmi menhirLib.cmo
ifneq ($(TARGET),byte) ifneq ($(TARGET),byte)
MENHIRLIB := $(MENHIRLIB) menhirLib.cmx menhirLib.$(OBJ) MENHIRLIB := $(MENHIRLIB) menhirLib.cmx menhirLib.cmxs menhirLib.$(OBJ)
endif endif
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
...@@ -177,7 +177,7 @@ endif ...@@ -177,7 +177,7 @@ endif
MENHIRSDK := menhirSdk.cmi menhirSdk.cmo MENHIRSDK := menhirSdk.cmi menhirSdk.cmo
ifneq ($(TARGET),byte) ifneq ($(TARGET),byte)
MENHIRSDK := $(MENHIRSDK) menhirSdk.cmx menhirSdk.$(OBJ) MENHIRSDK := $(MENHIRSDK) menhirSdk.cmx menhirSdk.cmxs menhirSdk.$(OBJ)
endif endif
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
......
...@@ -28,7 +28,7 @@ cp -f $SRC/menhirLib.META $SRC/META ...@@ -28,7 +28,7 @@ cp -f $SRC/menhirLib.META $SRC/META
trap "{ rm -f $SRC/META ; }" EXIT trap "{ rm -f $SRC/META ; }" EXIT
if ! ocamlfind install menhirLib \ if ! ocamlfind install menhirLib \
$SRC/META $BUILD/menhirLib.cmi $BUILD/menhirLib.cmo \ $SRC/META $BUILD/menhirLib.cmi $BUILD/menhirLib.cmo \
$BUILD/menhirLib.cmx $BUILD/menhirLib.o ; then $BUILD/menhirLib.cmx $BUILD/menhirLib.cmxs $BUILD/menhirLib.o ; then
echo "Could not install MenhirLib. Stop." echo "Could not install MenhirLib. Stop."
exit 1 exit 1
fi fi
...@@ -36,7 +36,7 @@ echo "Installing new MenhirSdk..." ...@@ -36,7 +36,7 @@ echo "Installing new MenhirSdk..."
cp -f $SRC/menhirSdk.META $SRC/META cp -f $SRC/menhirSdk.META $SRC/META
if ! ocamlfind install menhirSdk \ if ! ocamlfind install menhirSdk \
$SRC/META $SDKDIR/menhirSdk.cmi $SDKDIR/menhirSdk.cmo \ $SRC/META $SDKDIR/menhirSdk.cmi $SDKDIR/menhirSdk.cmo \
$SDKDIR/menhirSdk.cmx $SDKDIR/menhirSdk.o; then $SDKDIR/menhirSdk.cmx $SDKDIR/menhirSdk.cmxs $SDKDIR/menhirSdk.o; then
echo "Could not install MenhirSdk. Stop." echo "Could not install MenhirSdk. Stop."
exit 1 exit 1
fi fi
.PHONY: everyday bootstrap stage1 stage2 stage3 sdk clean
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Choose a target. # Choose a target.
...@@ -51,10 +51,15 @@ SRC := .. ...@@ -51,10 +51,15 @@ SRC := ..
FLAGS := -v -lg 1 -la 1 -lc 1 --table --infer --stdlib $(SRC) --strict --fixed-exception --canonical FLAGS := -v -lg 1 -la 1 -lc 1 --table --infer --stdlib $(SRC) --strict --fixed-exception --canonical
# Build .cmxs in case of native compilation.
ifneq ($(TARGET),byte)
MENHIRLIBCMXS := menhirLib.cmxs
endif
stage2: stage2:
@ $(OCAMLBUILD) -build-dir _stage2 -tag fancy_parser \ @ $(OCAMLBUILD) -build-dir _stage2 -tag fancy_parser \
-use-menhir -menhir "$(SRC)/_stage1/menhir.$(TARGET) $(FLAGS)" \ -use-menhir -menhir "$(SRC)/_stage1/menhir.$(TARGET) $(FLAGS)" \
menhir.$(TARGET) $(MENHIRLIBCMXS) menhir.$(TARGET)
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Stage 3 (optional). # Stage 3 (optional).
...@@ -77,7 +82,7 @@ stage3: ...@@ -77,7 +82,7 @@ stage3:
MENHIRSDK := menhirSdk.cmo MENHIRSDK := menhirSdk.cmo
ifneq ($(TARGET),byte) ifneq ($(TARGET),byte)
MENHIRSDK := $(MENHIRSDK) menhirSdk.cmx MENHIRSDK := $(MENHIRSDK) menhirSdk.cmx menhirSdk.cmxs
endif endif
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
......
...@@ -2,3 +2,4 @@ requires = "" ...@@ -2,3 +2,4 @@ requires = ""
description = "Runtime support for code generated by Menhir" description = "Runtime support for code generated by Menhir"
archive(byte) = "menhirLib.cmo" archive(byte) = "menhirLib.cmo"
archive(native) = "menhirLib.cmx" archive(native) = "menhirLib.cmx"
plugin(native) = "menhirLib.cmxs"
...@@ -2,3 +2,4 @@ requires = "" ...@@ -2,3 +2,4 @@ requires = ""
description = "Toolkit for postprocessing Menhir automata (.cmly files)" description = "Toolkit for postprocessing Menhir automata (.cmly files)"
archive(byte) = "menhirSdk.cmo" archive(byte) = "menhirSdk.cmo"
archive(native) = "menhirSdk.cmx" archive(native) = "menhirSdk.cmx"
plugin(native) = "menhirSdk.cmxs"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment