1 # Interface to Perl from OCaml.
2 # Copyright (C) 2003 Merjis Ltd.
3 # $Id: Makefile,v 1.3 2003-10-12 11:56:26 rich Exp $
5 include Makefile.config
9 OCAMLMKLIB := ocamlmklib
12 OCAMLCFLAGS := -w s -g
16 CFLAGS := -Wall -Wno-unused -I$(PERLINCDIR)
18 all: perl.cma examples/test
22 perl.cma: perl.cmo perl_c.o
23 $(OCAMLMKLIB) -o perl $^ -lperl
25 perl.cmxa: perl.cmx perl_c.o
26 $(OCAMLMKLIB) -o perl $^ -lperl
28 examples/test: examples/test.ml
29 $(OCAMLC) $(OCAMLCFLAGS) perl.cma $^ -o $@
32 $(OCAMLC) $(OCAMLCFLAGS) -c $<
35 $(OCAMLC) $(OCAMLCFLAGS) -c $<
38 $(OCAMLOPT) $(OCAMLOPTFLAGS) -c $<
40 .SUFFIXES: .mli .ml .cmi .cmo .cmx
44 JUNKFILES = core *~ *.bak *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so
48 for d in . examples; do (cd $$d; rm -f $(JUNKFILES)); done
52 ifeq ($(wildcard .depend),.depend)
58 .depend: $(wildcard *.ml) $(wildcard *.mli)
59 $(OCAMLDEP) *.mli *.ml > .depend