1 # Mark objects as 'ancient' so they are taken out of the OCaml heap.
2 # $Id: Makefile,v 1.8 2006-10-06 15:03:47 rich Exp $
4 include Makefile.config
7 CFLAGS := -g -fPIC -Wall -Werror
10 OCAMLCPACKAGES := -package unix
11 OCAMLCLIBS := -linkpkg
14 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
15 OCAMLOPTLIBS := -linkpkg
17 OCAMLDOCFLAGS := -html -stars -sort $(OCAMLCPACKAGES)
19 TARGETS := mmalloc ancient.cma ancient.cmxa META \
20 test_ancient_dict_write.opt \
21 test_ancient_dict_verify.opt \
22 test_ancient_dict_read.opt
26 ancient.cma: ancient.cmo ancient_c.o
27 ocamlmklib -o ancient -Lmmalloc -lmmalloc $^
29 ancient.cmxa: ancient.cmx ancient_c.o
30 ocamlmklib -o ancient -Lmmalloc -lmmalloc $^
32 test_ancient_dict_write.opt: ancient.cmxa test_ancient_dict_write.cmx
33 LIBRARY_PATH=.:$$LIBRARY_PATH \
34 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^
36 test_ancient_dict_verify.opt: ancient.cmxa test_ancient_dict_verify.cmx
37 LIBRARY_PATH=.:$$LIBRARY_PATH \
38 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^
40 test_ancient_dict_read.opt: ancient.cmxa test_ancient_dict_read.cmx
41 LIBRARY_PATH=.:$$LIBRARY_PATH \
42 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^
44 # Build the mmalloc library.
49 # Common rules for building OCaml objects.
52 ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCINCS) $(OCAMLCPACKAGES) -c $<
54 ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCINCS) $(OCAMLCPACKAGES) -c $<
56 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTINCS) $(OCAMLOPTPACKAGES) -c $<
60 META: META.in Makefile.config
61 sed -e 's/@PACKAGE@/$(PACKAGE)/' \
62 -e 's/@VERSION@/$(VERSION)/' \
68 rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so *~ core META *.opt
69 $(MAKE) -C mmalloc clean
75 .depend: $(wildcard *.mli) $(wildcard *.ml)
79 ifeq ($(wildcard .depend),.depend)
86 rm -rf $(DESTDIR)$(OCAMLLIBDIR)/ancient
87 install -c -m 0755 -d $(DESTDIR)$(OCAMLLIBDIR)/ancient
88 install -c -m 0644 *.cmi *.mli *.cma *.cmxa *.a META \
89 $(DESTDIR)$(OCAMLLIBDIR)/ancient
94 $(MAKE) check-manifest
95 rm -rf $(PACKAGE)-$(VERSION)
96 mkdir $(PACKAGE)-$(VERSION)
97 tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
98 tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
99 rm -rf $(PACKAGE)-$(VERSION)
100 ls -l $(PACKAGE)-$(VERSION).tar.gz
103 @for d in `find -type d -name CVS | grep -v '^\./debian/'`; \
106 awk -F/ '$$1 != "D" {print $$2}' $$d/Entries | \
107 sed -e "s|^|$$b|" -e "s|^\./||"; \
108 done | sort > .check-manifest; \
109 sort MANIFEST > .orig-manifest; \
110 diff -u .orig-manifest .check-manifest; rv=$$?; \
111 rm -f .orig-manifest .check-manifest; \
117 @if [ 0 != `cvs -q update | wc -l` ]; then \
118 echo Please commit all changes to CVS first.; \
124 cp $(PACKAGE)-$(VERSION).tar.gz \
125 /tmp/dbuild/$(PACKAGE)_$(VERSION).orig.tar.gz
126 export CVSROOT=`cat CVS/Root`; \
129 -d $(PACKAGE)-$(VERSION) \
130 -D now merjis/freeware/ancient
131 cd /tmp/dbuild/$(PACKAGE)-$(VERSION) && dpkg-buildpackage -rfakeroot
132 rm -rf /tmp/dbuild/$(PACKAGE)-$(VERSION)
135 # Developer documentation (in html/ subdirectory).
140 -ocamlfind ocamldoc $(OCAMLDOCFLAGS) -d html ancient.ml{i,}
142 .PHONY: depend dist check-manifest dpkg doc mmalloc
144 .SUFFIXES: .cmo .cmi .cmx .ml .mli