emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Not overwriting unchanged source code files when tangling


From: Carsten Dominik
Subject: Re: [O] Not overwriting unchanged source code files when tangling
Date: Fri, 18 Nov 2011 18:02:12 +0100

On 18.11.2011, at 14:17, Holger Hoefling wrote:

> Hi,
> 
> I have a problem/request for org-mode and was looking for help. I am using 
> org-mode to write source code files and tangle them out. I want to compile 
> them using make. My problem now is that org-mode overwrites the old files 
> every time I tangle them out, therefore also updating the time stamp - even 
> if nothing has changed. Subsequently, when I run make, everything gets 
> recompiled, not just the changed source code files as all time stamps have 
> changed.
> 
> Is there an option for org-mode to only overwrite source code files that get 
> tangled out if they have truly changed?

How about changing the make file so that the dependence is on the Org file, not 
on the source file?
You could then arrange for make to call emacs in batch-mode to tangle the 
source file and then compile it?

Something along the lines of.... (untested, and probably wrong in this way...)

file.o: somefile.org
   emacs -batch --eval '(org-babel-tangle-file "somefile.org")'
   cc file.o ....

- Carsten


reply via email to

[Prev in Thread] Current Thread [Next in Thread]