]> matita.cs.unibo.it Git - helm.git/blob - helm/software/DEVEL/lablgtkmathview/Makefile.in
added config.ac to the tarball for debian packages
[helm.git] / helm / software / 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 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         ln -fs $(DIST_DIR).tar.gz $(PACKAGE)_$(VERSION).orig.tar.gz
71         svn export debian $(DIST_DIR)/debian
72         (cd $(DIST_DIR)/ && debuild)
73         rm -rf $(DIST_DIR)
74
75 $(GENERATED_FILES): gtkMathView.props
76
77 ml_gtk_mathview.o: ml_gtk_mathview.c
78         gcc -c -I$(INCLUDEDIR) -fPIC `ocamlfind query -i-format lablgtk2` @GTKMATHVIEW_CFLAGS@ @GDOME_CFLAGS@ `ocamlfind query -i-format gdome2` $<
79
80 .SUFFIXES: .cmo .cmi .cmx .ml .mli
81
82 .ml.cmo:
83         $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
84 .mli.cmi:
85         $(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
86 .ml.cmx:
87         $(OCAMLOPT) -package "$(REQUIRES)" -predicates "$(PREDICATES)" -c $<
88
89 %Props.ml o%Props.ml: %.props $(PROPCC)
90         $(PROPCC) $<
91
92 depend: *.ml *.mli $(GENERATED_FILES)
93         $(OCAMLDEP) *.ml *.mli >.depend
94 include .depend
95
96 $(ARCHIVE).cma: $(OBJECTS)
97         $(OCAMLMKLIB) -o $(ARCHIVE) $^ $(SHARED_LIBS)
98 $(ARCHIVE).cmxa: $(OBJECTS_OPT)
99         $(OCAMLMKLIB) -o $(ARCHIVE) $^ $(SHARED_LIBS)
100 lib$(ARCHIVE).a $(DLL): $(OBJECTS_C)
101         $(OCAMLMKLIB) -o $(ARCHIVE) $^ $(SHARED_LIBS)
102
103 $(TESTDIR)/test: $(OBJECTS_C) $(ARCHIVE).cma $(TESTDIR)/test.ml
104         mkdir -p $(TMPPKGDIR)
105         cp $(OBJECTS_C) $(DLL) $(ARCHIVE).cma $(INST) $(TMPPKGDIR)
106         cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make
107         rm -r $(TMPDIR)
108
109 $(TESTDIR)/test.opt: $(OBJECTS_C) $(ARCHIVE).a $(ARCHIVE).cmxa $(TESTDIR)/test.ml
110         mkdir -p $(TMPPKGDIR)
111         cp $(OBJECTS_C) $(ARCHIVE).a $(ARCHIVE).cmxa $(INST) $(TMPPKGDIR)
112         cd $(TESTDIR) ; export OCAMLPATH=../$(TMPDIR):$$OCAMLPATH ; make opt
113         rm -r $(TMPDIR)
114
115 install:
116         test ! -f $(ARCHIVE).cmxa || extra="$(ARCHIVE).a $(ARCHIVE).cmxa" ;     \
117         if [ "$(PREFIX)" = "" ]; then                                           \
118                 $(OCAMLFIND) install                                            \
119                         $(PACKAGE) $(ARCHIVE).cma lib$(ARCHIVE).a               \
120                         $(DLL) $(INST) $$extra;                                 \
121         else                                                                    \
122                 mkdir -p $(PREFIX);                                             \
123                 $(OCAMLFIND) install -ldconf /def/null -destdir $(PREFIX)       \
124                         $(PACKAGE) $(ARCHIVE).cma lib$(ARCHIVE).a               \
125                         $(DLL) $(INST) $$extra;                                 \
126         fi
127
128 uninstall:
129         if [ "$(PREFIX)" = "" ]; then \
130                 ocamlfind remove $(PACKAGE); \
131         else \
132                 ocamlfind remove -destdir $(PREFIX) $(PACKAGE); \
133         fi
134
135 clean:
136         rm -f *.[ao] *.cm[iaxo] *.cmxa *.so $(GENERATED_FILES)
137         cd $(TESTDIR) ; make clean
138         rm -rf $(TMPDIR)
139
140 distclean: clean
141         rm -f config.log config.cache config.status Makefile META
142         cd $(TESTDIR) ; make distclean