Fix distclean (mono/mono#16667)
authorJo Shields <joshield@microsoft.com>
Thu, 5 Sep 2019 17:25:48 +0000 (13:25 -0400)
committerGitHub <noreply@github.com>
Thu, 5 Sep 2019 17:25:48 +0000 (13:25 -0400)
* Disable `subdir-objects` mode in Automake

This forces creation of subdirectories' files (e.g. .deps/*.Plo) in the
parent directory listing the source file. This works around a situation
where two different files specify files in a different parent directory
(i.e. ../../support/adler32.c in mono/metadata/ and adler32.c in
support/) both emit files into the same place (support/.deps), causing
`make distclean` to try and delete support/.deps from two different
places, breaking distclean.

This unfortunately adds a pile of Automake warnings, during autogen.

The "correct" fix is to stop specifying zlib as a pile of flat .c files,
and instead put it in its own subdirectory, conditionally including
its .la files as required.

Partially fixes https://github.com/mono/mono/issues/16605

* Ship netcore/Makefile with an empty distclean rule

We need a netcore/ directory because we write to it during configure,
and we need a netcore/Makefile with a distclean rule, so top-level
recursive distclean doesn't fail. So specify both here.

Partially fixes https://github.com/mono/mono/issues/16605

Commit migrated from https://github.com/mono/mono/commit/a67839540ef15948b4aebbdcee9ec44ee0f0e9a1

src/mono/Makefile.am
src/mono/configure.ac
src/mono/netcore/Makefile

index 61e55e3..dc22a74 100644 (file)
@@ -46,6 +46,7 @@ EXTRA_DIST= \
        winconfig.h             \
        code_of_conduct.md      \
        external                \
+       netcore/Makefile        \
        mcs/class/referencesource
 
 DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_RUNTIME=false
index 90092f5..d7a045c 100644 (file)
@@ -16,7 +16,7 @@ AC_CANONICAL_HOST
 # The extra brackets are to foil regex-based scans.
 m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
 
-AM_INIT_AUTOMAKE([1.9 dist-xz tar-ustar no-dist-gzip foreign subdir-objects]
+AM_INIT_AUTOMAKE([1.9 dist-xz tar-ustar no-dist-gzip foreign]
                  m4_esyscmd([case `automake --version | head -n 1` in    # parallel-tests is default in automake 1.13+, we need to explicitly enable it
                              *1.11*|*1.12*) echo parallel-tests;;        # for 1.11 and 1.12 but not below as those versions don't recognize the flag
                              esac]))                                     # TODO: remove this hack once we require automake 1.11+
index 9ba0e95..ac71421 100644 (file)
@@ -233,3 +233,4 @@ xunit-summary:
 endif
 
 distdir:
+distclean: