bs-ajv
Version:
BucklesScript bindings to Ajv (Another JSON Validator)
102 lines (89 loc) • 3.35 kB
Plain Text
#########################################################################
# #
# OCaml #
# #
# Xavier Clerc, SED, INRIA Rocquencourt #
# #
# Copyright 2010 Institut National de Recherche en Informatique et #
# en Automatique. All rights reserved. This file is distributed #
# under the terms of the Q Public License version 1.0. #
# #
#########################################################################
BASEDIR=../..
CSC=csc
COMPFLAGS=-I $(OTOPDIR)/otherlibs/bigarray
LD_PATH=$(TOPDIR)/otherlibs/bigarray
default:
@if ! $(SUPPORTS_SHARED_LIBRARIES); then \
echo 'skipped (shared libraries not available)'; \
elif $(BYTECODE_ONLY); then \
echo 'skipped (native compiler not available)' ; \
else \
$(SET_LD_PATH) $(MAKE) all; \
fi
all: prepare bytecode bytecode-dll native native-dll
prepare:
@$(OCAMLC) -c plugin.ml
@$(OCAMLOPT) -o plugin.cmxs -shared plugin.ml
bytecode:
@printf " ... testing 'bytecode':"
@if [ ! `which $(CSC) >/dev/null 2>&1` ]; then \
echo " => skipped"; \
else \
$(OCAMLC) -output-obj -o main.dll dynlink.cma main.ml entry.c; \
$(CSC) /out:main.exe main.cs; \
./main.exe > bytecode.result; \
$(DIFF) bytecode.reference bytecode.result >/dev/null \
&& echo " => passed" || echo " => failed"; \
fi
bytecode-dll:
@printf " ... testing 'bytecode-dll':"
@if [ ! `which $(CSC) > /dev/null 2>&1` ]; then \
echo " => skipped"; \
else \
$(OCAMLC) -output-obj -o main_obj.$(O) dynlink.cma entry.c main.ml; \
$(MKDLL) -maindll -o main.dll main_obj.$(O) entry.$(O) \
../../byterun/libcamlrun.$(A) $(BYTECCLIBS) -v; \
$(CSC) /out:main.exe main.cs; \
./main.exe >bytecode.result; \
$(DIFF) bytecode.reference bytecode.result >/dev/null \
&& echo " => passed" || echo " => failed"; \
fi
native:
@printf " ... testing 'native':"
@if [ ! `which $(CSC) > /dev/null 2>&1` ]; then \
echo " => skipped"; \
else \
$(OCAMLOPT) -output-obj -o main.dll dynlink.cmxa entry.c main.ml; \
$(CSC) /out:main.exe main.cs; \
./main.exe > native.result; \
$(DIFF) native.reference native.result > /dev/null \
&& echo " => passed" || echo " => failed"; \
fi
native-dll:
@printf " ... testing 'native-dll':"
@if [ ! `which $(CSC) > /dev/null 2>&1` ]; then \
echo " => skipped"; \
else \
$(OCAMLOPT) -output-obj -o main_obj.$(O) dynlink.cmxa entry.c \
main.ml; \
$(MKDLL) -maindll -o main.dll main_obj.$(O) entry.$(O) \
../../asmrun/libasmrun.lib -v; \
$(CSC) /out:main.exe main.cs; \
./main.exe > native.result; \
$(DIFF) native.reference native.result >/dev/null \
&& echo " => passed" || echo " => failed"; \
fi
promote: defaultpromote
clean: defaultclean
@rm -f *.result *.exe *.dll *.so *.obj *.o
include $(BASEDIR)/makefiles/Makefile.common