]> matita.cs.unibo.it Git - helm.git/blob - DEVEL/lablgtkmathview/Makefile.in
- Disambiguation error exception enriched with more information
[helm.git] / DEVEL / lablgtkmathview / Makefile.in
1 PACKAGE = @PACKAGE@
2 VERSION = @VERSION@
3 INCLUDEDIR = @OCAML_INCLUDE_DIR@
4 PROPCC = @OCAML_LIB_DIR@/lablgtk2/propcc
5 NATIVE = @HAVE_OCAMLOPT@
6 PREFIX = 
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
11 NULL =
12 INST =  \
13         META                    \
14         gMathView.mli           \
15         gMathView.cmi           \
16         gtkMathView.cmi         \
17         gtk_mathview.cmi        \
18         gtkMathViewProps.cmi    \
19         ogtkMathViewProps.cmi   \
20         gMathViewAux.cmi        \
21         gMathViewAux.mli        \
22         $(NULL)
23 DIST_FILES = \
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
31 PREDICATES =
32 SHARED_LIBS = @GDOME_LIBS@ @GTKMATHVIEW_LIBS@
33
34 OCAMLFIND = ocamlfind
35 OCAMLC = $(OCAMLFIND) ocamlc
36 OCAMLOPT = $(OCAMLFIND) ocamlopt
37 OCAMLDEP = ocamldep
38 OCAMLMKLIB = ocamlmklib
39 OCAML_STUB_DIR = @OCAML_STUB_DIR@
40
41 ARCHIVE = $(PACKAGE)
42 DLL = dll$(ARCHIVE).so
43
44 TESTDIR = ./test
45 TMPDIR = .test
46 TMPPKGDIR = $(TMPDIR)/$(PACKAGE)
47
48 ifeq ($(NATIVE),yes)
49 world: all opt
50 else
51 world: all
52 endif
53
54 all: $(ARCHIVE).cma lib$(ARCHIVE).a $(DLL)
55 opt: $(ARCHIVE).cmxa $(ARCHIVE).a
56 test: $(TESTDIR)/test
57 test.opt: $(TESTDIR)/test.opt
58
59 dist:
60         rm -rf $(DIST_DIR)/
61         mkdir $(DIST_DIR)/
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)/
65         rm -rf $(DIST_DIR)/
66
67 deb: dist
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)
71         rm -rf $(DIST_DIR)
72
73 $(GENERATED_FILES): gtkMathView.props
74
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` $<
77
78 .SUFFIXES: .cmo .cmi .cmx .ml .mli
79
80 .ml.cmo:
81         $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
82 .mli.cmi:
83         $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
84 .ml.cmx:
85         $(OCAMLOPT) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
86
87 %Props.ml o%Props.ml: %.props $(PROPCC)
88         $(PROPCC) $<
89
90 depend: *.ml *.mli $(GENERATED_FILES)
91         $(OCAMLDEP) *.ml *.mli >.depend
92 include .depend
93
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)
100
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
105         rm -r $(TMPDIR)
106
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
111         rm -r $(TMPDIR)
112
113 install:
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;                                 \
119         else                                                                    \
120                 mkdir -p $(PREFIX);                                             \
121                 $(OCAMLFIND) install -ldconf /def/null -destdir $(PREFIX)       \
122                         $(PACKAGE) $(ARCHIVE).cma lib$(ARCHIVE).a               \
123                         $(DLL) $(INST) $$extra;                                 \
124         fi
125
126 uninstall:
127         if [ "$(PREFIX)" = "" ]; then \
128                 ocamlfind remove $(PACKAGE); \
129         else \
130                 ocamlfind remove -destdir $(PREFIX) $(PACKAGE); \
131         fi
132
133 clean:
134         rm -f *.[ao] *.cm[iaxo] *.cmxa *.so $(GENERATED_FILES)
135         cd $(TESTDIR) ; make clean
136         rm -rf $(TMPDIR)
137
138 distclean: clean
139         rm -f config.log config.cache config.status Makefile META
140         cd $(TESTDIR) ; make distclean