diff --git a/Make.rules.in b/Make.rules.in index b1ccd7c1040..c01a2b714a4 100644 --- a/Make.rules.in +++ b/Make.rules.in @@ -302,11 +302,15 @@ $(DOCSUBDIRS:%=%/__doc_html__): dummy $(DOCSUBDIRS:%=%/__doc_sgml__): dummy @cd `dirname $@` && $(MAKE) doc-sgml +$(DOCSUBDIRS:%=%/__doc_xml__): dummy + @cd `dirname $@` && $(MAKE) doc-xml + man: $(DOCSUBDIRS:%=%/__man__) doc-html: $(DOCSUBDIRS:%=%/__doc_html__) doc-sgml: $(DOCSUBDIRS:%=%/__doc_sgml__) +doc-xml: $(DOCSUBDIRS:%=%/__doc_xml__) -.PHONY: man doc-html doc-sgml $(DOCSUBDIRS:%=%/__man__) $(DOCSUBDIRS:%=%/__doc_html__) $(DOCSUBDIRS:%=%/__doc_sgml__) +.PHONY: man doc-html doc-sgml doc-xml $(DOCSUBDIRS:%=%/__man__) $(DOCSUBDIRS:%=%/__doc_html__) $(DOCSUBDIRS:%=%/__doc_sgml__) $(DOCSUBDIRS:%=%/__doc_xml__) # Misc. rules diff --git a/Makefile.in b/Makefile.in index 5d9039a3f56..7c1eb50663b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -16,6 +16,7 @@ # manpages: compile manpages for Wine API # htmlpages: compile html pages for Wine API # sgmlpages: compile sgml source for the Wine API Guide +# xmlpages: compile xml source for the Wine API Guide # Directories @@ -132,14 +133,14 @@ tags ctags: $(RM) tags (test -d .git && git ls-files '*.[chly]' '*.idl' || find -L $(TOPSRCDIR) -name '*.[ch]' -print) | xargs ctags -a -manpages htmlpages sgmlpages: dummy +manpages htmlpages sgmlpages xmlpages: dummy @cd documentation && $(MAKE) $@ distclean:: clean $(RM) config.* configure.lineno TAGS tags include/config.h include/stamp-h $(RM) -r autom4te.cache -.PHONY: manpages htmlpages sgmlpages distclean +.PHONY: manpages htmlpages sgmlpages xmlpages distclean # Makefile rules diff --git a/dlls/Makedll.rules.in b/dlls/Makedll.rules.in index 5a77d9e4a17..9c7be290e0b 100644 --- a/dlls/Makedll.rules.in +++ b/dlls/Makedll.rules.in @@ -70,7 +70,10 @@ doc-html: $(C_SRCS) dummy doc-sgml: $(C_SRCS) dummy $(C2MAN) -o $(TOPOBJDIR)/documentation/api-guide -R$(TOPOBJDIR) -C$(SRCDIR) $(INCLUDES) -Ts $(MAINSPEC:%=-w %) $(SPEC_SRCS16:%=-w %) $(C_SRCS) $(C_SRCS16) -.PHONY: man doc-html doc-sgml +doc-xml: $(C_SRCS) dummy + $(C2MAN) -o $(TOPOBJDIR)/documentation/api-guide-xml -R$(TOPOBJDIR) -C$(SRCDIR) $(INCLUDES) -Tx $(MAINSPEC:%=-w %) $(SPEC_SRCS16:%=-w %) $(C_SRCS) $(C_SRCS16) + +.PHONY: man doc-html doc-sgml doc-xml # Rules for installation diff --git a/documentation/Makefile.in b/documentation/Makefile.in index 4723a540731..ece117cd5c0 100644 --- a/documentation/Makefile.in +++ b/documentation/Makefile.in @@ -4,7 +4,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = none -INSTALLDIRS = man$(api_manext) html api-guide $(DESTDIR)$(mandir)/man$(api_manext) +INSTALLDIRS = man$(api_manext) html api-guide api-guide-xml $(DESTDIR)$(mandir)/man$(api_manext) @MAKE_RULES@ @@ -17,10 +17,13 @@ htmlpages: html dummy sgmlpages: api-guide dummy @cd $(DLLDIR) && $(MAKE) doc-sgml -.PHONY: manpages htmlpages sgmlpages install-man +xmlpages: api-guide-xml dummy + @cd $(DLLDIR) && $(MAKE) doc-xml + +.PHONY: manpages htmlpages sgmlpages xmlpages install-man install-man:: manpages $(DESTDIR)$(mandir)/man$(api_manext) for i in man$(api_manext)/*.$(api_manext); do $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/$$i; done clean:: - $(RM) -r html api-guide man$(api_manext) + $(RM) -r html api-guide api-guide-xml man$(api_manext) diff --git a/tools/c2man.pl b/tools/c2man.pl index b1fd0222f97..62d7e1759d2 100755 --- a/tools/c2man.pl +++ b/tools/c2man.pl @@ -44,7 +44,7 @@ my $opt_output_directory = "man3w"; # All default options are for nroff (man pag my $opt_manual_section = "3w"; my $opt_source_dir = ""; my $opt_wine_root_dir = ""; -my $opt_output_format = ""; # '' = nroff, 'h' = html, 's' = sgml +my $opt_output_format = ""; # '' = nroff, 'h' = html, 's' = sgml, 'x' = xml my $opt_output_empty = 0; # Non-zero = Create 'empty' comments (for every implemented function) my $opt_fussy = 1; # Non-zero = Create only if we have a RETURNS section my $opt_verbose = 0; # >0 = verbosity. Can be given multiple times (for debugging) @@ -80,7 +80,9 @@ sub output_html_index_files(); sub output_html_stylesheet(); sub output_open_api_file($); sub output_sgml_dll_file($); +sub output_xml_dll_file($); sub output_sgml_master_file($); +sub output_xml_master_file($); sub output_spec($); sub process_comment($); sub process_extra_comment($); @@ -1299,6 +1301,13 @@ sub output_spec($) output_sgml_dll_file($spec_details); return; } + + if ($opt_output_format eq "x") + { + output_xml_dll_file($spec_details); + return; + } + } # @@ -1322,6 +1331,10 @@ sub output_open_api_file($) { $output_name = $output_name.".sgml"; } + elsif ($opt_output_format eq "x") + { + $output_name = $output_name.".xml"; + } else { $output_name = $output_name.".".$opt_manual_section; @@ -1350,7 +1363,7 @@ sub output_api_header($) print OUTPUT "{COMMENT_NAME}\">\n"; print OUTPUT "