1 # Mark objects as 'ancient' so they are taken out of the OCaml heap.
2 # $Id: Makefile,v 1.7 2006-10-06 12:26:31 rich Exp $
4 include Makefile.config
7 CFLAGS := -g -fPIC -Wall -Werror
14 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
17 OCAMLDOCFLAGS := -html -stars -sort $(OCAMLCPACKAGES)
19 TARGETS := mmalloc ancient.cma ancient.cmxa META \
20 test_ancient.opt test_ancient_shared.opt
24 ancient.cma: ancient.cmo ancient_c.o
25 ocamlmklib -o ancient -Lmmalloc -lmmalloc $^
27 ancient.cmxa: ancient.cmx ancient_c.o
28 ocamlmklib -o ancient -Lmmalloc -lmmalloc $^
30 test_ancient.opt: ancient.cmxa test_ancient.cmx
31 LIBRARY_PATH=.:$$LIBRARY_PATH \
32 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^
34 test_ancient_shared.opt: ancient.cmxa test_ancient_shared.cmx
35 LIBRARY_PATH=.:$$LIBRARY_PATH \
36 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^
38 # Build the mmalloc library.
43 # Common rules for building OCaml objects.
46 ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCINCS) $(OCAMLCPACKAGES) -c $<
48 ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCINCS) $(OCAMLCPACKAGES) -c $<
50 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTINCS) $(OCAMLOPTPACKAGES) -c $<
54 META: META.in Makefile.config
55 sed -e 's/@PACKAGE@/$(PACKAGE)/' \
56 -e 's/@VERSION@/$(VERSION)/' \
62 rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so *~ core META *.opt
63 $(MAKE) -C mmalloc clean
69 .depend: $(wildcard *.mli) $(wildcard *.ml)
73 ifeq ($(wildcard .depend),.depend)
80 rm -rf $(DESTDIR)$(OCAMLLIBDIR)/ancient
81 install -c -m 0755 -d $(DESTDIR)$(OCAMLLIBDIR)/ancient
82 install -c -m 0644 *.cmi *.mli *.cma *.cmxa *.a META \
83 $(DESTDIR)$(OCAMLLIBDIR)/ancient
88 $(MAKE) check-manifest
89 rm -rf $(PACKAGE)-$(VERSION)
90 mkdir $(PACKAGE)-$(VERSION)
91 tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
92 tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
93 rm -rf $(PACKAGE)-$(VERSION)
94 ls -l $(PACKAGE)-$(VERSION).tar.gz
97 @for d in `find -type d -name CVS | grep -v '^\./debian/'`; \
100 awk -F/ '$$1 != "D" {print $$2}' $$d/Entries | \
101 sed -e "s|^|$$b|" -e "s|^\./||"; \
102 done | sort > .check-manifest; \
103 sort MANIFEST > .orig-manifest; \
104 diff -u .orig-manifest .check-manifest; rv=$$?; \
105 rm -f .orig-manifest .check-manifest; \
111 @if [ 0 != `cvs -q update | wc -l` ]; then \
112 echo Please commit all changes to CVS first.; \
118 cp $(PACKAGE)-$(VERSION).tar.gz \
119 /tmp/dbuild/$(PACKAGE)_$(VERSION).orig.tar.gz
120 export CVSROOT=`cat CVS/Root`; \
123 -d $(PACKAGE)-$(VERSION) \
124 -D now merjis/freeware/ancient
125 cd /tmp/dbuild/$(PACKAGE)-$(VERSION) && dpkg-buildpackage -rfakeroot
126 rm -rf /tmp/dbuild/$(PACKAGE)-$(VERSION)
129 # Developer documentation (in html/ subdirectory).
134 -ocamlfind ocamldoc $(OCAMLDOCFLAGS) -d html ancient.ml{i,}
136 .PHONY: depend dist check-manifest dpkg doc mmalloc
138 .SUFFIXES: .cmo .cmi .cmx .ml .mli