[TxMt] Re: Compile small objc project (.h, .m and main)

Allan Odgaard mailinglist at textmate.org
Tue Apr 14 07:32:31 UTC 2009


On 4 Apr 2009, at 20:58, Panagiotis Atmatzidis wrote:

> I've wrote a small bundle to do what I'd like but I'm missing  
> something:

Did you see we already have ⌘R in the C bundle to “compile and  
run” current file?

It wouldn’t compile both your files though, but we are evaluating  
improvements.

One idea I really like is to make ⌘R in the C bundle simply run make,  
but first generate a Makefile if none exist (taking hints about build  
options and included files from the source comments).

> ----
> #!/usr/bin/sh  - atma 05/11/2006
> BASE=${TM_FILEPATH%.m}
> DIR=${TM_DIRECTORY}
>
> gcc  -o "$TM_FILEPATH" $DIR/main.m "$BASE" -l objc

I think you need to swap TM_FILEPATH and BASE.

> [...]
> Apparently the program cannot find "main.m" file. Can anyone see any
> obvious errors to this amateur bundle?

If there is a space in your diretory, it will fail. Variable use  
should be double quoted.

Try insert e.g.: echo "$DIR/main.m"




More information about the textmate mailing list