1 # Mark objects as 'ancient' so they are taken out of the OCaml heap.
2 # $Id: Makefile,v 1.5 2006-09-27 15:36:18 rich Exp $
4 include Makefile.config
7 CFLAGS := -g -fPIC -Wall -Werror
14 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
17 OCAMLDOCFLAGS := -html -stars -sort $(OCAMLCPACKAGES)
19 ifeq ($(TEST_WEBLOGS),1)
20 # For testing with large amount of weblogs data.
21 OCAMLCPACKAGES := -package calendar,pcre,extlib -I ../../freeware/weblogs
22 OCAMLCLIBS := -linkpkg weblogs.cma
23 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
24 OCAMLOPTLIBS := -linkpkg weblogs.cmxa
27 TARGETS := mmalloc ancient.cma ancient.cmxa META test_ancient.opt
29 ifeq ($(TEST_WEBLOGS),1)
30 TARGETS += test_ancient_weblogs.opt
35 ancient.cma: ancient.cmo ancient_c.o
36 ocamlmklib -o ancient -Lmmalloc -lmmalloc $^
38 ancient.cmxa: ancient.cmx ancient_c.o
39 ocamlmklib -o ancient -Lmmalloc -lmmalloc $^
41 test_ancient.opt: ancient.cmxa test_ancient.cmx
42 LIBRARY_PATH=.:$$LIBRARY_PATH \
43 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^
45 ifeq ($(TEST_WEBLOGS),1)
46 test_ancient_weblogs.opt: ancient.cmxa test_ancient_weblogs.cmx
47 LIBRARY_PATH=.:$$LIBRARY_PATH \
48 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^
51 # Build the mmalloc library.
56 # Common rules for building OCaml objects.
59 ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCINCS) $(OCAMLCPACKAGES) -c $<
61 ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCINCS) $(OCAMLCPACKAGES) -c $<
63 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTINCS) $(OCAMLOPTPACKAGES) -c $<
67 META: META.in Makefile.config
68 sed -e 's/@PACKAGE@/$(PACKAGE)/' \
69 -e 's/@VERSION@/$(VERSION)/' \
75 rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so *~ core META *.opt
76 $(MAKE) -C mmalloc clean
82 .depend: $(wildcard *.mli) $(wildcard *.ml)
86 ifeq ($(wildcard .depend),.depend)
93 rm -rf $(DESTDIR)$(OCAMLLIBDIR)/ancient
94 install -c -m 0755 -d $(DESTDIR)$(OCAMLLIBDIR)/weblogs
95 install -c -m 0644 *.cmi *.mli *.cma *.cmxa *.a META \
96 $(DESTDIR)$(OCAMLLIBDIR)/ancient
101 $(MAKE) check-manifest
102 rm -rf $(PACKAGE)-$(VERSION)
103 mkdir $(PACKAGE)-$(VERSION)
104 tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
105 tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
106 rm -rf $(PACKAGE)-$(VERSION)
107 ls -l $(PACKAGE)-$(VERSION).tar.gz
110 @for d in `find -type d -name CVS | grep -v '^\./debian/'`; \
113 awk -F/ '$$1 != "D" {print $$2}' $$d/Entries | \
114 sed -e "s|^|$$b|" -e "s|^\./||"; \
115 done | sort > .check-manifest; \
116 sort MANIFEST > .orig-manifest; \
117 diff -u .orig-manifest .check-manifest; rv=$$?; \
118 rm -f .orig-manifest .check-manifest; \
124 @if [ 0 != `cvs -q update | wc -l` ]; then \
125 echo Please commit all changes to CVS first.; \
131 cp $(PACKAGE)-$(VERSION).tar.gz \
132 /tmp/dbuild/$(PACKAGE)_$(VERSION).orig.tar.gz
133 export CVSROOT=`cat CVS/Root`; \
136 -d $(PACKAGE)-$(VERSION) \
137 -D now merjis/freeware/ancient
138 cd /tmp/dbuild/$(PACKAGE)-$(VERSION) && dpkg-buildpackage -rfakeroot
139 rm -rf /tmp/dbuild/$(PACKAGE)-$(VERSION)
142 # Developer documentation (in html/ subdirectory).
147 -ocamlfind ocamldoc $(OCAMLDOCFLAGS) -d html ancient.ml{i,}
149 .PHONY: depend dist check-manifest dpkg doc mmalloc
151 .SUFFIXES: .cmo .cmi .cmx .ml .mli