BMK - How do I get to it?

BlitzMax Forums/BlitzMax Beginners Area/BMK - How do I get to it?

Emmett(Posted 2005) [#1]
Would any mac os10.2 user care to explain how to point the terminal to BMK?
Remember - I am at the a,b,c level of understanding here. Thanks


N(Posted 2005) [#2]
*points to your PATH environment variable*

Da-ding!


Todd(Posted 2005) [#3]
You need to either provide the full path to the 'bmk' executable, or add it's path to your PATH environment variable. The first one is easy. Just type the full path that you installed BlitzMax to before you type 'bmk'. For example, I installed BlitzMax in '/Developer/BlitzMax'. Here's what I would type:

/Developer/BlitzMax/bin/bmk

If you don't want to have to type this each time you want to use 'bmk' than you can also it it to your PATH. The PATH environment variable tells Terminal (technically, 'bash') where to look for executables. Since I installed BlitzMax in '/Developer/BlitzMax', here's how I would add the path to 'bmk' to my PATH environment variable:

echo "export PATH=\$PATH:/Developer/BlitzMax/bin" >> ~/.bash_profile

This adds the quoted line above into the '.bash_profile' file in your home directory, creating one if it does not exist. Whenever 'bash' (the shell which interprets all terminal commands in Mac OS X) starts up, it reads this file, executing each line in the file. This appends the '/Developer/BlitzMax/bin' directory to the PATH environment variable.

After typing this line, you need to close your Terminal window, and open a new one for it to take effect. After that, you should be able to type 'bmk' without providing a full path to the executable. Also, since you're using OS X 10.2, you may need to switch your shell to 'bash'. To do this open Terminal, choose Preferences from the menu, select 'Execute This Command:', and enter '/bin/bash' into the text field provided.

Hope that helps!


Emmett(Posted 2005) [#4]
Thanks Todd,
I selected 'Execute This Command:'
entered '/bin/bash'
After some trial and error and a little blind luck I chose to 'File/New Shell' and wallha - I'm in the bash-2.05a$ shell.

I'm almost there. I take it that all relevant files have to be in the same directory as BlitzMax cause after moving the .bmx source which uses incbin throughout the build fails to find the media files which are buried a few directories below.

So, guess this means I move all files to the BlitzMax dir and change the code to reflect this and I should be good to go.

[edit]
Well after some fiddling - it works.
Then I find out that the file created runs in the Terminal?
Is that all I can do or is there a way to get it to run by double clicking an icon?


xlsior(Posted 2005) [#5]
You should be able to browse to the folder that contains your program through the normal GUI... the shell is just a command line interface to the same filesystem after all.


Todd(Posted 2005) [#6]
What xlsior described works, but it launches your app via the Terminal, which is probably not what you want. Whenever the BlitzMax IDE compiles an executable it places it inside a folder with a ".app" extension. This causes the Finder to treat it as a normal application, and it's how almost every Mac OS X application works. In the Terminal it appears as a folder, but when viewed in the Finder is appears to be a single file. To make it easy, here's the commands you would need to type to create an app wrapper in the Terminal:

$ cd /path/to/my/app
$ mkdir -p ./MyApp.app/Contents/MacOS
$ cp myapp MyApp.app/Contents/MacOS
You'll need to replace 'myapp' with the file name of your application. The '.app' extension will also be hidden when viewed in the Finder. Now, you should be able to double-click it's icon in the Finder to run your application.

Finally, you might want to change your app's icon from the default. I've written a little utility to handle this for you. It's called IconSwitcher (169 Kb). It includes the source code as well. You'll also need to use the 'Icon Composer' utility (/Developer/Applications/Utilities/) that comes with the developer tools to create an icon for your app.