~ubuntu-branches/debian/sid/ocaml/sid

« back to all changes in this revision

Viewing changes to camlp4/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-04-21 21:35:08 UTC
  • mfrom: (1.1.11 upstream) (12.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110421213508-kg34453aqmb0moha
* Fixes related to -output-obj with g++ (in debian/patches):
  - add Declare-primitive-name-table-as-const-char
  - add Avoid-multiple-declarations-in-generated-.c-files-in
  - fix Embed-bytecode-in-C-object-when-using-custom: the closing
    brace for extern "C" { ... } was missing in some cases

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#########################################################################
2
 
#                                                                       #
3
 
#                            Objective Caml                             #
4
 
#                                                                       #
5
 
#        Nicolas Pouillard, projet Gallium, INRIA Rocquencourt          #
6
 
#                                                                       #
7
 
#   Copyright 2006 Institut National de Recherche en Informatique et    #
8
 
#   en Automatique.  All rights reserved.  This file is distributed     #
9
 
#   under the terms of the Q Public License version 1.0.                #
10
 
#                                                                       #
11
 
#########################################################################
12
 
 
13
 
 
14
 
 
15
 
# RELEASE NOTE:
16
 
#   Do not forget to call make genclean to update Makefile.clean before a
17
 
#   release.
18
 
 
19
 
OCAMLC=../boot/ocamlrun ../ocamlc -nostdlib \
20
 
  -I ../stdlib -I ../otherlibs/unix -I ../otherlibs/win32unix -I build -g
21
 
OCAMLRUN=../boot/ocamlrun -I ../otherlibs/unix -I ../otherlibs/win32unix
22
 
YAM=$(OCAMLRUN) ./yam
23
 
YAM_OPTIONS=-verbosity '$(VERBOSE)'
24
 
 
25
 
default: all
26
 
 
27
 
opt install doc all pack just_doc: yam
28
 
        @echo 'YAM $@ (use "make $@ VERBOSE=1" for a verbose make)'
29
 
        @$(YAM) $(YAM_OPTIONS) $@
30
 
 
31
 
smartclean::
32
 
        if test -x ../boot/ocamlrun; then \
33
 
          if test -x ../ocaml; then \
34
 
            $(OCAML) build/build.ml -clean; \
35
 
          else \
36
 
            if test -x ./yam; then \
37
 
              $(YAM) $(YAM_OPTIONS) -clean; \
38
 
            else \
39
 
              $(MAKE) staticclean; \
40
 
            fi; \
41
 
          fi; \
42
 
        else \
43
 
          rm -f $(CLEANFILES); \
44
 
        fi
45
 
 
46
 
genclean: yam
47
 
        $(YAM) -genclean Makefile.clean
48
 
        (echo /Camlp4Ast.ml/d; echo w; echo q) | ed Makefile.clean
49
 
 
50
 
clean::
51
 
        rm -f yam .cache-status
52
 
        rm -f $(CLEANFILES)
53
 
        rm -f *.cm[io] build/*.cm[io]
54
 
 
55
 
YAM_OBJS=build/YaM.cmo build/camlp4_config.cmo Makefile.cmo
56
 
 
57
 
yam: $(YAM_OBJS)
58
 
        $(OCAMLC) -o yam unix.cma $(YAM_OBJS)
59
 
 
60
 
.SUFFIXES: .mli .ml .cmi .cmo
61
 
 
62
 
.mli.cmi:
63
 
        $(OCAMLC) -c $*.mli
64
 
.ml.cmo:
65
 
        $(OCAMLC) -c $*.ml
66
 
 
67
 
build/YaM.cmo: build/YaM.cmi
68
 
Makefile.cmo: build/YaM.cmi build/camlp4_config.cmo
69
 
 
70
 
uninstall:
71
 
        rm -rf "$(LIBDIR)/camlp4"
72
 
        cd "$(BINDIR)"; rm -f *camlp4*
73
 
 
74
 
depend:
75
 
 
76
 
# Normal bootstrap
77
 
 
78
 
bootstrap: backup promote clean all compare
79
 
bootstrap-debug: backup promote-debug clean all compare
80
 
 
81
 
backup restore boot-clean::
82
 
        cd boot && $(MAKE) $@
83
 
 
84
 
promote-debug:
85
 
        cp camlp4boot-debug.run boot/camlp4boot
86
 
 
87
 
promote:
88
 
        cp camlp4boot.run boot/camlp4boot
89
 
 
90
 
compare:
91
 
        @if (cmp camlp4boot.run boot/camlp4boot); \
92
 
        then echo "Fixpoint reached, bootstrap succeeded."; \
93
 
        else echo "Fixpoint not reached, try one more bootstrapping cycle."; \
94
 
        fi
95
 
 
96
 
.PHONY: clean install all uninstall backup restore boot-clean promote-debug \
97
 
        promote compare opt doc smartclean depend
98
 
 
99
 
include Makefile.clean