From 1d1b908107255ffdff4d17f015d8f057d73cc6cb Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Fri, 28 Mar 2014 16:24:45 +0000 Subject: [PATCH] Add a long needed seatbelt. Exit with an error when make is called without a target at the top level rather than poluting the source tree and causing use confusion in future builds. --- Makefile | 13 ++++++++++++- lib/libz-cheri/adler32.c | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3b7cc830467f..a984fc6cd5fb 100644 --- a/Makefile +++ b/Makefile @@ -248,8 +248,19 @@ tinderbox toolchains kernel-toolchains: .MAKE ${TGTS}: ${_+_}@cd ${.CURDIR}; ${_MAKE} ${.TARGET} -# Set a reasonable default +# The historic default "all" target creates files which may cause stale +# or (in the cross build case) unlinkable results. Fail with an error +# when no target is given. The users can set ALLOW_IMPLICIT_TARGET or +# explicitly specify "all" if they want the historic behavior. +.ifdef ALLOW_IMPLICIT_TARGET .MAIN: all +.else +.MAIN: _guard + +_guard: + @echo "Use an explicit target or set ALLOW_IMPLICIT_TARGET" + @false +.endif STARTTIME!= LC_ALL=C date CHECK_TIME!= find ${.CURDIR}/sys/sys/param.h -mtime -0s ; echo diff --git a/lib/libz-cheri/adler32.c b/lib/libz-cheri/adler32.c index d015b4c55cb7..af960c0e1353 100644 --- a/lib/libz-cheri/adler32.c +++ b/lib/libz-cheri/adler32.c @@ -7,6 +7,8 @@ #include "zutil.h" +#include + #define local static local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));