3 INCLUDEDIR = @OCAML_INCLUDE_DIR@
4 PROPCC = @OCAML_LIB_DIR@/lablgtk2/propcc
6 OBJECTS_C = ml_gtk_mathview.o
7 OBJECTS = gtkMathViewProps.cmo ogtkMathViewProps.cmo gtk_mathview.cmo gtkMathView.cmo gMathView.cmo gMathViewAux.cmo
8 OBJECTS_OPT = gtkMathViewProps.cmx ogtkMathViewProps.cmx gtkMathView.cmx gtk_mathview.cmx gMathView.cmx gMathViewAux.cmx
9 GENERATED_FILES = gtkMathViewProps.ml ogtkMathViewProps.ml
11 META gMathView.mli gMathView.cmi gtkMathView.cmi gtk_mathview.cmi \
12 gtkMathViewProps.cmi ogtkMathViewProps.cmi \
13 gMathViewAux.cmi gMathViewAux.mli
15 Makefile.in configure.in gMathView.ml gMathView.mli \
16 gMathViewAux.ml gMathViewAux.mli gtkMathView.ml \
17 gtk_mathview.ml ml_gtk_mathview.c META.in .depend debian/ test/ \
18 configure gtkMathView.props
19 DIST_DIR = $(PACKAGE)-$(VERSION)
20 DOC_FILES = AUTHORS COPYING ChangeLog NEWS README LICENSE
21 REQUIRES = gdome2 lablgtk2
23 SHARED_LIBS = @GDOME_LIBS@ @GTKMATHVIEW_LIBS@ -lmlgdome
26 OCAMLC = $(OCAMLFIND) ocamlc
27 OCAMLOPT = $(OCAMLFIND) ocamlopt
29 OCAMLMKLIB = ocamlmklib
30 OCAML_STUB_DIR = @OCAML_STUB_DIR@
33 DLL = dll$(ARCHIVE).so
37 TMPPKGDIR = $(TMPDIR)/$(PACKAGE)
42 test.opt: $(TESTDIR)/test.opt
48 cp -a $(DIST_FILES) $(DOC_FILES) $(DIST_DIR)/
49 -find $(DIST_DIR) -name CVS -type d -exec rm -rf {} \;
50 -find $(DIST_DIR) -name .cvsignore -type f -exec rm {} \;
51 tar cvfz $(DIST_DIR).tar.gz $(DIST_DIR)/
55 if [ -d $(DIST_DIR)/ ]; then rm -rf $(DIST_DIR); else true; fi
56 tar xvzf $(DIST_DIR).tar.gz
57 (cd $(DIST_DIR)/ && debuild)
60 $(GENERATED_FILES): gtkMathView.props
62 ml_gtk_mathview.o: ml_gtk_mathview.c
63 gcc -c -I$(INCLUDEDIR) -fPIC `ocamlfind query -i-format lablgtk2` @GTKMATHVIEW_CFLAGS@ @GDOME_CFLAGS@ `ocamlfind query -i-format gdome2` $<
65 .SUFFIXES: .cmo .cmi .cmx .ml .mli
68 $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
70 $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
72 $(OCAMLOPT) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
74 %Props.ml o%Props.ml: %.props $(PROPCC)
77 depend: *.ml *.mli $(GENERATED_FILES)
78 $(OCAMLDEP) *.ml *.mli >.depend
81 $(ARCHIVE).cma $(DLL): $(OBJECTS) $(OBJECTS_C)
82 $(OCAMLMKLIB) -o $(ARCHIVE) -L$(OCAML_STUB_DIR) $^ $(SHARED_LIBS)
83 $(ARCHIVE).cmxa $(ARCHIVE).a: $(OBJECTS_OPT)
84 $(OCAMLMKLIB) -o $(ARCHIVE) -L$(OCAML_STUB_DIR) $^ $(OBJECTS_C) $(SHARED_LIBS)
86 $(TESTDIR)/test: $(OBJECTS_C) $(ARCHIVE).cma $(TESTDIR)/test.ml
88 cp $(OBJECTS_C) $(DLL) $(ARCHIVE).cma $(INST) $(TMPPKGDIR)
89 cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make
92 $(TESTDIR)/test.opt: $(OBJECTS_C) $(ARCHIVE).a $(ARCHIVE).cmxa $(TESTDIR)/test.ml
94 cp $(OBJECTS_C) $(ARCHIVE).a $(ARCHIVE).cmxa $(INST) $(TMPPKGDIR)
95 cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make opt
99 test ! -f $(ARCHIVE).cmxa || extra="$(ARCHIVE).a $(ARCHIVE).cmxa" ; \
100 if [ "$(PREFIX)" = "" ]; then \
101 $(OCAMLFIND) install \
102 $(PACKAGE) $(OBJECTS_C) $(ARCHIVE).cma $(DLL) $(INST) $$extra; \
103 ln -fs $(DLL) $(shell $(OCAMLFIND) printconf destdir)/stublibs/lib$(ARCHIVE).so; \
105 $(OCAMLFIND) install -destdir $(PREFIX) \
106 $(PACKAGE) $(OBJECTS_C) $(ARCHIVE).cma $(DLL) $(INST) $$extra; \
107 ln -fs $(DLL) $(PREFIX)/stublibs/lib$(ARCHIVE).so; \
111 if [ "$(PREFIX)" = "" ]; then \
112 ocamlfind remove $(PACKAGE); \
114 ocamlfind remove -destdir $(PREFIX) $(PACKAGE); \
118 rm -f *.[ao] *.cm[iaxo] *.cmxa *.so $(GENERATED_FILES)
119 cd $(TESTDIR) ; make clean
123 rm -f config.log config.cache config.status Makefile META
124 cd $(TESTDIR) ; make distclean