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
17 gtkMathViewProps.cmi \
18 ogtkMathViewProps.cmi \
23 Makefile.in configure.in gMathView.ml gMathView.mli \
24 gMathViewAux.ml gMathViewAux.mli gtkMathView.ml \
25 gtk_mathview.ml ml_gtk_mathview.c META.in .depend debian/ test/ \
26 configure gtkMathView.props
27 DIST_DIR = $(PACKAGE)-$(VERSION)
28 DOC_FILES = AUTHORS COPYING ChangeLog NEWS README LICENSE
29 REQUIRES = gdome2 lablgtk2
31 SHARED_LIBS = @GDOME_LIBS@ @GTKMATHVIEW_LIBS@
34 OCAMLC = $(OCAMLFIND) ocamlc
35 OCAMLOPT = $(OCAMLFIND) ocamlopt
37 OCAMLMKLIB = ocamlmklib
38 OCAML_STUB_DIR = @OCAML_STUB_DIR@
41 DLL = dll$(ARCHIVE).so
45 TMPPKGDIR = $(TMPDIR)/$(PACKAGE)
47 all: $(ARCHIVE).cma lib$(ARCHIVE).a $(DLL)
48 opt: $(ARCHIVE).cmxa $(ARCHIVE).a
50 test.opt: $(TESTDIR)/test.opt
56 cp -a $(DIST_FILES) $(DOC_FILES) $(DIST_DIR)/
57 -find $(DIST_DIR) -name CVS -type d -exec rm -rf {} \;
58 -find $(DIST_DIR) -name .cvsignore -type f -exec rm {} \;
59 tar cvfz $(DIST_DIR).tar.gz $(DIST_DIR)/
63 if [ -d $(DIST_DIR)/ ]; then rm -rf $(DIST_DIR); else true; fi
64 tar xvzf $(DIST_DIR).tar.gz
65 (cd $(DIST_DIR)/ && debuild)
68 $(GENERATED_FILES): gtkMathView.props
70 ml_gtk_mathview.o: ml_gtk_mathview.c
71 gcc -c -I$(INCLUDEDIR) -fPIC `ocamlfind query -i-format lablgtk2` @GTKMATHVIEW_CFLAGS@ @GDOME_CFLAGS@ `ocamlfind query -i-format gdome2` $<
73 .SUFFIXES: .cmo .cmi .cmx .ml .mli
76 $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
78 $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
80 $(OCAMLOPT) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
82 %Props.ml o%Props.ml: %.props $(PROPCC)
85 depend: *.ml *.mli $(GENERATED_FILES)
86 $(OCAMLDEP) *.ml *.mli >.depend
89 $(ARCHIVE).cma: $(OBJECTS)
90 $(OCAMLMKLIB) -o $(ARCHIVE) $^ $(SHARED_LIBS)
91 $(ARCHIVE).cmxa: $(OBJECTS_OPT)
92 $(OCAMLMKLIB) -o $(ARCHIVE) $^ $(SHARED_LIBS)
93 lib$(ARCHIVE).a $(DLL): $(OBJECTS_C)
94 $(OCAMLMKLIB) -o $(ARCHIVE) $^ $(SHARED_LIBS)
96 $(TESTDIR)/test: $(OBJECTS_C) $(ARCHIVE).cma $(TESTDIR)/test.ml
98 cp $(OBJECTS_C) $(DLL) $(ARCHIVE).cma $(INST) $(TMPPKGDIR)
99 cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make
102 $(TESTDIR)/test.opt: $(OBJECTS_C) $(ARCHIVE).a $(ARCHIVE).cmxa $(TESTDIR)/test.ml
103 mkdir -p $(TMPPKGDIR)
104 cp $(OBJECTS_C) $(ARCHIVE).a $(ARCHIVE).cmxa $(INST) $(TMPPKGDIR)
105 cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make opt
109 test ! -f $(ARCHIVE).cmxa || extra="$(ARCHIVE).a $(ARCHIVE).cmxa" ; \
110 if [ "$(PREFIX)" = "" ]; then \
111 $(OCAMLFIND) install \
112 $(PACKAGE) $(ARCHIVE).cma lib$(ARCHIVE).a \
113 $(DLL) $(INST) $$extra; \
115 $(OCAMLFIND) install -ldconf /def/null -destdir $(PREFIX) \
116 $(PACKAGE) $(ARCHIVE).cma lib$(ARCHIVE).a \
117 $(DLL) $(INST) $$extra; \
121 if [ "$(PREFIX)" = "" ]; then \
122 ocamlfind remove $(PACKAGE); \
124 ocamlfind remove -destdir $(PREFIX) $(PACKAGE); \
128 rm -f *.[ao] *.cm[iaxo] *.cmxa *.so $(GENERATED_FILES)
129 cd $(TESTDIR) ; make clean
133 rm -f config.log config.cache config.status Makefile META
134 cd $(TESTDIR) ; make distclean