Using Makefile on a Mac
Posted: Wed Aug 24, 2005 5:43 pm
Greetings members of the Mac OS X wxWidgets community:
I am attempting to answer a question with wxMac. I've not been able to solve this by searching the wxWidgets nor the Apple Developer Connection websites. I've also contacted the authors of 'Cross-Platform GUI Programming with wxWidgets.'
My question is this: How does one create an executable file for Mac OS X (.app) using make instead of Xcode?
I'm an older Solaris developer who likes his command line utilities. I know this can be done. It is done with the samples distributed with wxMac, but I've not been able to decipher how it is done. Obviously, the samples are built using make within the wxMac build directory (see "Building the samples" in http://wiki.wxwidgets.org/wiki.pl?Installing_WxMac ). However, moving a sample out of the wxMac build directory and into a user's directory is not straightforward (see "Setting up your work area: creating an app outside of the wxWidgets folders -- the better alternative" in http://wiki.wxwidgets.org/wiki.pl?Installing_WxMac ).
In attempting to 'make' the minimal sample in my home directory, I followed the instructions in "Cross-Platform GUI Programming with wxWidgets," specifically pages 564-565, 'Any Platform--Makefiles'. I had to make two modifications to the makefile. One, I had to include the full path to wx-config (as there was apparently an older version of wxWidgets installed with Mac OS 10.4, which I did not know about) and I had to include a linker flag for the c++ standard library (-lstdc++).
Now this works and creates the executable file 'minimal'. However it does not create the executable file 'minimal.app'. While 'mimimal' will load and execute, it will not function. The window cannot be selected, so you cannot drag it across the screen. Most (but not all) widgets to not respond.
There must be some other compiler step to take 'mimimal' to 'minimal.app' as it does when the samples are built using make. Or, 'minimal' and 'minimal.app' have separate build rules.
If anyone could be kind enough to point me in the right direction of understanding how Mac OS X applications are built in wxWidgets, I would appreciate it. I will, once I've figured out, create a short write-up for the wxWiki.
Thank you,
Mark
I am attempting to answer a question with wxMac. I've not been able to solve this by searching the wxWidgets nor the Apple Developer Connection websites. I've also contacted the authors of 'Cross-Platform GUI Programming with wxWidgets.'
My question is this: How does one create an executable file for Mac OS X (.app) using make instead of Xcode?
I'm an older Solaris developer who likes his command line utilities. I know this can be done. It is done with the samples distributed with wxMac, but I've not been able to decipher how it is done. Obviously, the samples are built using make within the wxMac build directory (see "Building the samples" in http://wiki.wxwidgets.org/wiki.pl?Installing_WxMac ). However, moving a sample out of the wxMac build directory and into a user's directory is not straightforward (see "Setting up your work area: creating an app outside of the wxWidgets folders -- the better alternative" in http://wiki.wxwidgets.org/wiki.pl?Installing_WxMac ).
In attempting to 'make' the minimal sample in my home directory, I followed the instructions in "Cross-Platform GUI Programming with wxWidgets," specifically pages 564-565, 'Any Platform--Makefiles'. I had to make two modifications to the makefile. One, I had to include the full path to wx-config (as there was apparently an older version of wxWidgets installed with Mac OS 10.4, which I did not know about) and I had to include a linker flag for the c++ standard library (-lstdc++).
Now this works and creates the executable file 'minimal'. However it does not create the executable file 'minimal.app'. While 'mimimal' will load and execute, it will not function. The window cannot be selected, so you cannot drag it across the screen. Most (but not all) widgets to not respond.
There must be some other compiler step to take 'mimimal' to 'minimal.app' as it does when the samples are built using make. Or, 'minimal' and 'minimal.app' have separate build rules.
If anyone could be kind enough to point me in the right direction of understanding how Mac OS X applications are built in wxWidgets, I would appreciate it. I will, once I've figured out, create a short write-up for the wxWiki.
Thank you,
Mark