Runtime documentation will now build with srcdir != builddir
authorMiguel de Icaza <miguel@gnome.org>
Wed, 16 Apr 2014 16:08:57 +0000 (12:08 -0400)
committerMiguel de Icaza <miguel@gnome.org>
Wed, 16 Apr 2014 16:09:20 +0000 (12:09 -0400)
This removes an old and broken patch that did not allow for
clean builds of Mono.   The old patch was so bad, that instead
of fixing the actual source of the problem (the ability to build
the runtime documentation when the source directory was not the
same as the build directory), a hack was added to circumvent
`make distcheck''s security system and changed the permissions
at build time for the source directory to become read/write.

This fixes the problem

docs/Makefile.am
docs/docs.make
docs/exdoc

index c0450027cfd9498e0990bdfe2dd93d483c5329a5..abb659f778d60c341b11159a87d580ca3ec6132f 100644 (file)
@@ -73,41 +73,40 @@ dist-hook:
        cp HtmlAgilityPack/*     $(distdir)/HtmlAgilityPack
 
 clean-local:
-       -rm -Rf $(srcdir)/html
-       -rm -f $(srcdir)/deploy/* $(srcdir)/convert.exe* $(srcdir)/AgilityPack.dll*
-       -cd $(srcdir) && rm -f $(ASSEMBLED_DOCS)
+       -rm -Rf html
+       -rm -f deploy/* convert.exe* AgilityPack.dll*
+       -rm -f $(ASSEMBLED_DOCS)
+
+TOOL_MAKE=$(MAKE) -f $(srcdir)/docs.make topdir=$(srcdir)/../mcs srcdir=$(srcdir)
 
 monoapi.zip: monoapi.tree
-       @test -f $@ || { rm -f $(srcdir)/monoapi.tree && $(MAKE) monoapi.tree; }
-monoapi.tree: docs.make Makefile.am toc.xml $(srcdir)/deploy/.stamp perms
-       cd $(srcdir) && cp -f api-style.css deploy
-       cd $(srcdir) && $(MAKE) -f docs.make topdir=$(mcs_topdir_from_srcdir) $@
+
+monoapi.tree: $(srcdir)/docs.make $(srcdir)/Makefile.am $(srcdir)/toc.xml $(srcdir)/deploy/.stamp 
+       -mkdir deploy
+       cp -f $(srcdir)/api-style.css deploy
+       $(TOOL_MAKE) $@
 
 mono-tools.zip: mono-tools.tree
-       @test -f $@ || { rm -f $(srcdir)/mono-tools.tree && $(MAKE) mono-tools.tree; }
-mono-tools.tree: docs.make Makefile.am $(srcdir)/deploy/.stamp perms
-       cd $(srcdir) && $(MAKE) -f docs.make topdir=$(mcs_topdir_from_srcdir) $@
 
-mono-file-formats.zip: mono-file-formats.tree perms
-       @test -f $@ || { rm -f $(srcdir)/mono-file-formats.tree && $(MAKE) mono-file-formats.tree; }
-mono-file-formats.tree: docs.make Makefile.am $(srcdir)/deploy/.stamp
-       cd $(srcdir) && $(MAKE) -f docs.make topdir=$(mcs_topdir_from_srcdir) $@
+mono-tools.tree: $(srcdir)/docs.make Makefile.am deploy/.stamp 
+       $(TOOL_MAKE) $@
+
+mono-file-formats.zip: mono-file-formats.tree 
 
-$(srcdir)/deploy/.stamp: convert.exe Makefile.am perms
-       $(mkdir_p) $(srcdir)/html
+mono-file-formats.tree: $(srcdir)/docs.make $(srcdir)/Makefile.am $(srcdir)/deploy/.stamp
+       $(TOOL_MAKE) $@
+
+deploy/.stamp: convert.exe Makefile.am 
+       $(mkdir_p) html
        runtimedir=`cd ../runtime && pwd`; export runtimedir; \
-       cd $(srcdir) && MONO_PATH=$(mcs_topdir_from_srcdir)/class/lib/net_2_0 perl ./exdoc -h . ../mono/*/*.c
+       MONO_PATH=../mcs/class/lib/net_2_0 perl $(srcdir)/exdoc -h $(srcdir) -t . $(srcdir)/../mono/*/*.c
        touch $@
 
-extract: $(srcdir)/deploy/.stamp
-
-convert.exe: convert.cs AgilityPack.dll perms
-       cd $(srcdir) && $(MAKE) PROFILE=net_2_0 -f docs.make topdir=$(mcs_topdir_from_srcdir) convert.exe
+extract: deploy/.stamp
 
-AgilityPack.dll: perms
-       cd $(srcdir) && $(MAKE) PROFILE=net_2_0 -f docs.make topdir=$(mcs_topdir_from_srcdir) AgilityPack.dll
+convert.exe: convert.cs AgilityPack.dll
+       $(TOOL_MAKE) PROFILE=net_2_0 convert.exe
 
-.PHONY: perms
-perms:
-       -@test -w $(srcdir) || chmod a+w $(srcdir)
+AgilityPack.dll: 
+       $(TOOL_MAKE) PROFILE=net_2_0 AgilityPack.dll
 
index 7129bcadfc47a43ddae2a8a8209bf3bf9c8d2d9e..4f2d964e5b93f89ff144f23bd9c4180869f9bf89 100644 (file)
@@ -1,3 +1,8 @@
+#
+# This makefile is here because it uses the configuration from the
+# in-place built mono to run and compile a few C# tools
+#
+
 thisdir = docs
 SUBDIRS = 
 include $(topdir)/build/rules.make
@@ -7,25 +12,28 @@ ASSEMBLED_DOCS = \
        mono-tools.tree mono-tools.zip                \
        monoapi.tree monoapi.zip
 
-convert.exe: convert.cs AgilityPack.dll
+convert.exe: $(srcdir)/convert.cs AgilityPack.dll
        $(CSCOMPILE) -out:$@ $< -r:AgilityPack.dll
 
 AgilityPack.dll:
-       $(CSCOMPILE) -target:library -out:$@ HtmlAgilityPack/*.cs
+       $(CSCOMPILE) -target:library -out:$@ $(srcdir)/HtmlAgilityPack/*.cs
 
 monoapi.zip: monoapi.tree
        @test -f $@ || { rm -f $< && $(MAKE) $<; }
-monoapi.tree: toc.xml docs.make
+
+monoapi.tree: $(srcdir)/toc.xml $(srcdir)/docs.make
        $(MDOC) assemble -o monoapi -f hb $<
 
 mono-tools.zip: mono-tools.tree
        @test -f $@ || { rm -f $< && $(MAKE) $<; }
-mono-tools.tree: mono-tools.config docs.make
+
+mono-tools.tree: $(srcdir)/mono-tools.config $(srcdir)/docs.make
        $(MDOC) assemble -o mono-tools -f man $<
 
 mono-file-formats.zip: mono-file-formats.tree
        @test -f $@ || { rm -f $< && $(MAKE) $<; }
-mono-file-formats.tree: mono-file-formats.config docs.make
+
+mono-file-formats.tree: $(srcdir)/mono-file-formats.config $(srcdir)/docs.make
        $(MDOC) assemble -o mono-file-formats -f man $<
 
 .doc-stamp:
index e161a0c3d42ebbbe4362f555889af8a70b1b3ca4..f2711d26b1301058f375998378a495f77430b8c5 100644 (file)
@@ -1,17 +1,23 @@
 #!/usr/bin/perl
 
 if ($ARGV[0] eq "-h"){
-    $dir = $ARGV[1];
+    $sourcedir = $ARGV[1];
+    $dir = $sourcedir;
     $html = 1;
     shift @ARGV;
     shift @ARGV;
 }
 
+if ($ARGV[0] eq "-t"){
+    $dir = $ARGV[1];
+    shift @ARGV;
+}
+
 if ($html){
-    opendir (D, "$dir/sources/") || die "Can not open $dir";
+    opendir (D, "$sourcedir/sources/") || die "Can not open $dir";
     while ($n = readdir (D)){
        if ($n =~ /mono-api-.*\.html$/){
-           open (IN, "$dir/sources/$n") || die "Can not open $n";
+           open (IN, "$sourcedir/sources/$n") || die "Can not open $n";
            $files[$filecount] = $n;
            while (<IN>){
                @files_content[$filecount] .= $_;