blob: c576a0990934e6c84fccf971678adb06d08b24f9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
#########################################################################
# #
# 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
.PHONY: default
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
.PHONY: all
all: prepare bytecode bytecode-dll native native-dll
.PHONY: prepare
prepare:
@$(OCAMLC) -c plugin.ml
@$(OCAMLOPT) -o plugin.cmxs -shared plugin.ml
.PHONY: bytecode
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
.PHONY: bytecode-dll
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
.PHONY: native
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
.PHONY: native-dll
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
.PHONY: promote
promote: defaultpromote
.PHONY: clean
clean: defaultclean
@rm -f *.result *.exe *.dll *.so *.obj *.o
include $(BASEDIR)/makefiles/Makefile.common
|