I'm not that creative so I haven't figured out how to do this yet.
I have the following structure
project/ project/classes/ project/src/ projekt/Makefile
I usually create a TM-project for the source-folder. How can I make a macro that executes the makefile?
Or any other ideas on how to simplify compiling? Hopefully I will only be using the terminal to start my programs
Regards Ivar Åsell
Ivar Åsell wrote:
I'm not that creative so I haven't figured out how to do this yet.
I have the following structure
project/ project/classes/ project/src/ projekt/Makefile
I usually create a TM-project for the source-folder. How can I make a macro that executes the makefile?
I've written a shell script called "makeup" that searches for a Makefile in the current directory. If it doesn't find one, it keeps searching up the directory structure. That way, I can type "makeup" in any directory in the project and it will find the Makefile.
You can create a command that runs "makeup" and that should do what you want. Here's makeup:
#! /bin/sh # # usage: makeup [args...] # # Finds the first makefile in the current directory or any directory above and # then runs make, passing on any args given to this script.
start_dir=`pwd`
while [ /bin/true ] ; do if [ -f Makefile || -f makefile ] ; then # If we've found a makefile, go back to the original directory and use # the -C flag to tell make to run from the directory where we found # the makefile. We do this so that error messages produced during the # make process are relative to the current directory. I think. here=`pwd` cd $start_dir make -C $here $* exit fi
# Stop if we're in the top directory. if [ "/" == `pwd` ] ; then # No parent directory echo no makefile found exit 1 fi
# Keep swimming...keep swimming...swimming, swimming, swimming... cd .. done
Jim
On Nov 18, 2004, at 9:16 AM, Ivar Åsell wrote:
I usually create a TM-project for the source-folder. How can I make a macro that executes the makefile?
You probably want to do a command instead of a macro.
It sounds like you can do: cd $TM_PROJECT_DIRECTORY/.. make
If the makefile outputs "simple" error lines with filename and line number, you can set output to external window and enter a regular expression to parse the lines (so that you can click on errors) -- there's more about this in the manual -- if it's not sufficient, just ask and I'll clarify! :)
Hopefully I will only be using the terminal to start my programs
Just a FYI, you can execute commands in the terminal also via commands, e.g.: osascript -e 'tell app "Terminal" to do script "data"'
This will execute “date” in a terminal. To give it focus, you may also want to do: osascript -e 'tell app "Terminal" to activate'
On 18. nov 2004, at 15:54, Allan Odgaard wrote:
It sounds like you can do: cd $TM_PROJECT_DIRECTORY/.. make
or simply make -C $TM_PROJECT_DIRECTORY/..
I would be really interested in being able to click errors to jump to the file+row. I just recently posted about regexp help and sad to say I have no idea where to start on this one either.
Would love it if someone could tell how to do it and even better, learn me so I can do it on my own next time I come up with an idea =)
Kind Regards Ivar
If the makefile outputs "simple" error lines with filename and line number, you can set output to external window and enter a regular expression to parse the lines (so that you can click on errors) -- there's more about this in the manual -- if it's not sufficient, just ask and I'll clarify! :)
Hopefully I will only be using the terminal to start my programs
Just a FYI, you can execute commands in the terminal also via commands, e.g.: osascript -e 'tell app "Terminal" to do script "data"'
This will execute “date” in a terminal. To give it focus, you may also want to do: osascript -e 'tell app "Terminal" to activate'
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/mailman/listinfo/textmate