# Interface to Perl from OCaml.
# Copyright (C) 2003 Merjis Ltd.
-# $Id: Makefile,v 1.4 2003-10-12 11:57:07 rich Exp $
+# $Id: Makefile,v 1.5 2003-10-12 12:14:06 rich Exp $
include Makefile.config
CC := gcc
CFLAGS := -Wall -Wno-unused -I$(PERLINCDIR)
-all: perl.cma examples/test
-
-opt: perl.cmxa
+all: perl.cma perl.cmxa examples/test
perl.cma: perl.cmo perl_c.o
$(OCAMLMKLIB) -o perl $^ -lperl
.depend: $(wildcard *.ml) $(wildcard *.mli)
$(OCAMLDEP) *.mli *.ml examples/*.ml > .depend
+
+# Install.
+
+install:
+ install -c -m 0755 -d $(OCAMLLIBDIR)
+ install -c -m 0755 -d $(OCAMLLIBDIR)/stublibs
+ install -c -m 0644 perl.cmi perl.mli perl.cma perl.cmxa $(OCAMLLIBDIR)
+ install -c -m 0644 perl.a libperl.a $(OCAMLLIBDIR)
+ install -c -m 0644 dllperl.so $(OCAMLLIBDIR)/stublibs
+
+# Distribution.
+
+dist:
+ rm -rf $(PACKAGE)-$(VERSION)
+ mkdir $(PACKAGE)-$(VERSION)
+ tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
+ tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
+ rm -rf $(PACKAGE)-$(VERSION)
+ ls -l $(PACKAGE)-$(VERSION).tar.gz
+
+check-manifest:
+ @for d in `find -type d -name CVS`; \
+ do \
+ b=`dirname $$d`/; \
+ awk -F/ '$$1 != "D" {print $$2}' $$d/Entries | \
+ sed -e "s|^|$$b|" -e "s|^\./||"; \
+ done | sort > .check-manifest; \
+ sort MANIFEST > .orig-manifest; \
+ diff -u .orig-manifest .check-manifest; \
+ rm -f .orig-manifest .check-manifest
+
+.PHONY: depend dist check-manifest
\ No newline at end of file
# perl4caml configuration -*- Makefile -*-
-# $Id: Makefile.config,v 1.1 2003-10-11 18:25:52 rich Exp $
+# $Id: Makefile.config,v 1.2 2003-10-12 12:14:06 rich Exp $
# PERLINCDIR
# Directory containing the Perl include files, eg. <EXTERN.h>.
PERLINCDIR := $(shell perl -MConfig -e 'print "$$Config{archlib}/CORE"')
+
+# OCAMLLIBDIR
+# This is where we will install perl4caml.
+
+OCAMLLIBDIR := $(shell ocamlc -where)
+
+# PACKAGE and VERSION
+
+PACKAGE := perl4caml
+VERSION := 0.2.0