Commit abc62981 authored by Alexandre Julliard's avatar Alexandre Julliard

makefiles: Add support for parent source directory in c2man.

parent 0fba32f1
...@@ -108,17 +108,17 @@ all: $(MANPAGES:.man.in=.man) ...@@ -108,17 +108,17 @@ all: $(MANPAGES:.man.in=.man)
# Rules for auto documentation # Rules for auto documentation
manpages:: $(C_SRCS) dummy manpages:: dummy
$(C2MAN) -o $(top_builddir)/documentation/man$(api_manext) -R$(top_builddir) -C$(srcdir) $(INCLUDES) -S$(api_manext) $(MAINSPEC:%=-w %) $(C_SRCS) $(C2MAN) -o $(top_builddir)/documentation/man$(api_manext) -R$(top_builddir) -C$(srcdir) $(PARENTSRC:%=-P%) -I$(top_srcdir)/include $(MAINSPEC:%=-w %) $(C_SRCS)
htmlpages:: $(C_SRCS) dummy htmlpages:: dummy
$(C2MAN) -o $(top_builddir)/documentation/html -R$(top_builddir) -C$(srcdir) $(INCLUDES) -Th $(MAINSPEC:%=-w %) $(C_SRCS) $(C2MAN) -o $(top_builddir)/documentation/html -R$(top_builddir) -C$(srcdir) $(PARENTSRC:%=-P%) -I$(top_srcdir)/include -Th $(MAINSPEC:%=-w %) $(C_SRCS)
sgmlpages:: $(C_SRCS) dummy sgmlpages:: dummy
$(C2MAN) -o $(top_builddir)/documentation/api-guide -R$(top_builddir) -C$(srcdir) $(INCLUDES) -Ts $(MAINSPEC:%=-w %) $(C_SRCS) $(C2MAN) -o $(top_builddir)/documentation/api-guide -R$(top_builddir) -C$(srcdir) $(PARENTSRC:%=-P%) -I$(top_srcdir)/include -Ts $(MAINSPEC:%=-w %) $(C_SRCS)
xmlpages:: $(C_SRCS) dummy xmlpages:: dummy
$(C2MAN) -o $(top_builddir)/documentation/api-guide-xml -R$(top_builddir) -C$(srcdir) $(INCLUDES) -Tx $(MAINSPEC:%=-w %) $(C_SRCS) $(C2MAN) -o $(top_builddir)/documentation/api-guide-xml -R$(top_builddir) -C$(srcdir) $(PARENTSRC:%=-P%) -I$(top_srcdir)/include -Tx $(MAINSPEC:%=-w %) $(C_SRCS)
# Rules for cleaning # Rules for cleaning
......
...@@ -48,7 +48,8 @@ my $EXPORT_FLAGS = 4; # Flags - see above. ...@@ -48,7 +48,8 @@ my $EXPORT_FLAGS = 4; # Flags - see above.
# Options # Options
my $opt_output_directory = "man3w"; # All default options are for nroff (man pages) my $opt_output_directory = "man3w"; # All default options are for nroff (man pages)
my $opt_manual_section = "3w"; my $opt_manual_section = "3w";
my $opt_source_dir = ""; my $opt_source_dir = ".";
my $opt_parent_dir = "";
my $opt_wine_root_dir = ""; my $opt_wine_root_dir = "";
my $opt_output_format = ""; # '' = nroff, 'h' = html, 's' = sgml, 'x' = xml 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_output_empty = 0; # Non-zero = Create 'empty' comments (for every implemented function)
...@@ -251,8 +252,10 @@ sub process_source_file($) ...@@ -251,8 +252,10 @@ sub process_source_file($)
print "Processing ".$source_file."\n"; print "Processing ".$source_file."\n";
} }
open(SOURCE_FILE,"<$source_file") open(SOURCE_FILE,"<$source_file")
|| (($opt_source_dir ne "") || (($opt_source_dir ne ".")
&& open(SOURCE_FILE,"<$opt_source_dir/$source_file")) && open(SOURCE_FILE,"<$opt_source_dir/$source_file"))
|| (($opt_parent_dir ne "")
&& open(SOURCE_FILE,"<$opt_source_dir/$opt_parent_dir/$source_file"))
|| die "couldn't open ".$source_file."\n"; || die "couldn't open ".$source_file."\n";
# Add this source file to the list of source files # Add this source file to the list of source files
...@@ -2241,7 +2244,8 @@ sub usage() ...@@ -2241,7 +2244,8 @@ sub usage()
" -Ts : Output SGML (DocBook source) instead of a man page\n", " -Ts : Output SGML (DocBook source) instead of a man page\n",
" -C <dir> : Source directory, to find source files if they are not found in the\n", " -C <dir> : Source directory, to find source files if they are not found in the\n",
" current directory. Default is \"",$opt_source_dir,"\"\n", " current directory. Default is \"",$opt_source_dir,"\"\n",
" -R <dir> : Root of build directory, default is \"",$opt_wine_root_dir,"\"\n", " -P <dir> : Parent source directory.\n",
" -R <dir> : Root of build directory.\n",
" -o <dir> : Create output in <dir>, default is \"",$opt_output_directory,"\"\n", " -o <dir> : Create output in <dir>, default is \"",$opt_output_directory,"\"\n",
" -s <sect>: Set manual section to <sect>, default is ",$opt_manual_section,"\n", " -s <sect>: Set manual section to <sect>, default is ",$opt_manual_section,"\n",
" -e : Output \"FIXME\" documentation from empty comments.\n", " -e : Output \"FIXME\" documentation from empty comments.\n",
...@@ -2291,6 +2295,10 @@ while(defined($_ = shift @ARGV)) ...@@ -2291,6 +2295,10 @@ while(defined($_ = shift @ARGV))
if ($_ ne "") { $opt_source_dir = $_; } if ($_ ne "") { $opt_source_dir = $_; }
last; last;
}; };
s/^P// && do {
if ($_ ne "") { $opt_parent_dir = $_; }
last;
};
s/^R// && do { if ($_ =~ /^\//) { $opt_wine_root_dir = $_; } s/^R// && do { if ($_ =~ /^\//) { $opt_wine_root_dir = $_; }
else { $opt_wine_root_dir = `cd $pwd/$_ && pwd`; } else { $opt_wine_root_dir = `cd $pwd/$_ && pwd`; }
$opt_wine_root_dir =~ s/\n//; $opt_wine_root_dir =~ s/\n//;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment