From owner-freebsd-questions@FreeBSD.ORG Wed Mar 12 00:46:16 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B51DA1065670 for ; Wed, 12 Mar 2008 00:46:16 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from snoogles.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 829B18FC13 for ; Wed, 12 Mar 2008 00:46:16 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from localhost (localhost [127.0.0.1]) by snoogles.rachie.is-a-geek.net (Postfix) with ESMTP id 7BDD81CCAC; Tue, 11 Mar 2008 16:46:15 -0800 (AKDT) From: Mel To: freebsd-questions@freebsd.org, stevefranks@ieee.org Date: Wed, 12 Mar 2008 01:46:13 +0100 User-Agent: KMail/1.9.7 References: <539c60b90803111715g5fbbdd0cg4ce817ef72a8161d@mail.gmail.com> In-Reply-To: <539c60b90803111715g5fbbdd0cg4ce817ef72a8161d@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803120146.14003.fbsd.questions@rachie.is-a-geek.net> Cc: Subject: Re: OT: how to get make to run a script before each build X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2008 00:46:16 -0000 On Wednesday 12 March 2008 01:15:52 Steve Franks wrote: > I'd like to keep track of how many times I've run make for a given > source. I'm sure someone knows how to get make to run a script before > doing anything else, but using the regular build rules (aka. only if a > source file has changed). Of course typing any permutation of this > question into google gives me 10^life of universe in microseconds > hits. mysource.c.o: count=`cat /var/db/makecounter.${.IMPSRC}` count=$$(($$count+1)) echo $$count >/var/db/makecounter.${.IMPSRC} ${CC} ${CFLAGS} -c ${.IMPSRC} or something to that effect, key being, change/override the compilation rule for your specific or all files. Default single/double suffix rules are in /usr/share/mk/sys.mk. -- Mel Problem with today's modular software: they start with the modules and never get to the software part.