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)
12 OCAMLCPACKAGES := -package unix
13 OCAMLCLIBS := -linkpkg
16 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
17 OCAMLOPTLIBS := -linkpkg
19 OCAMLDOCFLAGS := -html -stars -sort $(OCAMLCPACKAGES)
21 TARGETS := mmalloc ancient.cma ancient.cmxa META \
22 test_ancient_dict_write.opt \
23 test_ancient_dict_verify.opt \
24 test_ancient_dict_read.opt
28 ancient.cma: ancient.cmo ancient_c.o
29 ocamlmklib -o ancient -Lmmalloc -lmmalloc $^
31 ancient.cmxa: ancient.cmx ancient_c.o
32 ocamlmklib -o ancient -Lmmalloc -lmmalloc $^
34 test_ancient_dict_write.opt: ancient.cmxa test_ancient_dict_write.cmx
35 LIBRARY_PATH=.:$$LIBRARY_PATH \
36 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^
38 test_ancient_dict_verify.opt: ancient.cmxa test_ancient_dict_verify.cmx
39 LIBRARY_PATH=.:$$LIBRARY_PATH \
40 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^
42 test_ancient_dict_read.opt: ancient.cmxa test_ancient_dict_read.cmx
43 LIBRARY_PATH=.:$$LIBRARY_PATH \
44 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^
46 # Build the mmalloc library.
51 # Common rules for building OCaml objects.
54 ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCINCS) $(OCAMLCPACKAGES) -c $<
56 ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCINCS) $(OCAMLCPACKAGES) -c $<
58 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTINCS) $(OCAMLOPTPACKAGES) -c $<
62 META: META.in Makefile.config
63 sed -e 's/@PACKAGE@/$(PACKAGE)/' \
64 -e 's/@VERSION@/$(VERSION)/' \
70 rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so *~ core META *.opt
71 $(MAKE) -C mmalloc clean
77 .depend: $(wildcard *.mli) $(wildcard *.ml)
81 ifeq ($(wildcard .depend),.depend)
88 rm -rf $(DESTDIR)$(OCAMLLIBDIR)/ancient
89 install -c -m 0755 -d $(DESTDIR)$(OCAMLLIBDIR)/ancient
90 install -c -m 0644 *.cmi *.mli *.cma *.cmxa *.a META \
91 $(DESTDIR)$(OCAMLLIBDIR)/ancient
96 $(MAKE) check-manifest
97 rm -rf $(PACKAGE)-$(VERSION)
98 mkdir $(PACKAGE)-$(VERSION)
99 tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
100 tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
101 rm -rf $(PACKAGE)-$(VERSION)
102 ls -l $(PACKAGE)-$(VERSION).tar.gz
105 @for d in `find -type d -name CVS | grep -v '^\./debian/'`; \
108 awk -F/ '$$1 != "D" {print $$2}' $$d/Entries | \
109 sed -e "s|^|$$b|" -e "s|^\./||"; \
110 done | sort > .check-manifest; \
111 sort MANIFEST > .orig-manifest; \
112 diff -u .orig-manifest .check-manifest; rv=$$?; \
113 rm -f .orig-manifest .check-manifest; \
119 @if [ 0 != `cvs -q update | wc -l` ]; then \
120 echo Please commit all changes to CVS first.; \
126 cp $(PACKAGE)-$(VERSION).tar.gz \
127 /tmp/dbuild/$(PACKAGE)_$(VERSION).orig.tar.gz
128 export CVSROOT=`cat CVS/Root`; \
131 -d $(PACKAGE)-$(VERSION) \
132 -D now merjis/freeware/ancient
133 cd /tmp/dbuild/$(PACKAGE)-$(VERSION) && dpkg-buildpackage -rfakeroot
134 rm -rf /tmp/dbuild/$(PACKAGE)-$(VERSION)
137 # Developer documentation (in html/ subdirectory).
142 -ocamlfind ocamldoc $(OCAMLDOCFLAGS) -d html ancient.ml{i,}
144 .PHONY: depend dist check-manifest dpkg doc mmalloc
146 .SUFFIXES: .cmo .cmi .cmx .ml .mli