michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: include $(topsrcdir)/config/rules.mk michael@0: michael@0: DUMP_CLASSES = \ michael@0: nsAString_internal \ michael@0: nsACString_internal \ michael@0: $(NULL) michael@0: michael@0: SPACE = $(NULL) $(NULL) michael@0: COMMA = , michael@0: michael@0: HGREV = $(shell hg -R $(topsrcdir) id -i) michael@0: michael@0: classapi: DEHYDRA_MODULES = $(srcdir)/type-printer.js michael@0: classapi: TREEHYDRA_MODULES = michael@0: classapi: DEHYDRA_ARGS += --dump-types=$(subst $(SPACE),$(COMMA),$(strip $(DUMP_CLASSES))) --rev=$(HGREV) michael@0: classapi: $(call mkdir_deps,$(MDDEPDIR)) michael@0: $(CCC) $(OUTOPTION)/dev/null -c $(COMPILE_CXXFLAGS) $(srcdir)/type-printer.cpp >classapi.out 2>&1 michael@0: perl -e 'while (<>) {if (/DUMP-TYPE\((.*)\)/) {print "$$1 ";}}' dumptypes.list michael@0: perl -e 'while (<>) {if (/GRAPH-TYPE\((.*)\)/) {print "$$1 ";}}' graphtypes.list michael@0: $(EXIT_ON_ERROR) \ michael@0: for class in `cat graphtypes.list`; do \ michael@0: dot -Tpng -o$${class}-graph.png -Tcmapx -o$${class}-graph.map $${class}-graph.gv; \ michael@0: done michael@0: $(EXIT_ON_ERROR) \ michael@0: for class in `cat dumptypes.list`; do \ michael@0: $(PYTHON) $(srcdir)/fix-srcrefs.py $(topsrcdir) < $${class}.html > $${class}-fixed.html; \ michael@0: done michael@0: michael@0: upload_classapi: michael@0: $(EXIT_ON_ERROR) \ michael@0: for class in `cat dumptypes.list`; do \ michael@0: $(PYTHON) $(srcdir)/MDC-upload.py $${class}-fixed.html en/$${class}; \ michael@0: done michael@0: $(EXIT_ON_ERROR) \ michael@0: for class in `cat graphtypes.list`; do \ michael@0: $(PYTHON) $(srcdir)/MDC-attach.py $${class}-graph.png en/$${class} image/png 'Class inheritance graph'; \ michael@0: done michael@0: michael@0: GARBAGE += $(wildcard *.html) $(wildcard *.png) $(wildcard *.map) \ michael@0: $(wildcard *.gv) classapi.out graphtypes.list dumptypes.list