From 29ade669dc1e2b9476d90f8af43fccf70fc6d9e0 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 5 Sep 2019 13:25:48 -0400 Subject: [PATCH] Fix distclean (mono/mono#16667) * 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 | 1 + src/mono/configure.ac | 2 +- src/mono/netcore/Makefile | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mono/Makefile.am b/src/mono/Makefile.am index 61e55e3..dc22a74 100644 --- a/src/mono/Makefile.am +++ b/src/mono/Makefile.am @@ -46,6 +46,7 @@ EXTRA_DIST= \ winconfig.h \ code_of_conduct.md \ external \ + netcore/Makefile \ mcs/class/referencesource DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_RUNTIME=false diff --git a/src/mono/configure.ac b/src/mono/configure.ac index 90092f5..d7a045c 100644 --- a/src/mono/configure.ac +++ b/src/mono/configure.ac @@ -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+ diff --git a/src/mono/netcore/Makefile b/src/mono/netcore/Makefile index 9ba0e95..ac71421a 100644 --- a/src/mono/netcore/Makefile +++ b/src/mono/netcore/Makefile @@ -233,3 +233,4 @@ xunit-summary: endif distdir: +distclean: -- 2.7.4