From owner-freebsd-questions@FreeBSD.ORG Fri Jun 6 17:58:11 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABAF5EA3 for ; Fri, 6 Jun 2014 17:58:11 +0000 (UTC) Received: from trinity.fluff.org (trinity.fluff.org [89.16.178.74]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74AFE2D4F for ; Fri, 6 Jun 2014 17:58:11 +0000 (UTC) Received: from dh by trinity.fluff.org with local (Exim 4.72) (envelope-from ) id 1WsxiP-0006eN-Qh; Fri, 06 Jun 2014 18:14:05 +0100 Date: Fri, 6 Jun 2014 18:14:05 +0100 From: Dave Hines To: freebsd-questions@freebsd.org Subject: Problem with FreeBSD 10.0-RELEASE change in "make" behavior Message-ID: <20140606171405.GA17486@dph.fluff.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: freebsd@dph.fluff.org X-SA-Exim-Scanned: No (on trinity.fluff.org); SAEximRunCond expanded to false X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 17:58:11 -0000 I have a Makefile which builds a library, which used to work using FreeBSD make but which fails using the default make installed in FreeBSD 10.0-RELEASE. It appears that library dependancy line which correctly causes out of date .o files to be re-created, will not always cause the commands following it to be executed. eg. using the following Makefile: make # This correctly builds the .c, .o & library files touch x.c # update x.o so the library needs updating make # This updates x.o, but does not update the library Is this change in how make works intended ? - and if so how should I be making a library now ? Thanks -- Dave Hines. ---------------------- Test Makefile follows ---------------------- # Test Makefile which works with old FreeBSD make, but fails # with the make installed by default in FreeBSD 10.0-RELEASE # Demonstrate using "make; touch x.c; make", and note that although # x.o is updated by the second "make", none of the commands following # the library dependancy are executed, so the libray itself is not # updated. OBJ= x.o y.o LIB= lib.a $(LIB): $(LIB)($(OBJ)) ar cru $(.TARGET) $(.OODATE) $(RANLIB) $(.TARGET) rm -f $(.OODATE) $(OBJ:.o=.c): touch $(.TARGET) clean: rm -f $(LIB) $(OBJ) $(OBJ:.o=.c)