1 # Mark objects as 'ancient' so they are taken out of the OCaml heap.
2 # $Id: Makefile,v 1.4 2006-09-27 14:05:07 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 := 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 $^
38 ancient.cmxa: ancient.cmx ancient_c.o
39 ocamlmklib -o ancient $^
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 # 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
76 .depend: $(wildcard *.mli) $(wildcard *.ml)
80 ifeq ($(wildcard .depend),.depend)
87 rm -rf $(DESTDIR)$(OCAMLLIBDIR)/ancient
88 install -c -m 0755 -d $(DESTDIR)$(OCAMLLIBDIR)/weblogs
89 install -c -m 0644 *.cmi *.mli *.cma *.cmxa *.a META \
90 $(DESTDIR)$(OCAMLLIBDIR)/ancient
95 $(MAKE) check-manifest
96 rm -rf $(PACKAGE)-$(VERSION)
97 mkdir $(PACKAGE)-$(VERSION)
98 tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
99 tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
100 rm -rf $(PACKAGE)-$(VERSION)
101 ls -l $(PACKAGE)-$(VERSION).tar.gz
104 @for d in `find -type d -name CVS | grep -v '^\./debian/'`; \
107 awk -F/ '$$1 != "D" {print $$2}' $$d/Entries | \
108 sed -e "s|^|$$b|" -e "s|^\./||"; \
109 done | sort > .check-manifest; \
110 sort MANIFEST > .orig-manifest; \
111 diff -u .orig-manifest .check-manifest; rv=$$?; \
112 rm -f .orig-manifest .check-manifest; \
118 @if [ 0 != `cvs -q update | wc -l` ]; then \
119 echo Please commit all changes to CVS first.; \
125 cp $(PACKAGE)-$(VERSION).tar.gz \
126 /tmp/dbuild/$(PACKAGE)_$(VERSION).orig.tar.gz
127 export CVSROOT=`cat CVS/Root`; \
130 -d $(PACKAGE)-$(VERSION) \
131 -D now merjis/freeware/ancient
132 cd /tmp/dbuild/$(PACKAGE)-$(VERSION) && dpkg-buildpackage -rfakeroot
133 rm -rf /tmp/dbuild/$(PACKAGE)-$(VERSION)
136 # Developer documentation (in html/ subdirectory).
141 -ocamlfind ocamldoc $(OCAMLDOCFLAGS) -d html ancient.ml{i,}
143 .PHONY: depend dist check-manifest dpkg doc
145 .SUFFIXES: .cmo .cmi .cmx .ml .mli