~ubuntu-branches/ubuntu/quantal/menhir/quantal

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Package Import Robot
  • Author(s): Mehdi Dogguy
  • Date: 2012-01-23 20:50:25 UTC
  • mfrom: (1.1.8) (2.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20120123205025-nd325ikf9gmqe1v7
Tags: 20120123.dfsg-1
* New upstream release
  - fixes http://caml.inria.fr/mantis/view.php?id=5462

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
endif
21
21
 
22
22
# ----------------------------------------------------------------------------
 
23
 
 
24
# A few settings differ on Windows versus Unix.
 
25
 
 
26
include Makefile.arch
 
27
 
 
28
# ----------------------------------------------------------------------------
23
29
# Installation paths.
24
30
 
25
31
# TEMPORARY GODIVA and Linux do not agree on the standard paths...
43
49
ifeq ($(TARGET),byte)
44
50
MENHIRLIB       := menhirLib.cmi menhirLib.cmo
45
51
else
46
 
MENHIRLIB       := menhirLib.cmi menhirLib.cmo menhirLib.cmx menhirLib.o
 
52
MENHIRLIB       := menhirLib.cmi menhirLib.cmo menhirLib.cmx menhirLib.$(OBJ)
47
53
endif
48
54
 
49
55
# ----------------------------------------------------------------------------
50
56
# Compilation.
51
57
 
 
58
# Installation time settings are recorded within src/installation.ml.
 
59
# This file is recreated every time so as to avoid becoming stale.
 
60
 
52
61
.PHONY: all install uninstall
53
62
 
54
 
all: src/menhir
55
 
 
56
 
src/menhir: src/installation.ml
57
 
        $(MAKE) -C src -f Makefile
58
 
        $(MAKE) -C src -f Makefile $(MENHIRLIB)
59
 
 
60
 
# Record some installation time settings within the menhir binary.
61
 
 
62
 
src/installation.ml:
63
 
        echo "let libdir = \"${libdir}\"" > $@
 
63
all:
 
64
        rm -f src/installation.ml
 
65
        echo "let libdir = \"${libdir}\"" > src/installation.ml
64
66
        if $(USE_OCAMLFIND) ; then \
65
 
          echo "let ocamlfind = true" >> $@ ; \
 
67
          echo "let ocamlfind = true" >> src/installation.ml ; \
66
68
        else \
67
 
          echo "let ocamlfind = false" >> $@ ; \
 
69
          echo "let ocamlfind = false" >> src/installation.ml ; \
68
70
        fi
 
71
        $(MAKE) $(MFLAGS) -C src -f Makefile
 
72
        $(MAKE) $(MFLAGS) -C src -f Makefile $(MENHIRLIB)
69
73
 
70
74
# ----------------------------------------------------------------------------
71
75
# Installation.
72
76
 
73
 
install: src/menhir
 
77
install: all
74
78
        mkdir -p $(bindir)
75
79
        mkdir -p $(libdir)
76
80
        mkdir -p $(docdir)
77
81
        mkdir -p $(mandir)
78
 
        install src/menhir $(bindir)
 
82
        install src/$(MENHIREXE) $(bindir)
79
83
        install -m 644 $(MLYLIB) $(libdir)
80
84
        cp -r $(DOCS) $(docdir)
81
85
        cp -r $(MANS) $(mandir)
88
92
        fi
89
93
 
90
94
uninstall:
91
 
        rm -rf $(bindir)/menhir
 
95
        rm -rf $(bindir)/$(MENHIREXE)
92
96
        rm -rf $(libdir)
93
97
        rm -rf $(docdir)
94
98
        rm -rf $(mandir)/$(MANS)
96
100
          echo Un-installing MenhirLib via ocamlfind. ; \
97
101
          ocamlfind remove menhirLib ; \
98
102
        fi
99