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.2 2008-04-02 08:03:26 rjones Exp $
20 PACKAGE = @PACKAGE_NAME@
21 VERSION = @PACKAGE_VERSION@
23 OCAMLFIND = @OCAMLFIND@
24 OCAMLMKLIB = @OCAMLMKLIB@
33 EXAMPLES = $(wildcard examples/*.ml)
35 TESTS = $(patsubst %.ml,%,$(wildcard tests/*.ml))
37 all: pa_bitmatch.cmo bitmatch.cma bitmatch.cmxa
39 pa_bitmatch.cmo: pa_bitmatch.ml
40 $(OCAMLFIND) ocamlc -I +camlp4 camlp4lib.cma \
41 -pp camlp4of.opt -c $< -o $@
43 bitmatch.cma: bitmatch.cmo
44 $(OCAMLFIND) ocamlc -a -o $@ $^
46 bitmatch.cmxa: bitmatch.cmx
47 $(OCAMLFIND) ocamlopt -a -o $@ $^
51 test: pa_bitmatch.cmo bitmatch.cma
52 @for f in $(TESTS); do \
54 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -pp "camlp4o pa_bitmatch.cmo" \
55 -I . bitmatch.cma $$f.ml -o $$f; \
56 if [ $$? -ne 0 ]; then exit 1; fi; \
58 if [ $$? -ne 0 ]; then exit 1; fi; \
61 print-tests: pa_bitmatch.cmo
62 @for f in $(TESTS); do \
64 cmd="camlp4o pa_bitmatch.cmo -printer pr_o.cmo $$f.ml"; \
69 print-examples: pa_bitmatch.cmo
70 @for f in $(EXAMPLES); do \
72 camlp4o pa_bitmatch.cmo -printer pr_o.cmo $$f; \
73 if [ $$? -ne 0 ]; then exit 1; fi; \
79 rm -f core *~ *.cmi *.cmo *.cmx *.cma *.cmxa *.a *.o
80 rm -f tests/*~ tests/*.cmi tests/*.cmo $(TESTS)
88 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
90 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
92 $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) -c $<
96 .depend: bitmatch.ml bitmatch.mli
98 $(OCAMLFIND) ocamldep $(OCAMLCPACKAGES) $^ > $@
100 ifeq ($(wildcard .depend),.depend)
107 $(MAKE) check-manifest
108 rm -rf $(PACKAGE)-$(VERSION)
109 mkdir $(PACKAGE)-$(VERSION)
110 tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
111 $(INSTALL) -m 0755 configure $(PACKAGE)-$(VERSION)/
112 tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
113 rm -rf $(PACKAGE)-$(VERSION)
114 ls -l $(PACKAGE)-$(VERSION).tar.gz
117 @for d in `find -type d -name CVS`; do \
119 awk -F/ '$$1 != "D" {print $$2}' $$d/Entries | \
120 sed -e "s|^|$$b|" -e "s|^\./||"; \
121 done | sort > .check-manifest; \
122 sort MANIFEST > .orig-manifest; \
123 diff -u .orig-manifest .check-manifest; rv=$$?; \
124 rm -f .orig-manifest .check-manifest; \
127 .PHONY: depend dist check-manifest dpkg doc print-examples print-tests test
129 .SUFFIXES: .cmo .cmi .cmx .ml .mli .mll