-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.rules
More file actions
37 lines (26 loc) · 891 Bytes
/
Makefile.rules
File metadata and controls
37 lines (26 loc) · 891 Bytes
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
# Common targets
.install:
# also $(MODULE).cma (bytecode)
cp *.cmi *.cmx $(MODULE).cmxa $(MODULE).a $(LIBDIR)
.clean:
rm -f *.ml* *.a *.o *.cxx *.c *.cm*
# Production rules
# All productions from SWIG interfaces
%.ml %.mli %_wrap.cxx: %.i
$(SWIG) $(SWIG_FLAGS) $(SWIG_DEFINES) $(INCLUDES:%=-I%) -o $(<:.i=_wrap.cxx) $<
# SWIG C++ suffix fix
%.cxx.c : %.cxx
cp $< $@
# Compile C++ sources
%.o : %.c
$(OCAMLOPT) -ccopt "-shared -w $(INCLUDES:%=-I%) -DNX_CALL_CONV=\"\" -DNX32 -DLINUX \"-DNX_C_EXPORT=extern \\\"C\\\"\" -DNXP_DLL_EXPORT=\"\" -DNXF_DLL_EXPORT=\"\" -xc++ -fPIC" -c -o $@ $<
# Native OCaml compilation
%.cmi: %.mli
$(OCAMLOPT) $(INCLUDES:%=-I %) -for-pack $(MODULE) -c -o $@ $<
%.cmx: %.ml
$(OCAMLOPT) $(INCLUDES:%=-I %) -for-pack $(MODULE) -c -o $@ $<
# OCaml bytecode compilation
%.cmo: %.ml
$(OCAMLC) -o $@ $<
.PRECIOUS: %.ml %.mli
.PHONY: .clean .install