Greetings to everyone,
How is it possible to compile a small program via short-cut. Until now I've used apple-cmd+R (RUN/Compile via xCode) in my .m files (objective-c). Via command usually I do something like this:
Angel:Fraction atma$ ls Fraction.h Fraction.m main.m Angel:Fraction atma$ gcc Fraction.m main.m -o Fraction -l objc Angel:Fraction atma$ ./Fraction 5 / 10 = 0.5 0 / 0 = 0 Angel:Fraction atma$
Best regards & thanks in advance
Panagiotis (atma) Atmatzidis
email: atma@convalesco.org URL: http://www.convalesco.org -- The wise man said: "Never argue with an idiot. They bring you down to their level and beat you with experience."
Hello again,
I've wrote a small bundle to do what I'd like but I'm missing something:
---- #!/usr/bin/sh - atma 05/11/2006 BASE=${TM_FILEPATH%.m} DIR=${TM_DIRECTORY}
gcc -o "$TM_FILEPATH" $DIR/main.m "$BASE" -l objc
# Simple bash check out and compile
if [[ -e $BASE ]] then echo “Executing $BASE” echo “” exec $BASE else echo “” echo “File does not exist” fi
----
Apparently the program cannot find "main.m" file. Can anyone see any obvious errors to this amateur bundle?
regards
On 31 Μαρ 2009, at 6:40 ΜΜ, Panagiotis Atmatzidis wrote:
Greetings to everyone,
How is it possible to compile a small program via short-cut. Until now I've used apple-cmd+R (RUN/Compile via xCode) in my .m files (objective-c). Via command usually I do something like this:
Angel:Fraction atma$ ls Fraction.h Fraction.m main.m Angel:Fraction atma$ gcc Fraction.m main.m -o Fraction -l objc Angel:Fraction atma$ ./Fraction 5 / 10 = 0.5 0 / 0 = 0 Angel:Fraction atma$
Best regards & thanks in advance
Panagiotis (atma) Atmatzidis
email: atma@convalesco.org URL: http://www.convalesco.org -- The wise man said: "Never argue with an idiot. They bring you down to their level and beat you with experience."
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Panagiotis (atma) Atmatzidis
email: atma@convalesco.org URL: http://www.convalesco.org -- The wise man said: "Never argue with an idiot. They bring you down to their level and beat you with experience."
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"