add documentation make target, fix docu bugs
authorMatthias Braun <matze@braunis.de>
Fri, 9 Dec 2011 18:48:47 +0000 (19:48 +0100)
committerMatthias Braun <matze@braunis.de>
Fri, 9 Dec 2011 18:50:21 +0000 (19:50 +0100)
Doxyfile
Makefile
include/libfirm/irflag.h
include/libfirm/irmode.h
include/libfirm/iroptimize.h
scripts/gen_docu.py

index 6201bb9..9f582fe 100644 (file)
--- a/Doxyfile
+++ b/Doxyfile
@@ -515,7 +515,7 @@ LAYOUT_FILE            =
 # The QUIET tag can be used to turn on/off the messages that are generated
 # by doxygen. Possible values are YES and NO. If left blank NO is used.
 
-QUIET                  = NO
+QUIET                  = YES
 
 # The WARNINGS tag can be used to turn on/off the warning messages that are
 # generated by doxygen. Possible values are YES and NO. If left blank
@@ -1302,7 +1302,7 @@ TAGFILES               =
 # When a file name is specified after GENERATE_TAGFILE, doxygen will create
 # a tag file that is based on the input files it reads.
 
-GENERATE_TAGFILE       = libfirm.tag
+GENERATE_TAGFILE       = firm-doc/libfirm.tag
 
 # If the ALLEXTERNALS tag is set to YES all external classes will be listed
 # in the class index. If set to NO only the inherited external classes
index 745b737..66f91d1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,7 @@ builddir     ?= $(top_builddir)/$(variant)
 Q ?= @
 
 CC ?= cc
+DOXYGEN ?= doxygen
 LINK ?= $(CC)
 AR ?= ar
 DLLEXT ?= .so
@@ -176,9 +177,23 @@ $(builddir)/%.o: %.c $(IR_SPEC_GENERATED_FILES) config.h
        @echo CC $@
        $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) $(libfirm_CPPFLAGS) -MMD -c -o $@ $<
 
+firm-doc/libfirm.tag: $(IR_SPEC_GENERATED_FILES) Doxyfile $(wildcard include/libfirm/*.h) $(wildcard include/libfirm/adt/*.h)
+       @echo Doxygen
+       $(Q)$(DOXYGEN)
+
+DOCU_GENERATOR := scripts/gen_docu.py
+firm-doc/html/nodes.html: firm-doc/libfirm.tag $(DOCU_GENERATOR) $(IR_SPEC) scripts/spec_util.py scripts/style.css
+       @echo gen_docu.py
+       $(Q)$(DOCU_GENERATOR) firm-doc/libfirm.tag "" $@
+       $(Q)cp scripts/style.css firm-doc/html
+
+.PHONY: documentation
+documentation: firm-doc/libfirm.tag firm-doc/html/nodes.html
+
 .PHONY: clean
 clean:
        @echo CLEAN
        $(Q)rm -f $(libfirm_OBJECTS)
        $(Q)rm -f $(libfirm_TARGET)
        $(Q)rm -f $(shell find ir/ -name "gen_*.[ch]")
+       $(Q)rm -rf firm-docu
index 0f64b76..32161c4 100644 (file)
@@ -162,7 +162,7 @@ FIRM_API void all_optimizations_off(void);
 /** @} */
 
 /** @ingroup irverify
- * @defgroup Flags
+ * @defgroup irverify_flags Flags
  * Enable/Disable automatic correctness tests
  * @{
  */
index 6e31f84..49b0e8b 100644 (file)
@@ -64,10 +64,9 @@ typedef enum ir_mode_arithmetic {
  * Creates a new mode.
  *
  * @param name          the name of the mode to be created
- * @param sort          the ir_mode_sort of the mode to be created
+ * @param arithmetic    arithmetic operations possible with a mode
  * @param bit_size      number of bits this mode allocate
  * @param sign          non-zero if this is a signed mode
- * @param arithmetic    arithmetic operations possible with a mode
  * @param modulo_shift  Is ignored for modes other than integer.
  *
  * This function constructs a new mode given by the parameters.
index 1aeadfc..e4cb72f 100644 (file)
@@ -1093,7 +1093,7 @@ typedef ir_entity *(*compilerlib_entity_creator_t)(ident *id, ir_type *mt);
  *
  * @param cb  the new compilerlib entity creation callback
  */
-FIRM_API void set_compilerlib_entity_creator(compilerlib_entity_creator_t c);
+FIRM_API void set_compilerlib_entity_creator(compilerlib_entity_creator_t cb);
 
 /**
  * Get the compilerlib entity creation callback.
index b5f3153..818e41c 100755 (executable)
@@ -26,7 +26,7 @@ def format_doxygrouplink(string, link=None):
        if len(anchorfile) == 0:
                return string
        global linkbase
-       return "<a href=\"%s/%s\">%s</a>" % (linkbase, anchorfile[0], string)
+       return "<a href=\"%s%s\">%s</a>" % (linkbase, anchorfile[0], string)
 
 def format_doxylink(string, link=None):
        global tags
@@ -43,7 +43,7 @@ def format_doxylink(string, link=None):
        if len(anchorfile) == 0 or len(anchor) == 0:
                return string
        global linkbase
-       return "<a href=\"%s/%s#%s\">%s</a>" % (linkbase, anchorfile[0], anchor[0], string)
+       return "<a href=\"%s%s#%s\">%s</a>" % (linkbase, anchorfile[0], anchor[0], string)
 
 def format_docutils(string):
        writer = docutils.writers.html4css1.Writer()
@@ -153,6 +153,8 @@ def main(argv):
                tagfile = open(argv[-3], "r")
                global linkbase
                linkbase = argv[-2]
+               if linkbase != "":
+                       linkbase += "/"
                try:
                        from lxml import etree
                        tags = etree.parse(tagfile)