How can i have makefile/shell script call /Applications/application.app? OS Mac OS X 10.6.6
emacs 23.2.1

I'm currently trying to install magit on carbon emacs using their proposed make solution. I'm an almost complete makefile newby so I might be on the complete wrong path altogether.
Makefile displays:

%.elc: %.el
$(BATCH) --eval '(byte-compile-file "$&lt;")'


which gets expanded to:

emacs -batch -q -no-site-file -eval "(setq load-path (cons (expand-file-name \".\") load-path))" --eval '(byte-compile-file "magit.el")'


What I do understand. However it comes back with:

Cannot open load file: subst-ksc


What after a bit of googling reveals some missing libraries. I also realized that the emacs referenced in the expanded command is pointing to /usr/bin/emacs which is one big file, I don't see the normal lisp / site-lisp / etc directories. I also know that my prefered emacs is carbon emacs located in /Application/Emacs.app which just opens when clicking on it, or alternatively, I can open it in with the terminal:

open /Application/MyApp.app


Finally the title question: How can I make Makefile using the Emacs.app on the applications directory? I hope someone here knows the answer, or can point me to alternatives.

regards,
Jeroen.
To use the Emacs.app from shell you need the unix executable embedded inside it. It is at Emacs.app/Contents/MacOS/Emacs (I don't have this version of emacs so the capitalisation might differ)

An alternative is to use open to start any app from the workspace using open.

e.g. 

open -a Emacs.app --args &lt;all those passed to emacs&gt;