Alexandre Julliard : makedep: Generate rules for API documentation.

Alexandre Julliard julliard at winehq.org
Tue Dec 31 11:11:43 CST 2013


Module: wine
Branch: master
Commit: 6ee09e4d3cece7ad08212cca76bbabad00e8c51b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6ee09e4d3cece7ad08212cca76bbabad00e8c51b

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Dec 30 20:23:16 2013 +0100

makedep: Generate rules for API documentation.

---

 configure       |   11 -----------
 configure.ac    |   11 -----------
 tools/makedep.c |   41 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 41 insertions(+), 22 deletions(-)

diff --git a/configure b/configure
index 5b2f013..925ead3 100755
--- a/configure
+++ b/configure
@@ -16555,17 +16555,6 @@ fi
 
 MAKE_DLL_RULES="
 DLLFLAGS    = $DLLFLAGS
-MAINSPEC    = \$(srcdir)/\$(MODULE:%.dll=%).spec
-
-manpages:: dummy
-	\$(C2MAN) -o \$(top_builddir)/documentation/man\$(api_manext) -R\$(top_builddir) -C\$(srcdir) \$(PARENTSRC:%=-P%) -I\$(top_srcdir)/include \$(MAINSPEC:%=-w %) \$(C_SRCS)
-htmlpages:: dummy
-	\$(C2MAN) -o \$(top_builddir)/documentation/html -R\$(top_builddir) -C\$(srcdir) \$(PARENTSRC:%=-P%) -I\$(top_srcdir)/include -Th \$(MAINSPEC:%=-w %) \$(C_SRCS)
-sgmlpages:: dummy
-	\$(C2MAN) -o \$(top_builddir)/documentation/api-guide -R\$(top_builddir) -C\$(srcdir) \$(PARENTSRC:%=-P%) -I\$(top_srcdir)/include -Ts \$(MAINSPEC:%=-w %) \$(C_SRCS)
-xmlpages:: dummy
-	\$(C2MAN) -o \$(top_builddir)/documentation/api-guide-xml -R\$(top_builddir) -C\$(srcdir) \$(PARENTSRC:%=-P%) -I\$(top_srcdir)/include -Tx \$(MAINSPEC:%=-w %) \$(C_SRCS)
-.PHONY: manpages htmlpages sgmlpages xmlpages
 "
 
 
diff --git a/configure.ac b/configure.ac
index 74950e3..e83cbd1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2614,17 +2614,6 @@ dnl Dll and program rules
 
 AC_SUBST(MAKE_DLL_RULES,"
 DLLFLAGS    = $DLLFLAGS
-MAINSPEC    = \$(srcdir)/\$(MODULE:%.dll=%).spec
-
-manpages:: dummy
-	\$(C2MAN) -o \$(top_builddir)/documentation/man\$(api_manext) -R\$(top_builddir) -C\$(srcdir) \$(PARENTSRC:%=-P%) -I\$(top_srcdir)/include \$(MAINSPEC:%=-w %) \$(C_SRCS)
-htmlpages:: dummy
-	\$(C2MAN) -o \$(top_builddir)/documentation/html -R\$(top_builddir) -C\$(srcdir) \$(PARENTSRC:%=-P%) -I\$(top_srcdir)/include -Th \$(MAINSPEC:%=-w %) \$(C_SRCS)
-sgmlpages:: dummy
-	\$(C2MAN) -o \$(top_builddir)/documentation/api-guide -R\$(top_builddir) -C\$(srcdir) \$(PARENTSRC:%=-P%) -I\$(top_srcdir)/include -Ts \$(MAINSPEC:%=-w %) \$(C_SRCS)
-xmlpages:: dummy
-	\$(C2MAN) -o \$(top_builddir)/documentation/api-guide-xml -R\$(top_builddir) -C\$(srcdir) \$(PARENTSRC:%=-P%) -I\$(top_srcdir)/include -Tx \$(MAINSPEC:%=-w %) \$(C_SRCS)
-.PHONY: manpages htmlpages sgmlpages xmlpages
 ")
 
 AC_SUBST(MAKE_PROG_RULES,"
diff --git a/tools/makedep.c b/tools/makedep.c
index a9b4d6b..136b5ce 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -1375,6 +1375,7 @@ static struct strarray output_sources(void)
     struct strarray mc_files = empty_strarray;
     struct strarray test_files = empty_strarray;
     struct strarray dlldata_files = empty_strarray;
+    struct strarray c2man_files = empty_strarray;
     struct strarray implib_objs = empty_strarray;
     struct strarray includes = empty_strarray;
     struct strarray subdirs = empty_strarray;
@@ -1609,6 +1610,8 @@ static struct strarray output_sources(void)
                 output( "\t$(RUNTEST) $(RUNTESTFLAGS) -T %s -M %s -p %s%s %s && touch $@\n", top_obj_dir,
                         testdll, replace_extension( testdll, ".dll", "_test.exe" ), dllext, obj );
             }
+            if (!strcmp( ext, "c" ) && !(source->flags & FLAG_GENERATED))
+                strarray_add( &c2man_files, source->filename );
             for (i = 0; i < object_extensions.count; i++)
                 output( "%s.%s ", obj, object_extensions.str[i] );
             if (source->flags & FLAG_C_IMPLIB) output( "%s.cross.o", obj );
@@ -1749,6 +1752,44 @@ static struct strarray output_sources(void)
                 output( "\n" );
             }
         }
+
+        if (spec_file)
+        {
+            if (c2man_files.count && top_obj_dir)
+            {
+                char *manext = get_expanded_make_variable( "api_manext" );
+
+                output( "manpages::\n" );
+                output( "\t$(C2MAN) -w %s -R%s", spec_file, top_obj_dir );
+                output_filename( strmake( "-I%s/include", top_src_dir ? top_src_dir : top_obj_dir ));
+                output_filename( strmake( "-o %s/documentation/man%s", top_obj_dir, manext ? manext : "3w" ));
+                output_filenames( c2man_files );
+                output( "\n" );
+                output( "htmlpages::\n" );
+                output( "\t$(C2MAN) -Th -w %s -R%s", spec_file, top_obj_dir );
+                output_filename( strmake( "-I%s/include", top_src_dir ? top_src_dir : top_obj_dir ));
+                output_filename( strmake( "-o %s/documentation/html", top_obj_dir ));
+                output_filenames( c2man_files );
+                output( "\n" );
+                output( "sgmlpages::\n" );
+                output( "\t$(C2MAN) -Ts -w %s -R%s", spec_file, top_obj_dir );
+                output_filename( strmake( "-I%s/include", top_src_dir ? top_src_dir : top_obj_dir ));
+                output_filename( strmake( "-o %s/documentation/api-guide", top_obj_dir ));
+                output_filenames( c2man_files );
+                output( "\n" );
+                output( "xmlpages::\n" );
+                output( "\t$(C2MAN) -Tx -w %s -R%s", spec_file, top_obj_dir );
+                output_filename( strmake( "-I%s/include", top_src_dir ? top_src_dir : top_obj_dir ));
+                output_filename( strmake( "-o %s/documentation/api-guide-xml", top_obj_dir ));
+                output_filenames( c2man_files );
+                output( "\n" );
+                strarray_add( &phony_targets, "manpages" );
+                strarray_add( &phony_targets, "htmlpages" );
+                strarray_add( &phony_targets, "sgmlpages" );
+                strarray_add( &phony_targets, "xmlpages" );
+            }
+            else output( "manpages htmlpages sgmlpages xmlpages::\n" );
+        }
     }
 
     if (staticlib)




More information about the wine-cvs mailing list