1 # $Id: Makefile.in,v 1.1 2008-04-02 07:20:26 rjones Exp $
3 PACKAGE = ocaml-bitmatch
7 OCAMLMKLIB = ocamlmklib
14 EXAMPLES := $(wildcard examples/*.ml)
16 TESTS := $(patsubst %.ml,%,$(wildcard tests/*.ml))
18 all: pa_bitmatch.cmo bitmatch.cma bitmatch.cmxa
20 pa_bitmatch.cmo: pa_bitmatch.ml
21 ocamlfind ocamlc -I +camlp4 camlp4lib.cma -pp camlp4of.opt -c $< -o $@
23 bitmatch.cma: bitmatch.cmo
24 $(OCAMLFIND) ocamlc -a -o $@ $^
26 bitmatch.cmxa: bitmatch.cmx
27 $(OCAMLFIND) ocamlopt -a -o $@ $^
29 test: pa_bitmatch.cmo bitmatch.cma
30 @for f in $(TESTS); do \
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; \
36 if [ $$? -ne 0 ]; then exit 1; fi; \
39 print-tests: pa_bitmatch.cmo
40 @for f in $(TESTS); do \
42 cmd="camlp4o pa_bitmatch.cmo -printer pr_o.cmo $$f.ml"; \
47 print-examples: pa_bitmatch.cmo
48 @for f in $(EXAMPLES); do \
50 camlp4o pa_bitmatch.cmo -printer pr_o.cmo $$f; \
54 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
56 $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
58 $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) -c $<
62 .depend: bitmatch.ml bitmatch.mli
64 $(OCAMLFIND) ocamldep $(OCAMLCPACKAGES) $^ > $@
66 ifeq ($(wildcard .depend),.depend)
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
83 @for d in `find -type d -name CVS`; do \
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; \
93 .PHONY: depend dist check-manifest dpkg doc print-examples print-tests test
95 .SUFFIXES: .cmo .cmi .cmx .ml .mli .mll