From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Not overwriting unchanged source code files when tangling Date: Tue, 22 Nov 2011 16:43:17 -0500 Message-ID: <12238.1321998197@alphaville.americas.hpqcorp.net> References: <5701.1321644756@alphaville.americas.hpqcorp.net> <5462.1321675205@alphaville.dokosmarshall.org> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:41571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSy7d-0005l3-9k for emacs-orgmode@gnu.org; Tue, 22 Nov 2011 16:43:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSy7b-0000Qt-Rv for emacs-orgmode@gnu.org; Tue, 22 Nov 2011 16:43:21 -0500 Received: from g1t0029.austin.hp.com ([15.216.28.36]:2589) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSy7b-0000QJ-7Z for emacs-orgmode@gnu.org; Tue, 22 Nov 2011 16:43:19 -0500 In-Reply-To: Message from "Allen S. Rout" of "Tue, 22 Nov 2011 16:17:13 EST." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Allen S. Rout" Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org Allen S. Rout wrote: > On 11/19/2011 01:32 PM, Holger Hoefling wrote: > > Hi everyone, > > > > I wanted to thank everyone for their helpful suggestions and wanted to > > share the best solutions I heard of and found. > > > > One solution is to include a rule in the makefile for every sourcecode > > file that that copies it and only updates the copy if something has > > changed (see Nick's email below). > > > > Or tangle to one directory, and then copy to another; then there's > one rule for all of the transitions. > > > work/%: tangle/% > @cmp --silent $< $@ || ( echo "Updating $@" ; cp $< $@ ) > > I liked Nick's "cmp" invocation; I started out with diff. :) > I first saw it in Kernighan and Pike's "Unix Programming Environment" (1984!). I'm sure the trick went back even further. Nick