commit bmake for openSUSE:Factory
Hello community, here is the log from the commit of package bmake for openSUSE:Factory checked in at 2016-11-28 15:08:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/bmake (Old) and /work/SRC/openSUSE:Factory/.bmake.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "bmake" Changes: -------- --- /work/SRC/openSUSE:Factory/bmake/bmake.changes 2016-09-16 11:03:19.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.bmake.new/bmake.changes 2016-11-28 15:08:38.000000000 +0100 @@ -1,0 +2,16 @@ +Wed Nov 23 19:49:33 UTC 2016 - arichardson.kde@gmail.com + +- Update to 20160926 + * Makefile (_MAKE_VERSION): 20160926 + + Merge with NetBSD make, pick up + + support for .DELETE_ON_ERROR: (remove targets that fail) + * Makefile MAN: tweak .Dt to match ${PROG} + +------------------------------------------------------------------- +Wed Nov 23 19:29:55 UTC 2016 - arichardson.kde@gmail.com + +- Install the .mk files as well +- Use allow-overriding-compiler-variables.patch instead overwriting the + installed file with Linux.sys.mk + +------------------------------------------------------------------- Old: ---- Linux.sys.mk bmake-20160818.tar.gz New: ---- allow-overriding-compiler-variables.patch bmake-20160926.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ bmake.spec ++++++ --- /var/tmp/diff_new_pack.x1HtW6/_old 2016-11-28 15:08:39.000000000 +0100 +++ /var/tmp/diff_new_pack.x1HtW6/_new 2016-11-28 15:08:39.000000000 +0100 @@ -17,14 +17,16 @@ Name: bmake -Version: 20160818 +Version: 20160926 Release: 0 Summary: The NetBSD make(1) tool License: BSD-2-Clause and BSD-3-Clause and BSD-4-Clause Group: Development/Tools/Building Url: ftp://ftp.NetBSD.org/pub/NetBSD/misc/sjg/ Source0: ftp://ftp.NetBSD.org/pub/NetBSD/misc/sjg/bmake-%{version}.tar.gz -Source1: Linux.sys.mk +# PATCH-FEATURE-OPENSUSE allow-overriding-compiler-variables.patch -- Based on Linux.sys.mk which was previously shipped with this package +# patch generated using `git diff master opensuse` from https://github.com/RichardsonAlex/bmake +Patch0: allow-overriding-compiler-variables.patch %description bmake, the NetBSD make(1) tool, is a program designed to simplify the @@ -38,6 +40,7 @@ %prep %setup -q -n %{name} +%patch0 -p1 %build unset MAKEFLAGS @@ -46,12 +49,19 @@ --prefix="%{_prefix}" \ --sysconfdir="%{_sysconfdir}" \ --with-default-sys-path="%{_datadir}/mk" \ - --mksrc none op=build + --without-filemon \ + op=build %install -install -Dp -m0644 bmake.1 %{buildroot}%{_mandir}/man1/bmake.1 -install -Dp -m0755 Linux/bmake %{buildroot}%{_bindir}/bmake -install -Dp -m0644 %{SOURCE1} %{buildroot}%{_datadir}/mk/sys.mk +./boot-strap -o Linux \ + --prefix="%{_prefix}" \ + --sysconfdir="%{_sysconfdir}" \ + --with-default-sys-path="%{_datadir}/mk" \ + --install-prefix="%{_prefix}" \ + --install-destdir="%{buildroot}" \ + op=install +mv "%{buildroot}%{_mandir}/cat1" "%{buildroot}%{_mandir}/man1" +ln -s "inc.mk" "%{buildroot}%{_datadir}/mk/bsd.inc.mk" %check ./boot-strap op=test ++++++ allow-overriding-compiler-variables.patch ++++++ diff --git a/mk/sys/Linux.mk b/mk/sys/Linux.mk index c619412..3a4b479 100644 --- a/mk/sys/Linux.mk +++ b/mk/sys/Linux.mk @@ -8,80 +8,95 @@ unix?= We run ${OS}. ROOT_GROUP= root # would be better to work out where it is... -LIBCRT0= /dev/null +LIBCRT0?= /dev/null -NEED_SOLINKS=yes +NEED_SOLINKS?=yes .SUFFIXES: .out .a .ln .o .c ${CXX_SUFFIXES} .F .f .r .y .l .s .S .cl .p .h .sh .m4 .LIBS: .a -AR= ar -ARFLAGS= rl -RANLIB= ranlib - -AS= as -AFLAGS= -COMPILE.s= ${AS} ${AFLAGS} -LINK.s= ${CC} ${AFLAGS} ${LDFLAGS} -COMPILE.S= ${CC} ${AFLAGS} ${CPPFLAGS} -c -LINK.S= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS} -.if exists(/usr/local/bin/gcc) -CC= gcc -pipe -DBG= -O -g -STATIC?= -static -.else -CC= cc -pipe -DBG= -g -STATIC= -Bstatic -.endif -CFLAGS= ${DBG} -COMPILE.c= ${CC} ${CFLAGS} ${CPPFLAGS} -c -LINK.c= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} - -CXX= g++ -CXXFLAGS= ${CFLAGS} -COMPILE.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c -LINK.cc= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} - -CPP= cpp +AR?= ar +ARFLAGS?= rl +RANLIB?= ranlib + +AS?= as +AFLAGS?= +COMPILE.s?= ${CC} ${AFLAGS} -c +LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS} +COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp +LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS} +CC?= gcc +DBG?= -O -g +STATIC?= -static +CFLAGS?= ${DBG} +COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c +LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} + +CXX?= g++ +CXXFLAGS?= ${CFLAGS} +COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c +LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} + +OBJC?= ${CC} +OBJCFLAGS?= ${CFLAGS} +COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c +LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS} + +CPP?= cpp .if defined(DESTDIR) CPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include .endif -MK_DEP= mkdeps.sh -N -FC= f77 -FFLAGS= -O -RFLAGS= -COMPILE.f= ${FC} ${FFLAGS} -c -LINK.f= ${FC} ${FFLAGS} ${LDFLAGS} -COMPILE.F= ${FC} ${FFLAGS} ${CPPFLAGS} -c -LINK.F= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS} -COMPILE.r= ${FC} ${FFLAGS} ${RFLAGS} -c -LINK.r= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS} +MK_DEP?= mkdeps.sh -N +FC?= f77 +FFLAGS?= -O +RFLAGS?= +COMPILE.f?= ${FC} ${FFLAGS} -c +LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS} +COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c +LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS} +COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c +LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS} + +INSTALL?= install + +LEX?= lex +LFLAGS?= +LEX.l?= ${LEX} ${LFLAGS} -LEX= lex -LFLAGS= -LEX.l= ${LEX} ${LFLAGS} +LD?= ld +LDFLAGS?= -LD= ld -LDFLAGS= +LINT?= lint +LINTFLAGS?= -chapbxzF -LINT= lint -LINTFLAGS= -chapbx +LORDER?= echo -MAKE= bmake +MAKE?= bmake -PC= pc -PFLAGS= -COMPILE.p= ${PC} ${PFLAGS} ${CPPFLAGS} -c -LINK.p= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS} +NM?= nm -SHELL= sh +PC?= pc +PFLAGS?= +COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c +LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS} -YACC= yacc -YFLAGS= -d -YACC.y= ${YACC} ${YFLAGS} +SHELL?= sh + +SIZE?= size + +TSORT?= tsort + +YACC?= yacc +YFLAGS?= -d +YACC.y?= ${YACC} ${YFLAGS} + +# At least Ubuntu 8.1 sets __attribute__((warn_unused_result)) on fwrite() +# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 +.if !defined(NOGCCERROR) +CFLAGS+= -Wno-error +.endif # C .c: @@ -92,6 +107,8 @@ YACC.y= ${YACC} ${YFLAGS} ${COMPILE.c} ${.IMPSRC} ${AR} ${ARFLAGS} $@ $*.o rm -f $*.o +.c.ln: + ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC} # C++ ${CXX_SUFFIXES}: ++++++ bmake-20160818.tar.gz -> bmake-20160926.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/ChangeLog new/bmake/ChangeLog --- old/bmake/ChangeLog 2016-08-19 01:02:51.000000000 +0200 +++ new/bmake/ChangeLog 2016-09-27 22:41:23.000000000 +0200 @@ -1,3 +1,13 @@ +2016-09-26 Simon J. Gerraty <sjg@bad.crufty.net> + + * Makefile (_MAKE_VERSION): 20160926 + Merge with NetBSD make, pick up + o support for .DELETE_ON_ERROR: (remove targets that fail) + +2016-09-26 Simon J. Gerraty <sjg@bad.crufty.net> + + * Makefile MAN: tweak .Dt to match ${PROG} + 2016-08-18 Simon J. Gerraty <sjg@bad.crufty.net> * Makefile (_MAKE_VERSION): 20160818 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/Makefile new/bmake/Makefile --- old/bmake/Makefile 2016-08-19 01:02:51.000000000 +0200 +++ new/bmake/Makefile 2016-09-27 22:41:23.000000000 +0200 @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.72 2016/08/18 23:02:26 sjg Exp $ +# $Id: Makefile,v 1.74 2016/09/27 20:40:54 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20160818 +_MAKE_VERSION= 20160926 PROG= bmake @@ -156,7 +156,10 @@ .NOPATH: ${MAN} ${MAN}: make.1 my.history @echo making $@ - @sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \ + @sed \ + -e '/^.Dt/s/MAKE/${PROG:tu}/' \ + -e 's/^.Nx/NetBSD/' \ + -e '/^.Nm/s/make/${PROG}/' \ -e '/^.Sh HISTORY/rmy.history' \ -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/bmake.1 new/bmake/bmake.1 --- old/bmake/bmake.1 2016-08-19 01:13:34.000000000 +0200 +++ new/bmake/bmake.1 2016-09-27 22:42:30.000000000 +0200 @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.262 2016/08/18 19:23:20 wiz Exp $ +.\" $NetBSD: make.1,v 1.263 2016/08/26 23:37:54 dholland Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,8 +29,8 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd August 15, 2016 -.Dt MAKE 1 +.Dd August 26, 2016 +.Dt BMAKE 1 .Os .Sh NAME .Nm bmake @@ -2011,6 +2011,14 @@ .Ic .DEFAULT Ns 's commands is set to the target's own name. +.It Ic .DELETE_ON_ERROR +If this target is present in the makefile, it globally causes make to +delete targets whose commands fail. +(By default, only targets whose commands are interrupted during +execution are deleted. +This is the historical behavior.) +This setting can be used to help prevent half-finished or malformed +targets from being left around and corrupting future rebuilds. .It Ic .END Any command lines attached to this target are executed after everything else is done. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/bmake.cat1 new/bmake/bmake.cat1 --- old/bmake/bmake.cat1 2016-08-15 21:28:53.000000000 +0200 +++ new/bmake/bmake.cat1 2016-09-27 22:42:30.000000000 +0200 @@ -1,4 +1,4 @@ -MAKE(1) NetBSD General Commands Manual MAKE(1) +BMAKE(1) NetBSD General Commands Manual BMAKE(1) NNAAMMEE bbmmaakkee -- maintain program dependencies @@ -1285,6 +1285,14 @@ target that inherits ..DDEEFFAAUULLTT's commands is set to the target's own name. + ..DDEELLEETTEE__OONN__EERRRROORR + If this target is present in the makefile, it globally causes + make to delete targets whose commands fail. (By default, only + targets whose commands are interrupted during execution are + deleted. This is the historical behavior.) This setting can be + used to help prevent half-finished or malformed targets from + being left around and corrupting future rebuilds. + ..EENNDD Any command lines attached to this target are executed after everything else is done. @@ -1498,4 +1506,4 @@ There is no way of escaping a space character in a filename. -NetBSD 5.1 August 15, 2016 NetBSD 5.1 +NetBSD 5.1 August 26, 2016 NetBSD 5.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/compat.c new/bmake/compat.c --- old/bmake/compat.c 2016-05-12 22:34:55.000000000 +0200 +++ new/bmake/compat.c 2016-09-27 22:41:23.000000000 +0200 @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $ */ +/* $NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $"); +__RCSID("$NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $"); #endif #endif /* not lint */ #endif @@ -119,6 +119,25 @@ static GNode *ENDNode; static void CompatInterrupt(int); +/* + * CompatDeleteTarget -- delete a failed, interrupted, or otherwise + * duffed target if not inhibited by .PRECIOUS. + */ +static void +CompatDeleteTarget(GNode *gn) +{ + if ((gn != NULL) && !Targ_Precious (gn)) { + char *p1; + char *file = Var_Value(TARGET, gn, &p1); + + if (!noExecute && eunlink(file) != -1) { + Error("*** %s removed", file); + } + + free(p1); + } +} + /*- *----------------------------------------------------------------------- * CompatInterrupt -- @@ -132,6 +151,9 @@ * The target is removed and the process exits. If .INTERRUPT exists, * its commands are run first WITH INTERRUPTS IGNORED.. * + * XXX: is .PRECIOUS supposed to inhibit .INTERRUPT? I doubt it, but I've + * left the logic alone for now. - dholland 20160826 + * *----------------------------------------------------------------------- */ static void @@ -139,16 +161,9 @@ { GNode *gn; - if ((curTarg != NULL) && !Targ_Precious (curTarg)) { - char *p1; - char *file = Var_Value(TARGET, curTarg, &p1); - - if (!noExecute && eunlink(file) != -1) { - Error("*** %s removed", file); - } - - free(p1); + CompatDeleteTarget(curTarg); + if ((curTarg != NULL) && !Targ_Precious (curTarg)) { /* * Run .INTERRUPT only if hit with interrupt signal */ @@ -158,7 +173,6 @@ Compat_Make(gn, gn); } } - } if (signo == SIGQUIT) _exit(signo); @@ -447,6 +461,11 @@ * continue. */ printf(" (continuing)\n"); + } else { + printf("\n"); + } + if (deleteOnError) { + CompatDeleteTarget(gn); } } else { /* @@ -607,7 +626,7 @@ } else if (keepgoing) { pgn->flags &= ~REMAKE; } else { - PrintOnError(gn, "\n\nStop."); + PrintOnError(gn, "\nStop."); exit(1); } } else if (gn->made == ERROR) { @@ -698,7 +717,7 @@ if (gn != NULL) { Compat_Make(gn, gn); if (gn->made == ERROR) { - PrintOnError(gn, "\n\nStop."); + PrintOnError(gn, "\nStop."); exit(1); } } @@ -739,7 +758,7 @@ if (errors == 0) { Compat_Make(ENDNode, ENDNode); if (gn->made == ERROR) { - PrintOnError(gn, "\n\nStop."); + PrintOnError(gn, "\nStop."); exit(1); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/job.c new/bmake/job.c --- old/bmake/job.c 2016-05-12 22:34:55.000000000 +0200 +++ new/bmake/job.c 2016-09-27 22:41:23.000000000 +0200 @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $ */ +/* $NetBSD: job.c,v 1.188 2016/08/26 23:28:39 dholland Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.188 2016/08/26 23:28:39 dholland Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $"); +__RCSID("$NetBSD: job.c,v 1.188 2016/08/26 23:28:39 dholland Exp $"); #endif #endif /* not lint */ #endif @@ -388,6 +388,21 @@ } /* + * Delete the target of a failed, interrupted, or otherwise + * unsuccessful job unless inhibited by .PRECIOUS. + */ +static void +JobDeleteTarget(GNode *gn) +{ + if ((gn->type & (OP_JOIN|OP_PHONY)) == 0 && !Targ_Precious(gn)) { + char *file = (gn->path == NULL ? gn->name : gn->path); + if (!noExecute && eunlink(file) != -1) { + Error("*** %s removed", file); + } + } +} + +/* * JobSigLock/JobSigUnlock * * Signal lock routines to get exclusive access. Currently used to @@ -1033,6 +1048,9 @@ if (job->flags & JOB_IGNERR) { WAIT_STATUS(status) = 0; } else { + if (deleteOnError) { + JobDeleteTarget(job->node); + } PrintOnError(job->node, NULL); } } else if (DEBUG(JOB)) { @@ -1050,6 +1068,9 @@ } (void)printf("*** [%s] Signal %d\n", job->node->name, WTERMSIG(status)); + if (deleteOnError) { + JobDeleteTarget(job->node); + } } (void)fflush(stdout); } @@ -2578,12 +2599,7 @@ gn = job->node; - if ((gn->type & (OP_JOIN|OP_PHONY)) == 0 && !Targ_Precious(gn)) { - char *file = (gn->path == NULL ? gn->name : gn->path); - if (!noExecute && eunlink(file) != -1) { - Error("*** %s removed", file); - } - } + JobDeleteTarget(gn); if (job->pid) { if (DEBUG(JOB)) { (void)fprintf(debug_file, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/main.c new/bmake/main.c --- old/bmake/main.c 2016-08-13 19:55:48.000000000 +0200 +++ new/bmake/main.c 2016-09-27 22:41:23.000000000 +0200 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.250 2016/08/11 19:53:17 sjg Exp $ */ +/* $NetBSD: main.c,v 1.251 2016/08/26 23:28:39 dholland Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.250 2016/08/11 19:53:17 sjg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.251 2016/08/26 23:28:39 dholland Exp $"; #else #include <sys/cdefs.h> #ifndef lint @@ -81,7 +81,7 @@ #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.250 2016/08/11 19:53:17 sjg Exp $"); +__RCSID("$NetBSD: main.c,v 1.251 2016/08/26 23:28:39 dholland Exp $"); #endif #endif /* not lint */ #endif @@ -155,6 +155,7 @@ time_t now; /* Time at start of make */ GNode *DEFAULT; /* .DEFAULT node */ Boolean allPrecious; /* .PRECIOUS given on line by itself */ +Boolean deleteOnError; /* .DELETE_ON_ERROR: set */ static Boolean noBuiltins; /* -r flag */ static Lst makefiles; /* ordered list of makefiles to read */ @@ -979,6 +980,7 @@ noRecursiveExecute = FALSE; /* Execute all .MAKE targets */ keepgoing = FALSE; /* Stop on error */ allPrecious = FALSE; /* Remove targets when interrupted */ + deleteOnError = FALSE; /* Historical default behavior */ queryFlag = FALSE; /* This is not just a check-run */ noBuiltins = FALSE; /* Read the built-in rules */ touchFlag = FALSE; /* Actually update targets */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/make.1 new/bmake/make.1 --- old/bmake/make.1 2016-08-19 01:02:51.000000000 +0200 +++ new/bmake/make.1 2016-09-27 22:41:23.000000000 +0200 @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.262 2016/08/18 19:23:20 wiz Exp $ +.\" $NetBSD: make.1,v 1.263 2016/08/26 23:37:54 dholland Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd August 15, 2016 +.Dd August 26, 2016 .Dt MAKE 1 .Os .Sh NAME @@ -2011,6 +2011,14 @@ .Ic .DEFAULT Ns 's commands is set to the target's own name. +.It Ic .DELETE_ON_ERROR +If this target is present in the makefile, it globally causes make to +delete targets whose commands fail. +(By default, only targets whose commands are interrupted during +execution are deleted. +This is the historical behavior.) +This setting can be used to help prevent half-finished or malformed +targets from being left around and corrupting future rebuilds. .It Ic .END Any command lines attached to this target are executed after everything else is done. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/make.h new/bmake/make.h --- old/bmake/make.h 2016-06-07 02:46:29.000000000 +0200 +++ new/bmake/make.h 2016-09-27 22:41:23.000000000 +0200 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.100 2016/06/07 00:40:00 sjg Exp $ */ +/* $NetBSD: make.h,v 1.101 2016/08/26 23:28:39 dholland Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -389,6 +389,7 @@ extern Boolean noExecute; /* True if should execute nothing */ extern Boolean noRecursiveExecute; /* True if should execute nothing */ extern Boolean allPrecious; /* True if every target is precious */ +extern Boolean deleteOnError; /* True if failed targets should be deleted */ extern Boolean keepgoing; /* True if should continue on unaffected * portions of the graph when have an error * in one portion */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/mk/ChangeLog new/bmake/mk/ChangeLog --- old/bmake/mk/ChangeLog 2016-08-15 21:28:26.000000000 +0200 +++ new/bmake/mk/ChangeLog 2016-10-02 00:20:41.000000000 +0200 @@ -1,3 +1,20 @@ +2016-09-30 Simon J. Gerraty <sjg@bad.crufty.net> + + * dirdeps.mk: use TARGET_SPEC_VARS to qualify components added to + DEP_SKIP_DIR and DEP_DIRDEPS_FILTER + + * sys.mk: extract some bits to sys.{debug,vars}.mk + for easier re-use by others. + +2016-08-19 Simon J. Gerraty <sjg@bad.crufty.net> + + * meta.sys.mk (META_COOKIE_TOUCH): use ${.OBJDIR}/${.TARGET:T} as default + +2016-09-23 Simon Gerraty <sjg@sjg-mba13> + + * lib.mk: Use ${PICO} for extension for PIC objects. + default to .pico (like NetBSD) safe on case insensitive filesystem. + 2016-08-15 Simon J. Gerraty <sjg@bad.crufty.net> * install-mk (MK_VERSION): 20160815 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/mk/FILES new/bmake/mk/FILES --- old/bmake/mk/FILES 2014-11-08 07:46:34.000000000 +0100 +++ new/bmake/mk/FILES 2016-10-02 00:20:41.000000000 +0200 @@ -38,7 +38,9 @@ subdir.mk sys.mk sys.clean-env.mk +sys.debug.mk sys.dependfile.mk +sys.vars.mk sys/AIX.mk sys/Darwin.mk sys/Generic.mk diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/mk/dirdeps.mk new/bmake/mk/dirdeps.mk --- old/bmake/mk/dirdeps.mk 2016-08-15 21:28:26.000000000 +0200 +++ new/bmake/mk/dirdeps.mk 2016-10-01 01:47:37.000000000 +0200 @@ -1,4 +1,4 @@ -# $Id: dirdeps.mk,v 1.73 2016/08/15 19:28:13 sjg Exp $ +# $Id: dirdeps.mk,v 1.75 2016/09/30 23:47:23 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -305,8 +305,10 @@ DEP_SKIP_DIR = ${SKIP_DIR} \ ${SKIP_DIR.${DEP_TARGET_SPEC}:U} \ - ${SKIP_DIR.${DEP_MACHINE}:U} \ - ${SKIP_DIRDEPS.${DEP_MACHINE}:U} + ${TARGET_SPEC_VARS:@v@${SKIP_DIR.${DEP_$v}:U}@} \ + ${SKIP_DIRDEPS.${DEP_TARGET_SPEC}:U} \ + ${TARGET_SPEC_VARS:@v@${SKIP_DIRDEPS.${DEP_$v}:U}@} + NSkipDir = ${DEP_SKIP_DIR:${M_ListToSkip}} @@ -522,7 +524,7 @@ # these we reset each time through as they can depend on DEP_MACHINE DEP_DIRDEPS_FILTER = \ ${DIRDEPS_FILTER.${DEP_TARGET_SPEC}:U} \ - ${DIRDEPS_FILTER.${DEP_MACHINE}:U} \ + ${TARGET_SPEC_VARS:@v@${DIRDEPS_FILTER.${DEP_$v}:U}@} \ ${DIRDEPS_FILTER:U} .if empty(DEP_DIRDEPS_FILTER) # something harmless @@ -696,7 +698,7 @@ .if ${_src:T} != ${.MAKE.DEPENDFILE_PREFIX:T} (cd ${.CURDIR} && sed ${.MAKE.DEPENDFILE_BOOTSTRAP_SED} ${_src} > ${_want}) .else - cp ${.CURDIR}/${_src} ${_want} + cp ${.CURDIR}/${_src:T} ${_want} .endif # create Makefile.depend* for this dir and its dependencies diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/mk/install-mk new/bmake/mk/install-mk --- old/bmake/mk/install-mk 2016-08-15 21:28:26.000000000 +0200 +++ new/bmake/mk/install-mk 2016-10-01 01:47:37.000000000 +0200 @@ -55,7 +55,7 @@ # Simon J. Gerraty <sjg@crufty.net> # RCSid: -# $Id: install-mk,v 1.130 2016/08/15 19:28:13 sjg Exp $ +# $Id: install-mk,v 1.131 2016/09/30 23:47:23 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20160815 +MK_VERSION=20160930 OWNER= GROUP= MODE=444 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/mk/lib.mk new/bmake/mk/lib.mk --- old/bmake/mk/lib.mk 2016-08-11 01:58:27.000000000 +0200 +++ new/bmake/mk/lib.mk 2016-09-27 07:50:03.000000000 +0200 @@ -1,4 +1,4 @@ -# $Id: lib.mk,v 1.54 2016/08/02 20:52:17 sjg Exp $ +# $Id: lib.mk,v 1.55 2016/09/23 23:04:51 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -9,39 +9,30 @@ NEED_SOLINKS?= yes .endif -.if exists(${.CURDIR}/shlib_version) -SHLIB_MAJOR != . ${.CURDIR}/shlib_version ; echo $$major -SHLIB_MINOR != . ${.CURDIR}/shlib_version ; echo $$minor -.endif - -print-shlib-major: -.if defined(SHLIB_MAJOR) && ${MK_PIC} != "no" - @echo ${SHLIB_MAJOR} -.else - @false +SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version +.if !defined(SHLIB_MAJOR) && exists(${SHLIB_VERSION_FILE}) +SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major +SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor +SHLIB_TEENY != . ${SHLIB_VERSION_FILE} ; echo $$teeny .endif -print-shlib-minor: -.if defined(SHLIB_MINOR) && ${MK_PIC} != "no" - @echo ${SHLIB_MINOR} -.else - @false -.endif - -print-shlib-teeny: -.if defined(SHLIB_TEENY) && ${MK_PIC} != "no" - @echo ${SHLIB_TEENY} +.for x in major minor teeny +print-shlib-$x: +.if defined(SHLIB_${x:tu}) && ${MK_PIC} != "no" + @echo ${SHLIB_${x:tu}} .else @false .endif +.endfor SHLIB_FULLVERSION ?= ${${SHLIB_MAJOR} ${SHLIB_MINOR} ${SHLIB_TEENY}:L:ts.} SHLIB_FULLVERSION := ${SHLIB_FULLVERSION} # add additional suffixes not exported. # .po is used for profiling object files. -# .So is used for PIC object files. -.SUFFIXES: .out .a .ln .So .po .o .s .S .c .cc .C .m .F .f .r .y .l .cl .p .h +# ${PICO} is used for PIC object files. +PICO?= .pico +.SUFFIXES: .out .a .ln ${PICO} .po .o .s .S .c .cc .C .m .F .f .r .y .l .cl .p .h .SUFFIXES: .sh .m4 .m CFLAGS+= ${COPTS} @@ -62,12 +53,12 @@ # with ELF, also set shared-lib version for ld.so. # SHLIB_LDSTARTFILE: support .o file, call C++ file-level constructors # SHLIB_LDENDFILE: support .o file, call C++ file-level destructors -# FPICFLAGS: flags for ${FC} to compile .[fF] files to .So objects. +# FPICFLAGS: flags for ${FC} to compile .[fF] files to ${PICO} objects. # CPPICFLAGS: flags for ${CPP} to preprocess .[sS] files for ${AS} -# CPICFLAGS: flags for ${CC} to compile .[cC] files to .So objects. +# CPICFLAGS: flags for ${CC} to compile .[cC] files to ${PICO} objects. # CAPICFLAGS flags for {$CC} to compiling .[Ss] files # (usually just ${CPPPICFLAGS} ${CPICFLAGS}) -# APICFLAGS: flags for ${AS} to assemble .[sS] to .So objects. +# APICFLAGS: flags for ${AS} to assemble .[sS] to ${PICO} objects. .if ${TARGET_OSNAME} == "NetBSD" .if ${MACHINE_ARCH} == "alpha" @@ -162,14 +153,14 @@ LD_so=sl DLLIB= # HPsUX lorder does not grok anything but .o -LD_sobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,.So,'` +LD_sobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,${PICO},'` LD_pobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,.po,'` .elif ${TARGET_OSNAME} == "OSF1" LD_shared= -msym -shared -expect_unresolved '*' LD_solib= -all lib${LIB}_pic.a DLLIB= # lorder does not grok anything but .o -LD_sobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,.So,'` +LD_sobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,${PICO},'` LD_pobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,.po,'` AR_cq= -cqs .elif ${TARGET_OSNAME} == "FreeBSD" @@ -250,9 +241,9 @@ DLLIB ?= -ldl .endif -# some libs have lots of objects, and scanning all .o, .po and .So meta files +# some libs have lots of objects, and scanning all .o, .po and ${PICO} meta files # is a waste of time, this tells meta.autodep.mk to just pick one -# (typically .So) +# (typically ${PICO}) # yes, 42 is a random number. .if ${MK_DIRDEPS_BUILD} == "yes" && ${SRCS:Uno:[\#]} > 42 OPTIMIZE_OBJECT_META_FILES ?= yes @@ -287,7 +278,7 @@ ${CXX_SUFFIXES:%=%.po}: ${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET} -.S.So .s.So: +.S${PICO} .s${PICO}: ${COMPILE.S} ${PICFLAG} ${CC_PIC} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET} .else .c.po: @@ -302,7 +293,7 @@ @${LD} ${LD_X} ${LD_r} ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o -.S.So .s.So: +.S${PICO} .s${PICO}: @echo ${COMPILE.S} ${PICFLAG} ${CC_PIC} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET} @${COMPILE.S} ${PICFLAG} ${CC_PIC} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o @${LD} ${LD_x} ${LD_r} ${.TARGET}.o -o ${.TARGET} @@ -310,23 +301,23 @@ .endif .if (${LD_x} == "") -.c.So: +.c${PICO}: ${COMPILE.c} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET} -${CXX_SUFFIXES:%=%.So}: +${CXX_SUFFIXES:%=%${PICO}}: ${COMPILE.cc} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET} .S.po .s.po: ${COMPILE.S} ${PROFFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET} .else -.c.So: +.c${PICO}: @echo ${COMPILE.c} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET} @${COMPILE.c} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET}.o @${LD} ${LD_x} ${LD_r} ${.TARGET}.o -o ${.TARGET} @rm -f ${.TARGET}.o -${CXX_SUFFIXES:%=%.So}: +${CXX_SUFFIXES:%=%${PICO}}: @echo ${COMPILE.cc} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET} @${COMPILE.cc} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET}.o @${LD} ${LD_x} ${LD_r} ${.TARGET}.o -o ${.TARGET} @@ -396,7 +387,7 @@ all: _SUBDIRUSE .for s in ${SRCS:N*.h:M*/*} -${.o .So .po .lo:L:@o@${s:T:R}$o@}: $s +${.o ${PICO} .po .lo:L:@o@${s:T:R}$o@}: $s .endfor OBJS+= ${SRCS:T:N*.h:R:S/$/.o/g} @@ -441,7 +432,7 @@ @${AR} ${AR_cq} ${.TARGET} ${LD_pobjs} ${RANLIB} ${.TARGET} -SOBJS+= ${OBJS:.o=.So} +SOBJS+= ${OBJS:.o=${PICO}} .NOPATH: ${SOBJS} lib${LIB}_pic.a:: ${SOBJS} @echo building shared object ${LIB} library @@ -502,7 +493,7 @@ .if defined(SRCS) && (!defined(MKDEP) || ${MKDEP} != autodep) afterdepend: .depend @(TMP=/tmp/_depend$$$$; \ - sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.So \1.ln:/' \ + sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1${PICO} \1.ln:/' \ < .depend > $$TMP; \ mv $$TMP .depend) .endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/mk/meta.sys.mk new/bmake/mk/meta.sys.mk --- old/bmake/mk/meta.sys.mk 2016-08-13 19:55:49.000000000 +0200 +++ new/bmake/mk/meta.sys.mk 2016-09-27 07:50:03.000000000 +0200 @@ -1,4 +1,4 @@ -# $Id: meta.sys.mk,v 1.29 2016/08/13 17:51:45 sjg Exp $ +# $Id: meta.sys.mk,v 1.31 2016/09/10 00:44:46 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -102,9 +102,6 @@ .endif -META_COOKIE_TOUCH= -# some targets need to be .PHONY in non-meta mode -META_NOPHONY= .PHONY # Are we, after all, in meta mode? .if ${.MAKE.MODE:Uno:Mmeta*} != "" MKDEP_MK = meta.autodep.mk @@ -121,7 +118,7 @@ # we can afford to use cookies to prevent some targets # re-running needlessly -META_COOKIE_TOUCH= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET}} +META_COOKIE_TOUCH?= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET:T}} META_NOPHONY= # some targets involve old pre-built targets @@ -162,5 +159,9 @@ .endif .endif +.else +META_COOKIE_TOUCH= +# some targets need to be .PHONY in non-meta mode +META_NOPHONY= .PHONY .endif .endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/mk/sys.debug.mk new/bmake/mk/sys.debug.mk --- old/bmake/mk/sys.debug.mk 1970-01-01 01:00:00.000000000 +0100 +++ new/bmake/mk/sys.debug.mk 2016-10-01 21:11:55.000000000 +0200 @@ -0,0 +1,33 @@ +# $Id: sys.debug.mk,v 1.1 2016/10/01 19:11:55 sjg Exp $ +# +# @(#) Copyright (c) 2009, Simon J. Gerraty +# +# This file is provided in the hope that it will +# be of use. There is absolutely NO WARRANTY. +# Permission to copy, redistribute or otherwise +# use this file is hereby granted provided that +# the above copyright notice and this notice are +# left intact. +# +# Please send copies of changes and bug-fixes to: +# sjg@crufty.net +# + +# Sometimes we want to turn on debugging in just one or two places +# if .CURDIR is matched by any entry in DEBUG_MAKE_SYS_DIRS we +# will apply DEBUG_MAKE_FLAGS now. +# if an entry in DEBUG_MAKE_DIRS matches, we at the end of sys.mk +# eg. DEBUG_MAKE_FLAGS=-dv DEBUG_MAKE_SYS_DIRS="*lib/sjg" +# use DEBUG_MAKE_FLAGS0 to apply only to .MAKE.LEVEL 0 +# +.if ${.MAKE.LEVEL:U1} == 0 +# we use indirection, to simplify the tests below, and incase +# DEBUG_* were given on our command line. +_DEBUG_MAKE_FLAGS = ${DEBUG_MAKE_FLAGS0} +_DEBUG_MAKE_SYS_DIRS = ${DEBUG_MAKE_SYS_DIRS0:U${DEBUG_MAKE_SYS_DIRS}} +_DEBUG_MAKE_DIRS = ${DEBUG_MAKE_DIRS0:U${DEBUG_MAKE_DIRS}} +.else +_DEBUG_MAKE_FLAGS = ${DEBUG_MAKE_FLAGS} +_DEBUG_MAKE_SYS_DIRS = ${DEBUG_MAKE_SYS_DIRS} +_DEBUG_MAKE_DIRS = ${DEBUG_MAKE_DIRS} +.endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/mk/sys.mk new/bmake/mk/sys.mk --- old/bmake/mk/sys.mk 2016-04-05 18:57:21.000000000 +0200 +++ new/bmake/mk/sys.mk 2016-10-02 00:20:41.000000000 +0200 @@ -1,4 +1,4 @@ -# $Id: sys.mk,v 1.43 2016/04/05 15:58:37 sjg Exp $ +# $Id: sys.mk,v 1.44 2016/10/01 19:11:55 sjg Exp $ # # @(#) Copyright (c) 2003-2009, Simon J. Gerraty # @@ -15,38 +15,8 @@ # Avoid putting anything platform specific in here. -# We use the following paradigm for preventing multiple inclusion. -# It relies on the fact that conditionals and dependencies are resolved -# at the time they are read. -# -# _this ?= ${.PARSEFILE} -# .if !target(__${_this}__) -# __${_this}__: -# -.if ${MAKE_VERSION:U0} > 20100408 -_this = ${.PARSEDIR:tA}/${.PARSEFILE} -.else -_this = ${.PARSEDIR}/${.PARSEFILE} -.endif - -# Sometimes we want to turn on debugging in just one or two places -# if .CURDIR is matched by any entry in DEBUG_MAKE_SYS_DIRS we -# will apply DEBUG_MAKE_FLAGS now. -# if an entry in DEBUG_MAKE_DIRS matches, we at the end of sys.mk -# eg. DEBUG_MAKE_FLAGS=-dv DEBUG_MAKE_SYS_DIRS="*lib/sjg" -# use DEBUG_MAKE_FLAGS0 to apply only to .MAKE.LEVEL 0 -# -.if ${.MAKE.LEVEL:U1} == 0 -# we use indirection, to simplify the tests below, and incase -# DEBUG_* were given on our command line. -_DEBUG_MAKE_FLAGS = ${DEBUG_MAKE_FLAGS0} -_DEBUG_MAKE_SYS_DIRS = ${DEBUG_MAKE_SYS_DIRS0:U${DEBUG_MAKE_SYS_DIRS}} -_DEBUG_MAKE_DIRS = ${DEBUG_MAKE_DIRS0:U${DEBUG_MAKE_DIRS}} -.else -_DEBUG_MAKE_FLAGS = ${DEBUG_MAKE_FLAGS} -_DEBUG_MAKE_SYS_DIRS = ${DEBUG_MAKE_SYS_DIRS} -_DEBUG_MAKE_DIRS = ${DEBUG_MAKE_DIRS} -.endif +# _DEBUG_MAKE_FLAGS etc. +.include <sys.debug.mk> .if !empty(_DEBUG_MAKE_FLAGS) .if ${_DEBUG_MAKE_SYS_DIRS:Uno:@x@${.CURDIR:M$x}@} != "" @@ -54,47 +24,8 @@ .endif .endif -# if this is an ancient version of bmake -MAKE_VERSION ?= 0 -.if ${MAKE_VERSION:M*make-*} -# turn it into what we want - just the date -MAKE_VERSION := ${MAKE_VERSION:[1]:C,.*-,,} -.endif - -# some useful modifiers - -# A useful trick for testing multiple :M's against something -# :L says to use the variable's name as its value - ie. literal -# got = ${clean* destroy:${M_ListToMatch:S,V,.TARGETS,}} -M_ListToMatch = L:@m@$${V:M$$m}@ -# match against our initial targets (see above) -M_L_TARGETS = ${M_ListToMatch:S,V,_TARGETS,} - -# turn a list into a set of :N modifiers -# NskipFoo = ${Foo:${M_ListToSkip}} -M_ListToSkip= O:u:ts::S,:,:N,g:S,^,N, - -# type should be a builtin in any sh since about 1980, -# but sadly there are exceptions! -.if ${.MAKE.OS:Unknown:NBSD/OS} == "" -_type_sh = which -.endif -# AUTOCONF := ${autoconf:L:${M_whence}} -M_type = @x@(${_type_sh:Utype} $$x) 2> /dev/null; echo;@:sh:[0]:N* found*:[@]:C,[()],,g -M_whence = ${M_type}:M/*:[1] - -# convert a path to a valid shell variable -M_P2V = tu:C,[./-],_,g - -# convert path to absolute -.if ${MAKE_VERSION:U0} > 20100408 -M_tA = tA -.else -M_tA = C,.*,('cd' & \&\& 'pwd') 2> /dev/null || echo &,:sh -.endif - -# absoulte path to what we are reading. -_PARSEDIR = ${.PARSEDIR:${M_tA}} +# useful modifiers +.include <sys.vars.mk> # we expect a recent bmake .if !defined(_TARGETS) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/mk/sys.vars.mk new/bmake/mk/sys.vars.mk --- old/bmake/mk/sys.vars.mk 1970-01-01 01:00:00.000000000 +0100 +++ new/bmake/mk/sys.vars.mk 2016-10-01 21:11:55.000000000 +0200 @@ -0,0 +1,71 @@ +# $Id: sys.vars.mk,v 1.1 2016/10/01 19:11:55 sjg Exp $ +# +# @(#) Copyright (c) 2003-2009, Simon J. Gerraty +# +# This file is provided in the hope that it will +# be of use. There is absolutely NO WARRANTY. +# Permission to copy, redistribute or otherwise +# use this file is hereby granted provided that +# the above copyright notice and this notice are +# left intact. +# +# Please send copies of changes and bug-fixes to: +# sjg@crufty.net +# + +# We use the following paradigm for preventing multiple inclusion. +# It relies on the fact that conditionals and dependencies are resolved +# at the time they are read. +# +# _this ?= ${.PARSEFILE} +# .if !target(__${_this}__) +# __${_this}__: +# +.if ${MAKE_VERSION:U0} > 20100408 +_this = ${.PARSEDIR:tA}/${.PARSEFILE} +.else +_this = ${.PARSEDIR}/${.PARSEFILE} +.endif + +# if this is an ancient version of bmake +MAKE_VERSION ?= 0 +.if ${MAKE_VERSION:M*make-*} +# turn it into what we want - just the date +MAKE_VERSION := ${MAKE_VERSION:[1]:C,.*-,,} +.endif + +# some useful modifiers + +# A useful trick for testing multiple :M's against something +# :L says to use the variable's name as its value - ie. literal +# got = ${clean* destroy:${M_ListToMatch:S,V,.TARGETS,}} +M_ListToMatch = L:@m@$${V:M$$m}@ +# match against our initial targets (see above) +M_L_TARGETS = ${M_ListToMatch:S,V,_TARGETS,} + +# turn a list into a set of :N modifiers +# NskipFoo = ${Foo:${M_ListToSkip}} +M_ListToSkip= O:u:ts::S,:,:N,g:S,^,N, + +# type should be a builtin in any sh since about 1980, +# but sadly there are exceptions! +.if ${.MAKE.OS:Unknown:NBSD/OS} == "" +_type_sh = which +.endif + +# AUTOCONF := ${autoconf:L:${M_whence}} +M_type = @x@(${_type_sh:Utype} $$x) 2> /dev/null; echo;@:sh:[0]:N* found*:[@]:C,[()],,g +M_whence = ${M_type}:M/*:[1] + +# convert a path to a valid shell variable +M_P2V = tu:C,[./-],_,g + +# convert path to absolute +.if ${MAKE_VERSION:U0} > 20100408 +M_tA = tA +.else +M_tA = C,.*,('cd' & \&\& 'pwd') 2> /dev/null || echo &,:sh +.endif + +# absoulte path to what we are reading. +_PARSEDIR = ${.PARSEDIR:${M_tA}} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/nonints.h new/bmake/nonints.h --- old/bmake/nonints.h 2016-06-03 04:14:16.000000000 +0200 +++ new/bmake/nonints.h 2016-09-27 22:41:23.000000000 +0200 @@ -1,4 +1,4 @@ -/* $NetBSD: nonints.h,v 1.73 2016/06/03 01:21:59 sjg Exp $ */ +/* $NetBSD: nonints.h,v 1.74 2016/09/05 00:40:29 sevan Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -109,7 +109,6 @@ /* main.c */ void Main_ParseArgLine(const char *); void MakeMode(const char *); -int main(int, char **); char *Cmd_Exec(const char *, const char **); void Error(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2); void Fatal(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bmake/parse.c new/bmake/parse.c --- old/bmake/parse.c 2016-05-10 02:06:35.000000000 +0200 +++ new/bmake/parse.c 2016-09-27 22:41:23.000000000 +0200 @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.214 2016/04/06 09:57:00 gson Exp $ */ +/* $NetBSD: parse.c,v 1.215 2016/08/26 23:28:39 dholland Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.214 2016/04/06 09:57:00 gson Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.215 2016/08/26 23:28:39 dholland Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.214 2016/04/06 09:57:00 gson Exp $"); +__RCSID("$NetBSD: parse.c,v 1.215 2016/08/26 23:28:39 dholland Exp $"); #endif #endif /* not lint */ #endif @@ -184,6 +184,7 @@ typedef enum { Begin, /* .BEGIN */ Default, /* .DEFAULT */ + DeleteOnError, /* .DELETE_ON_ERROR */ End, /* .END */ dotError, /* .ERROR */ Ignore, /* .IGNORE */ @@ -301,6 +302,7 @@ } parseKeywords[] = { { ".BEGIN", Begin, 0 }, { ".DEFAULT", Default, 0 }, +{ ".DELETE_ON_ERROR", DeleteOnError, 0 }, { ".END", End, 0 }, { ".ERROR", dotError, 0 }, { ".EXEC", Attribute, OP_EXEC }, @@ -1334,6 +1336,7 @@ * .BEGIN * .END * .ERROR + * .DELETE_ON_ERROR * .INTERRUPT Are not to be considered the * main target. * .NOTPARALLEL Make only one target at a time. @@ -1369,6 +1372,9 @@ (void)Lst_AtEnd(targets, gn); DEFAULT = gn; break; + case DeleteOnError: + deleteOnError = TRUE; + break; case NotParallel: maxJobs = 1; break; @@ -1597,7 +1603,8 @@ goto out; } *line = '\0'; - } else if ((specType == NotParallel) || (specType == SingleShell)) { + } else if ((specType == NotParallel) || (specType == SingleShell) || + (specType == DeleteOnError)) { *line = '\0'; }
participants (1)
-
root@hilbert.suse.de