3 INCLUDEDIR = @OCAML_INCLUDE_DIR@
4 PROPCC = @OCAML_LIB_DIR@/lablgtk2/propcc
5 NATIVE = @HAVE_OCAMLOPT@
7 OBJECTS_C = ml_gtk_mathview.o
8 OBJECTS = gtkMathViewProps.cmo ogtkMathViewProps.cmo gtk_mathview.cmo gtkMathView.cmo gMathView.cmo gMathViewAux.cmo
9 OBJECTS_OPT = gtkMathViewProps.cmx ogtkMathViewProps.cmx gtkMathView.cmx gtk_mathview.cmx gMathView.cmx gMathViewAux.cmx
10 GENERATED_FILES = gtkMathViewProps.ml ogtkMathViewProps.ml
18 gtkMathViewProps.cmi \
19 ogtkMathViewProps.cmi \
24 Makefile.in configure.in gMathView.ml gMathView.mli \
25 gMathViewAux.ml gMathViewAux.mli gtkMathView.ml \
26 gtk_mathview.ml ml_gtk_mathview.c META.in .depend debian/ test/ \
27 configure gtkMathView.props
28 DIST_DIR = $(PACKAGE)-$(VERSION)
29 DOC_FILES = AUTHORS COPYING ChangeLog NEWS README LICENSE
30 REQUIRES = gdome2 lablgtk2
32 SHARED_LIBS = @GDOME_LIBS@ @GTKMATHVIEW_LIBS@
35 OCAMLC = $(OCAMLFIND) ocamlc
36 OCAMLOPT = $(OCAMLFIND) ocamlopt
38 OCAMLMKLIB = ocamlmklib
39 OCAML_STUB_DIR = @OCAML_STUB_DIR@
42 DLL = dll$(ARCHIVE).so
46 TMPPKGDIR = $(TMPDIR)/$(PACKAGE)
54 all: $(ARCHIVE).cma lib$(ARCHIVE).a $(DLL)
55 opt: $(ARCHIVE).cmxa $(ARCHIVE).a
57 test.opt: $(TESTDIR)/test.opt
62 cp -a $(DIST_FILES) $(DOC_FILES) $(DIST_DIR)/
63 -find $(DIST_DIR) -name .svn -type d -exec rm -rf {} \;
64 tar cvfz $(DIST_DIR).tar.gz $(DIST_DIR)/
68 if [ -d $(DIST_DIR)/ ]; then rm -rf $(DIST_DIR); else true; fi
69 tar xvzf $(DIST_DIR).tar.gz
70 (cd $(DIST_DIR)/ && debuild)
73 $(GENERATED_FILES): gtkMathView.props
75 ml_gtk_mathview.o: ml_gtk_mathview.c
76 gcc -c -I$(INCLUDEDIR) -fPIC `ocamlfind query -i-format lablgtk2` @GTKMATHVIEW_CFLAGS@ @GDOME_CFLAGS@ `ocamlfind query -i-format gdome2` $<
78 .SUFFIXES: .cmo .cmi .cmx .ml .mli
81 $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
83 $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
85 $(OCAMLOPT) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
87 %Props.ml o%Props.ml: %.props $(PROPCC)
90 depend: *.ml *.mli $(GENERATED_FILES)
91 $(OCAMLDEP) *.ml *.mli >.depend
94 $(ARCHIVE).cma: $(OBJECTS)
95 $(OCAMLMKLIB) -o $(ARCHIVE) $^ $(SHARED_LIBS)
96 $(ARCHIVE).cmxa: $(OBJECTS_OPT)
97 $(OCAMLMKLIB) -o $(ARCHIVE) $^ $(SHARED_LIBS)
98 lib$(ARCHIVE).a $(DLL): $(OBJECTS_C)
99 $(OCAMLMKLIB) -o $(ARCHIVE) $^ $(SHARED_LIBS)
101 $(TESTDIR)/test: $(OBJECTS_C) $(ARCHIVE).cma $(TESTDIR)/test.ml
102 mkdir -p $(TMPPKGDIR)
103 cp $(OBJECTS_C) $(DLL) $(ARCHIVE).cma $(INST) $(TMPPKGDIR)
104 cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make
107 $(TESTDIR)/test.opt: $(OBJECTS_C) $(ARCHIVE).a $(ARCHIVE).cmxa $(TESTDIR)/test.ml
108 mkdir -p $(TMPPKGDIR)
109 cp $(OBJECTS_C) $(ARCHIVE).a $(ARCHIVE).cmxa $(INST) $(TMPPKGDIR)
110 cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make opt
114 test ! -f $(ARCHIVE).cmxa || extra="$(ARCHIVE).a $(ARCHIVE).cmxa" ; \
115 if [ "$(PREFIX)" = "" ]; then \
116 $(OCAMLFIND) install \
117 $(PACKAGE) $(ARCHIVE).cma lib$(ARCHIVE).a \
118 $(DLL) $(INST) $$extra; \
120 mkdir -p $(PREFIX); \
121 $(OCAMLFIND) install -ldconf /def/null -destdir $(PREFIX) \
122 $(PACKAGE) $(ARCHIVE).cma lib$(ARCHIVE).a \
123 $(DLL) $(INST) $$extra; \
127 if [ "$(PREFIX)" = "" ]; then \
128 ocamlfind remove $(PACKAGE); \
130 ocamlfind remove -destdir $(PREFIX) $(PACKAGE); \
134 rm -f *.[ao] *.cm[iaxo] *.cmxa *.so $(GENERATED_FILES)
135 cd $(TESTDIR) ; make clean
139 rm -f config.log config.cache config.status Makefile META
140 cd $(TESTDIR) ; make distclean