1 # Bitmatch syntax extension.
2 # Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 # $Id: Makefile.in,v 1.3 2008-04-02 08:14:40 rjones Exp $
20 PACKAGE = @PACKAGE_NAME@
21 VERSION = @PACKAGE_VERSION@
23 OCAMLFIND = @OCAMLFIND@
24 OCAMLMKLIB = @OCAMLMKLIB@
33 OCAMLDOCFLAGS = -html -sort
35 EXAMPLES = $(wildcard examples/*.ml)
37 TESTS = $(patsubst %.ml,%,$(wildcard tests/*.ml))
39 all: pa_bitmatch.cmo bitmatch.cma bitmatch.cmxa
41 pa_bitmatch.cmo: pa_bitmatch.ml
42 $(OCAMLFIND) ocamlc -I +camlp4 camlp4lib.cma \
43 -pp camlp4of.opt -c $< -o $@
45 bitmatch.cma: bitmatch.cmo
46 $(OCAMLFIND) ocamlc -a -o $@ $^
48 bitmatch.cmxa: bitmatch.cmx
49 $(OCAMLFIND) ocamlopt -a -o $@ $^
53 test: pa_bitmatch.cmo bitmatch.cma
54 @for f in $(TESTS); do \
56 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -pp "camlp4o pa_bitmatch.cmo" \
57 -I . bitmatch.cma $$f.ml -o $$f; \
58 if [ $$? -ne 0 ]; then exit 1; fi; \
60 if [ $$? -ne 0 ]; then exit 1; fi; \
63 print-tests: pa_bitmatch.cmo
64 @for f in $(TESTS); do \
66 cmd="camlp4o pa_bitmatch.cmo -printer pr_o.cmo $$f.ml"; \
71 print-examples: pa_bitmatch.cmo
72 @for f in $(EXAMPLES); do \
74 camlp4o pa_bitmatch.cmo -printer pr_o.cmo $$f; \
75 if [ $$? -ne 0 ]; then exit 1; fi; \
81 rm -f core *~ *.cmi *.cmo *.cmx *.cma *.cmxa *.a *.o
82 rm -f tests/*~ tests/*.cmi tests/*.cmo $(TESTS)
91 $(OCAMLDOC) $(OCAMLDOCFLAGS) -d html bitmatch.mli bitmatch.ml
97 ocamlfind install bitmatch META *.mli *.cmi *.cmx *.cma *.cmxa *.a
102 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
104 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
106 $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) -c $<
110 .depend: bitmatch.ml bitmatch.mli
112 $(OCAMLFIND) ocamldep $(OCAMLCPACKAGES) $^ > $@
114 ifeq ($(wildcard .depend),.depend)
121 $(MAKE) check-manifest
122 rm -rf $(PACKAGE)-$(VERSION)
123 mkdir $(PACKAGE)-$(VERSION)
124 tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
125 $(INSTALL) -m 0755 configure $(PACKAGE)-$(VERSION)/
126 tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
127 rm -rf $(PACKAGE)-$(VERSION)
128 ls -l $(PACKAGE)-$(VERSION).tar.gz
131 @for d in `find -type d -name CVS`; do \
133 awk -F/ '$$1 != "D" {print $$2}' $$d/Entries | \
134 sed -e "s|^|$$b|" -e "s|^\./||"; \
135 done | sort > .check-manifest; \
136 sort MANIFEST > .orig-manifest; \
137 diff -u .orig-manifest .check-manifest; rv=$$?; \
138 rm -f .orig-manifest .check-manifest; \
141 .PHONY: depend dist check-manifest dpkg doc print-examples print-tests test
143 .SUFFIXES: .cmo .cmi .cmx .ml .mli .mll