|
1 # This Source Code Form is subject to the terms of the Mozilla Public |
|
2 # License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
|
4 |
|
5 include $(topsrcdir)/config/rules.mk |
|
6 |
|
7 DUMP_CLASSES = \ |
|
8 nsAString_internal \ |
|
9 nsACString_internal \ |
|
10 $(NULL) |
|
11 |
|
12 SPACE = $(NULL) $(NULL) |
|
13 COMMA = , |
|
14 |
|
15 HGREV = $(shell hg -R $(topsrcdir) id -i) |
|
16 |
|
17 classapi: DEHYDRA_MODULES = $(srcdir)/type-printer.js |
|
18 classapi: TREEHYDRA_MODULES = |
|
19 classapi: DEHYDRA_ARGS += --dump-types=$(subst $(SPACE),$(COMMA),$(strip $(DUMP_CLASSES))) --rev=$(HGREV) |
|
20 classapi: $(call mkdir_deps,$(MDDEPDIR)) |
|
21 $(CCC) $(OUTOPTION)/dev/null -c $(COMPILE_CXXFLAGS) $(srcdir)/type-printer.cpp >classapi.out 2>&1 |
|
22 perl -e 'while (<>) {if (/DUMP-TYPE\((.*)\)/) {print "$$1 ";}}' <classapi.out >dumptypes.list |
|
23 perl -e 'while (<>) {if (/GRAPH-TYPE\((.*)\)/) {print "$$1 ";}}' <classapi.out >graphtypes.list |
|
24 $(EXIT_ON_ERROR) \ |
|
25 for class in `cat graphtypes.list`; do \ |
|
26 dot -Tpng -o$${class}-graph.png -Tcmapx -o$${class}-graph.map $${class}-graph.gv; \ |
|
27 done |
|
28 $(EXIT_ON_ERROR) \ |
|
29 for class in `cat dumptypes.list`; do \ |
|
30 $(PYTHON) $(srcdir)/fix-srcrefs.py $(topsrcdir) < $${class}.html > $${class}-fixed.html; \ |
|
31 done |
|
32 |
|
33 upload_classapi: |
|
34 $(EXIT_ON_ERROR) \ |
|
35 for class in `cat dumptypes.list`; do \ |
|
36 $(PYTHON) $(srcdir)/MDC-upload.py $${class}-fixed.html en/$${class}; \ |
|
37 done |
|
38 $(EXIT_ON_ERROR) \ |
|
39 for class in `cat graphtypes.list`; do \ |
|
40 $(PYTHON) $(srcdir)/MDC-attach.py $${class}-graph.png en/$${class} image/png 'Class inheritance graph'; \ |
|
41 done |
|
42 |
|
43 GARBAGE += $(wildcard *.html) $(wildcard *.png) $(wildcard *.map) \ |
|
44 $(wildcard *.gv) classapi.out graphtypes.list dumptypes.list |