X-Git-Url: http://git.annexia.org/?p=ocaml-ancient.git;a=blobdiff_plain;f=Makefile;h=e51ff2f79f4287487f805751dcd00d90a371de38;hp=e9c818cf99378b6c3ed41a0e48b440b41505ad90;hb=a1534eec44a5d11dde2f7271afbe0192d1b72b1b;hpb=f5645e2de53ff5935195cdb086d46feda4eff705 diff --git a/Makefile b/Makefile index e9c818c..e51ff2f 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,50 @@ # Mark objects as 'ancient' so they are taken out of the OCaml heap. -# $Id: Makefile,v 1.1 2006-09-27 12:07:07 rich Exp $ +# $Id: Makefile,v 1.8 2006-10-06 15:03:47 rich Exp $ + +include Makefile.config CC := gcc CFLAGS := -g -fPIC -Wall -Werror OCAMLCFLAGS := -g -OCAMLCPACKAGES := -OCAMLCLIBS := +OCAMLCPACKAGES := -package unix +OCAMLCLIBS := -linkpkg OCAMLOPTFLAGS := OCAMLOPTPACKAGES := $(OCAMLCPACKAGES) -OCAMLOPTLIBS := +OCAMLOPTLIBS := -linkpkg OCAMLDOCFLAGS := -html -stars -sort $(OCAMLCPACKAGES) -all: ancient.cma ancient.cmxa test_ancient.opt META +TARGETS := mmalloc ancient.cma ancient.cmxa META \ + test_ancient_dict_write.opt \ + test_ancient_dict_verify.opt \ + test_ancient_dict_read.opt + +all: $(TARGETS) ancient.cma: ancient.cmo ancient_c.o - ocamlmklib -o ancient $^ + ocamlmklib -o ancient -Lmmalloc -lmmalloc $^ ancient.cmxa: ancient.cmx ancient_c.o - ocamlmklib -o ancient $^ + ocamlmklib -o ancient -Lmmalloc -lmmalloc $^ + +test_ancient_dict_write.opt: ancient.cmxa test_ancient_dict_write.cmx + LIBRARY_PATH=.:$$LIBRARY_PATH \ + ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^ -test_ancient.opt: ancient.cmxa test_ancient.cmx +test_ancient_dict_verify.opt: ancient.cmxa test_ancient_dict_verify.cmx LIBRARY_PATH=.:$$LIBRARY_PATH \ - ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) -o $@ $^ + ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^ + +test_ancient_dict_read.opt: ancient.cmxa test_ancient_dict_read.cmx + LIBRARY_PATH=.:$$LIBRARY_PATH \ + ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) -o $@ $^ + +# Build the mmalloc library. + +mmalloc: + $(MAKE) -C mmalloc # Common rules for building OCaml objects. @@ -38,14 +58,15 @@ test_ancient.opt: ancient.cmxa test_ancient.cmx # Findlib META file. META: META.in Makefile.config - $(SED) -e 's/@PACKAGE@/$(PACKAGE)/' \ - -e 's/@VERSION@/$(VERSION)/' \ - < $< > $@ + sed -e 's/@PACKAGE@/$(PACKAGE)/' \ + -e 's/@VERSION@/$(VERSION)/' \ + < $< > $@ # Clean. clean: rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so *~ core META *.opt + $(MAKE) -C mmalloc clean # Dependencies. @@ -63,7 +84,7 @@ endif install: rm -rf $(DESTDIR)$(OCAMLLIBDIR)/ancient - install -c -m 0755 -d $(DESTDIR)$(OCAMLLIBDIR)/weblogs + install -c -m 0755 -d $(DESTDIR)$(OCAMLLIBDIR)/ancient install -c -m 0644 *.cmi *.mli *.cma *.cmxa *.a META \ $(DESTDIR)$(OCAMLLIBDIR)/ancient @@ -118,6 +139,6 @@ doc: mkdir html -ocamlfind ocamldoc $(OCAMLDOCFLAGS) -d html ancient.ml{i,} -.PHONY: depend dist check-manifest dpkg doc +.PHONY: depend dist check-manifest dpkg doc mmalloc .SUFFIXES: .cmo .cmi .cmx .ml .mli