Initial Commit
[packages] / xemacs-packages / ocaml / Makefile.upstream
1 # $Id: Makefile,v 1.9 2002/03/19 09:45:46 garrigue Exp $
2
3 include ../config/Makefile
4
5 # Files to install
6 FILES=  caml-font.el caml-hilit.el caml.el camldebug.el \
7         inf-caml.el caml-compat.el caml-help.el
8
9 # Where to install. If empty, automatically determined.
10 #EMACSDIR=
11
12 # Name of Emacs executable
13 EMACS=emacs
14
15 # Where to install ocamltags script
16 SCRIPTDIR = $(BINDIR)
17
18 # Command for byte-compiling the files
19 COMPILECMD=(progn \
20               (setq load-path (cons "." load-path)) \
21               (byte-compile-file "caml.el") \
22               (byte-compile-file "inf-caml.el") \
23               (byte-compile-file "caml-help.el") \
24               (byte-compile-file "camldebug.el"))
25
26 install:
27         @if test "$(EMACSDIR)" = ""; then \
28           set xxx `($(EMACS) --batch --eval "(mapcar 'print load-path)") \
29                    2>/dev/null | \
30                    sed -n -e '/\/site-lisp/s/"//gp'`; \
31           if test "$$2" = ""; then \
32             echo "Cannot determine Emacs site-lisp directory"; \
33             exit 2; \
34           fi; \
35           $(MAKE) EMACSDIR="$$2" simple-install; \
36         else \
37           $(MAKE) simple-install; \
38         fi
39
40 simple-install:
41         @echo "Installing in $(EMACSDIR)..."
42         if test -d $(EMACSDIR); then : ; else mkdir -p $(EMACSDIR); fi
43         cp $(FILES) $(EMACSDIR)
44         cd $(EMACSDIR); $(EMACS) --batch --eval '$(COMPILECMD)'
45
46 ocamltags:      ocamltags.in
47         sed -e 's:@EMACS@:$(EMACS):' ocamltags.in >ocamltags
48         chmod a+x ocamltags
49
50 install-ocamltags: ocamltags
51
52         cp ocamltags $(SCRIPTDIR)/ocamltags
53
54 clean:
55         rm -f ocamltags *~ #*#