Autoconfify.
[ocaml-bitstring.git] / Makefile.in
1 # $Id: Makefile.in,v 1.1 2008-04-02 07:20:26 rjones Exp $
2
3 PACKAGE = ocaml-bitmatch
4 VERSION = 0.1
5
6 OCAMLFIND = ocamlfind
7 OCAMLMKLIB = ocamlmklib
8
9 OCAMLCFLAGS = -g
10 OCAMLCPACKAGES =
11 OCAMLOPTFLAGS =
12 OCAMLOPTPACKAGES =
13
14 EXAMPLES := $(wildcard examples/*.ml)
15
16 TESTS   := $(patsubst %.ml,%,$(wildcard tests/*.ml))
17
18 all:    pa_bitmatch.cmo bitmatch.cma bitmatch.cmxa
19
20 pa_bitmatch.cmo: pa_bitmatch.ml
21         ocamlfind ocamlc -I +camlp4 camlp4lib.cma -pp camlp4of.opt -c $< -o $@
22
23 bitmatch.cma: bitmatch.cmo
24         $(OCAMLFIND) ocamlc -a -o $@ $^
25
26 bitmatch.cmxa: bitmatch.cmx
27         $(OCAMLFIND) ocamlopt -a -o $@ $^
28
29 test: pa_bitmatch.cmo bitmatch.cma
30         @for f in $(TESTS); do \
31           echo Test: $$f; \
32           $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -pp "camlp4o pa_bitmatch.cmo" \
33             -I . bitmatch.cma $$f.ml -o $$f; \
34           if [ $$? -ne 0 ]; then exit 1; fi; \
35           $$f; \
36           if [ $$? -ne 0 ]; then exit 1; fi; \
37         done
38
39 print-tests: pa_bitmatch.cmo
40         @for f in $(TESTS); do \
41           echo Test: $$f.ml; \
42           cmd="camlp4o pa_bitmatch.cmo -printer pr_o.cmo $$f.ml"; \
43           echo $$cmd; \
44           $$cmd; \
45         done
46
47 print-examples: pa_bitmatch.cmo
48         @for f in $(EXAMPLES); do \
49           echo Example: $$f; \
50           camlp4o pa_bitmatch.cmo -printer pr_o.cmo $$f; \
51         done
52
53 .mli.cmi:
54         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
55 .ml.cmo:
56         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
57 .ml.cmx:
58         $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) -c $<
59
60 depend: .depend
61
62 .depend: bitmatch.ml bitmatch.mli
63         rm -f .depend
64         $(OCAMLFIND) ocamldep $(OCAMLCPACKAGES) $^ > $@
65
66 ifeq ($(wildcard .depend),.depend)
67 include .depend
68 endif
69
70 # Distribution.
71
72 dist:
73         $(MAKE) check-manifest
74         rm -rf $(PACKAGE)-$(VERSION)
75         mkdir $(PACKAGE)-$(VERSION)
76         tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
77         $(INSTALL) -m 0755 configure $(PACKAGE)-$(VERSION)/
78         tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
79         rm -rf $(PACKAGE)-$(VERSION)
80         ls -l $(PACKAGE)-$(VERSION).tar.gz
81
82 check-manifest:
83         @for d in `find -type d -name CVS`; do \
84         b=`dirname $$d`/; \
85         awk -F/ '$$1 != "D" {print $$2}' $$d/Entries | \
86         sed -e "s|^|$$b|" -e "s|^\./||"; \
87         done | sort > .check-manifest; \
88         sort MANIFEST > .orig-manifest; \
89         diff -u .orig-manifest .check-manifest; rv=$$?; \
90         rm -f .orig-manifest .check-manifest; \
91         exit $$rv
92
93 .PHONY: depend dist check-manifest dpkg doc print-examples print-tests test
94
95 .SUFFIXES:      .cmo .cmi .cmx .ml .mli .mll