[SVN] Re: Makefile bundle: better support for multi-Makefile projects (in multiple directories)

Allan Odgaard mailinglist at textmate.org
Wed Apr 29 07:59:40 UTC 2009


On 29 Apr 2009, at 04:43, Anthony Collins wrote:

> Firstly, there is an obvious bug introduced in r10873, where there is
> a hard-coded directory belonging to one of the developers [...]

Sorry about that (/me blushes).

> The current Makefile bundle has poor support for projects that have
> distributed Makefiles [...] Here is one solution to this [...]

One limitation of this approach is for users who set (MAKEFLAGS to) - 
j«n» for parallel job execution. Here the last dir changed to might  
not be the current dir for the command spewing out errors.

How about something like this (pseudo-code):

   dirs = [ ENV['TM_PROJECT_DIRECTORY'] ]
   ⋮
   dirs.insert($1) if line =~ /^make.*?: Entering directory `(.*?)'$/
   dirs.remove($1) if line =~ /^make.*?: Leaving directory `(.*?)'$/
   if line =~ /^(.*?):(?:(\d+):)?\s*(.*?)$/
     path = dirs.reverse.map { |dir| File.expand_path($3, dir) }.find  
{ |path| File.file? path }
   end

> 20c18
> [...]

Mail and/or Mailman destroy inline patches, also, please include svn  
metadata.

Simplest is just:

   cd ~/Library/Application\ Support/TextMate/Bundles
   svn diff Makefile.tmbundle|mate

Then in TextMate hit ⌃⌥⇧V and paste the patch online, then  
include a link in the email (preferably uncheck the ‘private’ when  
pasting online, that (sort of) ensures that the pastie won’t be  
removed from the pasting service).

> In a multi-Makefile project, it is also useful to be able to build
> just the current directory you are working with. To achieve this,
> simply duplicate the current Build command (with the above patch), and
> remove:
>
> Dir.chdir(ENV["TM_PROJECT_DIRECTORY"]) unless
> ENV["TM_PROJECT_DIRECTORY"].nil?
>
> [...]
> It would be great to see these included in the Makefile bundle.

I think for the latter we should take the Makefile location from an  
environment variable — this will then (sort of) allow per-folder  
variables (and in the future one can just set »TM_MAKEFILE_MASTER =  
"$TM_DIRECTORY/Makefile"« (i.e. the default would be  
"$TM_PROJECT_DIRECTORY/Makefile") — personally I sometimes have my  
Makefiles outside the source tree, so I need this as well.




More information about the textmate-dev mailing list