1 # Mark objects as 'ancient' so they are taken out of the OCaml heap.
2 # $Id: Makefile,v 1.6 2006-09-27 16:01:47 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 \
28 test_ancient.opt test_ancient_shared.opt
30 ifeq ($(TEST_WEBLOGS),1)
31 TARGETS += test_ancient_weblogs.opt
36 ancient.cma: ancient.cmo ancient_c.o
37 ocamlmklib -o ancient -Lmmalloc -lmmalloc $^
39 ancient.cmxa: ancient.cmx ancient_c.o
40 ocamlmklib -o ancient -Lmmalloc -lmmalloc $^
42 test_ancient.opt: ancient.cmxa test_ancient.cmx
43 LIBRARY_PATH=.:$$LIBRARY_PATH \
44 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^
46 test_ancient_shared.opt: ancient.cmxa test_ancient_shared.cmx
47 LIBRARY_PATH=.:$$LIBRARY_PATH \
48 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^
50 ifeq ($(TEST_WEBLOGS),1)
51 test_ancient_weblogs.opt: ancient.cmxa test_ancient_weblogs.cmx
52 LIBRARY_PATH=.:$$LIBRARY_PATH \
53 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^
56 # Build the mmalloc library.
61 # Common rules for building OCaml objects.
64 ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCINCS) $(OCAMLCPACKAGES) -c $<
66 ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCINCS) $(OCAMLCPACKAGES) -c $<
68 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTINCS) $(OCAMLOPTPACKAGES) -c $<
72 META: META.in Makefile.config
73 sed -e 's/@PACKAGE@/$(PACKAGE)/' \
74 -e 's/@VERSION@/$(VERSION)/' \
80 rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so *~ core META *.opt
81 $(MAKE) -C mmalloc clean
87 .depend: $(wildcard *.mli) $(wildcard *.ml)
91 ifeq ($(wildcard .depend),.depend)
98 rm -rf $(DESTDIR)$(OCAMLLIBDIR)/ancient
99 install -c -m 0755 -d $(DESTDIR)$(OCAMLLIBDIR)/weblogs
100 install -c -m 0644 *.cmi *.mli *.cma *.cmxa *.a META \
101 $(DESTDIR)$(OCAMLLIBDIR)/ancient
106 $(MAKE) check-manifest
107 rm -rf $(PACKAGE)-$(VERSION)
108 mkdir $(PACKAGE)-$(VERSION)
109 tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
110 tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
111 rm -rf $(PACKAGE)-$(VERSION)
112 ls -l $(PACKAGE)-$(VERSION).tar.gz
115 @for d in `find -type d -name CVS | grep -v '^\./debian/'`; \
118 awk -F/ '$$1 != "D" {print $$2}' $$d/Entries | \
119 sed -e "s|^|$$b|" -e "s|^\./||"; \
120 done | sort > .check-manifest; \
121 sort MANIFEST > .orig-manifest; \
122 diff -u .orig-manifest .check-manifest; rv=$$?; \
123 rm -f .orig-manifest .check-manifest; \
129 @if [ 0 != `cvs -q update | wc -l` ]; then \
130 echo Please commit all changes to CVS first.; \
136 cp $(PACKAGE)-$(VERSION).tar.gz \
137 /tmp/dbuild/$(PACKAGE)_$(VERSION).orig.tar.gz
138 export CVSROOT=`cat CVS/Root`; \
141 -d $(PACKAGE)-$(VERSION) \
142 -D now merjis/freeware/ancient
143 cd /tmp/dbuild/$(PACKAGE)-$(VERSION) && dpkg-buildpackage -rfakeroot
144 rm -rf /tmp/dbuild/$(PACKAGE)-$(VERSION)
147 # Developer documentation (in html/ subdirectory).
152 -ocamlfind ocamldoc $(OCAMLDOCFLAGS) -d html ancient.ml{i,}
154 .PHONY: depend dist check-manifest dpkg doc mmalloc
156 .SUFFIXES: .cmo .cmi .cmx .ml .mli