1 # Mark objects as 'ancient' so they are taken out of the OCaml heap.
2 # $Id: Makefile,v 1.9 2006-10-31 14:39:50 rich Exp $
4 include Makefile.config
7 CFLAGS := -g -fPIC -Wall -Werror \
8 -DOCAML_VERSION_MAJOR=$(OCAML_VERSION_MAJOR) \
9 -DOCAML_VERSION_MINOR=$(OCAML_VERSION_MINOR) \
10 -I$(shell ocamlc -where)
13 OCAMLCPACKAGES := -package unix
14 OCAMLCLIBS := -linkpkg
17 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
18 OCAMLOPTLIBS := -linkpkg
20 OCAMLDOCFLAGS := -html -stars -sort $(OCAMLCPACKAGES)
22 TARGETS := mmalloc ancient.cma ancient.cmxa META \
23 test_ancient_dict_write.opt \
24 test_ancient_dict_verify.opt \
25 test_ancient_dict_read.opt
29 ancient.cma: ancient.cmo ancient_c.o
30 ocamlmklib -o ancient -Lmmalloc -lmmalloc $^
32 ancient.cmxa: ancient.cmx ancient_c.o
33 ocamlmklib -o ancient -Lmmalloc -lmmalloc $^
35 test_ancient_dict_write.opt: ancient.cmxa test_ancient_dict_write.cmx
36 LIBRARY_PATH=.:$$LIBRARY_PATH \
37 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^
39 test_ancient_dict_verify.opt: ancient.cmxa test_ancient_dict_verify.cmx
40 LIBRARY_PATH=.:$$LIBRARY_PATH \
41 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^
43 test_ancient_dict_read.opt: ancient.cmxa test_ancient_dict_read.cmx
44 LIBRARY_PATH=.:$$LIBRARY_PATH \
45 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^
47 # Build the mmalloc library.
52 # Common rules for building OCaml objects.
55 ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCINCS) $(OCAMLCPACKAGES) -c $<
57 ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCINCS) $(OCAMLCPACKAGES) -c $<
59 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTINCS) $(OCAMLOPTPACKAGES) -c $<
63 META: META.in Makefile.config
64 sed -e 's/@PACKAGE@/$(PACKAGE)/' \
65 -e 's/@VERSION@/$(VERSION)/' \
71 rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so *~ core META *.opt
72 $(MAKE) -C mmalloc clean
78 .depend: $(wildcard *.mli) $(wildcard *.ml)
82 ifeq ($(wildcard .depend),.depend)
89 rm -rf $(DESTDIR)$(OCAMLLIBDIR)/ancient
90 install -c -m 0755 -d $(DESTDIR)$(OCAMLLIBDIR)/ancient
91 install -c -m 0644 *.cmi *.mli *.cma *.cmxa *.a META \
92 $(DESTDIR)$(OCAMLLIBDIR)/ancient
97 $(MAKE) check-manifest
98 rm -rf $(PACKAGE)-$(VERSION)
99 mkdir $(PACKAGE)-$(VERSION)
100 tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
101 tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
102 rm -rf $(PACKAGE)-$(VERSION)
103 ls -l $(PACKAGE)-$(VERSION).tar.gz
106 @for d in `find -type d -name CVS | grep -v '^\./debian/'`; \
109 awk -F/ '$$1 != "D" {print $$2}' $$d/Entries | \
110 sed -e "s|^|$$b|" -e "s|^\./||"; \
111 done | sort > .check-manifest; \
112 sort MANIFEST > .orig-manifest; \
113 diff -u .orig-manifest .check-manifest; rv=$$?; \
114 rm -f .orig-manifest .check-manifest; \
120 @if [ 0 != `cvs -q update | wc -l` ]; then \
121 echo Please commit all changes to CVS first.; \
127 cp $(PACKAGE)-$(VERSION).tar.gz \
128 /tmp/dbuild/$(PACKAGE)_$(VERSION).orig.tar.gz
129 export CVSROOT=`cat CVS/Root`; \
132 -d $(PACKAGE)-$(VERSION) \
133 -D now merjis/freeware/ancient
134 cd /tmp/dbuild/$(PACKAGE)-$(VERSION) && dpkg-buildpackage -rfakeroot
135 rm -rf /tmp/dbuild/$(PACKAGE)-$(VERSION)
138 # Developer documentation (in html/ subdirectory).
143 -ocamlfind ocamldoc $(OCAMLDOCFLAGS) -d html ancient.ml{i,}
145 .PHONY: depend dist check-manifest dpkg doc mmalloc
147 .SUFFIXES: .cmo .cmi .cmx .ml .mli