~ubuntu-branches/ubuntu/wily/coq-doc/wily

« back to all changes in this revision

Viewing changes to dev/tools/Makefile.dir

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu, Stéphane Glondu, Samuel Mimram
  • Date: 2010-01-07 22:50:39 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100107225039-n3cq82589u0qt0s2
Tags: 8.2pl1-1
[ Stéphane Glondu ]
* New upstream release (Closes: #563669)
  - remove patches
* Packaging overhaul:
  - use git, advertise it in Vcs-* fields of debian/control
  - use debhelper 7 and dh with override
  - use source format 3.0 (quilt)
* debian/control:
  - set Maintainer to d-o-m, set Uploaders to Sam and myself
  - add Homepage field
  - bump Standards-Version to 3.8.3
* Register PDF documentation into doc-base
* Add debian/watch
* Update debian/copyright

[ Samuel Mimram ]
* Change coq-doc's description to mention that it provides documentation in
  pdf format, not postscript, closes: #543545.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# make a link to this file if you are working hard in one directory of Coq
 
2
#   ln -s ../dev/tools/Makefile.dir Makefile
 
3
# if you are working in a sub/dir/ make a link to dev/tools/Makefile.subdir instead
 
4
# this Makefile provides many useful facilities to develop Coq
 
5
# it is not completely compatible with .ml4 files unfortunately
 
6
 
 
7
ifndef TOPDIR
 
8
TOPDIR=..
 
9
endif
 
10
 
 
11
# this complicated thing should work for subsubdirs as well
 
12
BASEDIR=$(shell (dir=`pwd`; cd $(TOPDIR); top=`pwd`; echo $$dir | sed -e "s|$$top/||"))
 
13
 
 
14
noargs: dir
 
15
 
 
16
test-dir:
 
17
        @echo TOPDIR=$(TOPDIR)
 
18
        @echo BASEDIR=$(BASEDIR)
 
19
 
 
20
include $(TOPDIR)/dev/tools/Makefile.common
 
21
 
 
22
# make this directory
 
23
dir:
 
24
        $(MAKE) -C $(TOPDIR) $(notdir $(BASEDIR))
 
25
 
 
26
# make all cmo's in this directory. Useful in case the main Makefile is not
 
27
# up-to-date
 
28
all:    
 
29
        @( ( for i in *.ml; do \
 
30
               echo -n $(BASEDIR)/`basename $$i .ml`.cmo "" ; \
 
31
             done; \
 
32
             for i in *.ml4; do \
 
33
               echo -n $(BASEDIR)/`basename $$i .ml4`.cmo "" ; \
 
34
             done ) \
 
35
          | xargs $(MAKE) -C $(TOPDIR) )
 
36
 
 
37
# lists all files that should be compiled in this directory
 
38
list:
 
39
        @(for i in *.mli; do \
 
40
           ls -l `basename $$i .mli`.cmi; \
 
41
        done)
 
42
        @(for i in *.ml; do \
 
43
           ls -l `basename $$i .ml`.cmo; \
 
44
        done)
 
45
        @(for i in *.ml4; do \
 
46
           ls -l `basename $$i .ml4`.cmo; \
 
47
        done)
 
48
 
 
49
 
 
50
clean::  
 
51
        rm -f *.cmi *.cmo *.cmx *.o
 
52
 
 
53
 
 
54
# if grammar.cmo files cannot be compiled and main .depend cannot be
 
55
# rebuilt, this is quite useful
 
56
depend:
 
57
        (cd $(TOPDIR); ocamldep -I $(BASEDIR) $(BASEDIR)/*.ml $(BASEDIR)/*.mli > .depend.devel)
 
58
 
 
59
 
 
60
# displays the dependency graph of the current directory (vertically,
 
61
# unlike in doc/)
 
62
graph:
 
63
        (ocamldep *.ml *.mli | ocamldot | dot -Tps | gv -) &
 
64
 
 
65
 
 
66
# the pretty entry draws a dependency graph marking red those nodes
 
67
# which do not have their .cmo files 
 
68
 
 
69
.INTERMEDIATE: depend.dot depend.2.dot
 
70
.PHONY: depend.ps
 
71
 
 
72
depend.dot:
 
73
        ocamldep *.ml *.mli | ocamldot > $@
 
74
 
 
75
depend.2.dot:   depend.dot
 
76
        (i=`cat $< | wc -l`; i=`expr $$i - 1`; head -n $$i $<) > $@
 
77
        (for ml in *.ml; do \
 
78
           base=`basename $$ml .ml`; \
 
79
           fst=`echo $$base | cut -c1 | tr [:lower:] [:upper:]`; \
 
80
           rest=`echo $$base | cut -c2-`; \
 
81
           name=`echo $$fst $$rest | tr -d " "`; \
 
82
           cmo=$$base.cmo; \
 
83
           if [ ! -e $$cmo ]; then \
 
84
             echo \"$$name\" [color=red]\; >> $@;\
 
85
           fi;\
 
86
         done;\
 
87
         echo } >> $@)
 
88
 
 
89
depend.ps:      depend.2.dot
 
90
        dot -Tps $< > $@
 
91
 
 
92
clean::
 
93
        rm -f depend.ps
 
94
 
 
95
pretty: depend.ps
 
96
        (gv -spartan $<; rm $<) &
 
97
#       gv -spartan $< &
 
98
 
 
99
 
 
100
 
 
101
# generating file.ml.mli by tricking make to pass -i to ocamlc 
 
102
 
 
103
%.ml.mli:       FORCE
 
104
        @(cmo=`basename $@ .ml.mli`.cmo ; \
 
105
        mv -f $$cmo $$cmo.tmp ; \
 
106
        $(MAKE) -s -C $(TOPDIR) $(BASEDIR)/$$cmo CAMLDEBUG=-i > $@ ; \
 
107
        echo Generated interface file $@ ; \
 
108
        mv -f $$cmo.tmp $$cmo)
 
109
 
 
110
%.annot:        FORCE
 
111
        @(cmo=`basename $@ .annot`.cmo ; \
 
112
        mv -f $$cmo $$cmo.tmp ; \
 
113
        $(MAKE) -s -C $(TOPDIR) $(BASEDIR)/$$cmo CAMLDEBUG=-dtypes ; \
 
114
        echo Generated annotation file $@ ; \
 
115
        mv -f $$cmo.tmp $$cmo)
 
116
 
 
117
FORCE:
 
118
 
 
119
clean::
 
120
        rm -f *.ml.mli
 
121
 
 
122
# this is not perfect but mostly WORKS! It just calls the main makefile
 
123
 
 
124
%.cmi:  FORCE
 
125
        $(MAKE) -C $(TOPDIR) $(BASEDIR)/$@
 
126
 
 
127
%.cmo:  FORCE
 
128
        $(MAKE) -C $(TOPDIR) $(BASEDIR)/$@
 
129
 
 
130
coqtop: 
 
131
        $(MAKE) -C $(TOPDIR) bin/coqtop.byte