2003-08-10 21:21:23 +00:00
|
|
|
<?xml version="1.0" ?>
|
|
|
|
<!-- $Id$ -->
|
|
|
|
|
|
|
|
<makefile>
|
|
|
|
|
|
|
|
<!--
|
2004-05-23 14:56:36 +00:00
|
|
|
Support for application bundles, for wxWidgets samples.
|
2003-08-10 21:21:23 +00:00
|
|
|
-->
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Nasty hack: use $(srcdir) to obtain usable CFBundleIdentifier suffix;
|
|
|
|
converts $(srcdir) like "../../samples/minimal" to "samples.minimal".
|
|
|
|
-->
|
|
|
|
<set var="BUNDLE_IDENTIFIER">
|
|
|
|
`echo $(DOLLAR)(srcdir) | sed -e 's,\.\./,,g' | sed -e 's,/,.,g'`
|
|
|
|
</set>
|
|
|
|
|
2008-08-05 11:49:26 +00:00
|
|
|
<set var="BUNDLE_PLIST" overwrite="0">
|
2008-06-11 20:46:47 +00:00
|
|
|
$(TOP_SRCDIR)src/osx/carbon/Info.plist.in
|
2003-08-10 21:21:23 +00:00
|
|
|
</set>
|
2008-08-13 15:20:57 +00:00
|
|
|
<set var="BUNDLE_ICON" overwrite="0">
|
2008-06-11 20:46:47 +00:00
|
|
|
$(TOP_SRCDIR)src/osx/carbon/wxmac.icns
|
2003-08-10 21:21:23 +00:00
|
|
|
</set>
|
2008-08-13 15:20:57 +00:00
|
|
|
<set var="BUNDLE_RESOURCES" overwrite="0"></set>
|
2003-08-10 21:21:23 +00:00
|
|
|
|
|
|
|
<define-tag name="wx-mac-app-bundle" rules="exe">
|
|
|
|
|
|
|
|
<!-- bundle directory: -->
|
|
|
|
<set var="BUNDLE">$(id).app/Contents</set>
|
2003-08-23 21:51:13 +00:00
|
|
|
<set var="BUNDLE_TGT">$(BUNDLE)/PkgInfo</set>
|
2004-04-15 21:53:36 +00:00
|
|
|
<set var="BUNDLE_TGT_REF">
|
2008-09-07 15:59:51 +00:00
|
|
|
<!-- TODO Remove Mac -->
|
2004-04-15 21:53:36 +00:00
|
|
|
<if cond="TOOLKIT=='MAC'">$(BUNDLE)/PkgInfo</if>
|
2008-09-07 15:59:51 +00:00
|
|
|
<if cond="TOOLKIT=='OSX_CARBON'">$(BUNDLE)/PkgInfo</if>
|
|
|
|
<if cond="TOOLKIT=='OSX_COCOA'">$(BUNDLE)/PkgInfo</if>
|
|
|
|
<if cond="TOOLKIT=='OSX_IPHONE'">$(BUNDLE)/PkgInfo</if>
|
2004-04-15 21:53:36 +00:00
|
|
|
<if cond="TOOLKIT=='COCOA'">$(BUNDLE)/PkgInfo</if>
|
|
|
|
</set>
|
2008-06-02 10:39:10 +00:00
|
|
|
|
|
|
|
<add-target target="$(BUNDLE_TGT)" type="action"
|
|
|
|
cond="target and PLATFORM_MACOSX=='1'"/>
|
2003-08-23 21:51:13 +00:00
|
|
|
<modify-target target="$(BUNDLE_TGT)">
|
2003-08-10 21:21:23 +00:00
|
|
|
<!-- required data: -->
|
|
|
|
<depends>$(id)</depends>
|
|
|
|
<depends-on-file>$(BUNDLE_PLIST)</depends-on-file>
|
2008-08-13 15:20:57 +00:00
|
|
|
<depends-on-file>$(BUNDLE_ICON)</depends-on-file>
|
|
|
|
<depends-on-file>$(BUNDLE_RESOURCES)</depends-on-file>
|
2003-08-10 21:21:23 +00:00
|
|
|
|
|
|
|
<command>
|
|
|
|
<!-- create the directories: -->
|
|
|
|
mkdir -p $(BUNDLE)
|
|
|
|
mkdir -p $(BUNDLE)/MacOS
|
|
|
|
mkdir -p $(BUNDLE)/Resources
|
|
|
|
|
|
|
|
<!-- Info.plist: -->
|
|
|
|
sed -e "s/IDENTIFIER/$(BUNDLE_IDENTIFIER)/" \
|
|
|
|
-e "s/EXECUTABLE/$(id)/" \
|
|
|
|
-e "s/VERSION/$(WX_VERSION)/" \
|
|
|
|
$(BUNDLE_PLIST) >$(BUNDLE)/Info.plist
|
|
|
|
|
|
|
|
<!-- PkgInfo: -->
|
|
|
|
echo -n "APPL????" >$(BUNDLE)/PkgInfo
|
|
|
|
|
2009-03-13 05:23:07 +00:00
|
|
|
<!-- move the binary: -->
|
2009-04-26 02:01:25 +00:00
|
|
|
ln -f $(ref("__targetdir",id))$(ref("__targetname",id)) $(BUNDLE)/MacOS/$(id)
|
2003-08-10 21:21:23 +00:00
|
|
|
|
2008-08-13 15:20:57 +00:00
|
|
|
<!-- copy the application icon: -->
|
|
|
|
cp -f $(BUNDLE_ICON) $(BUNDLE)/Resources/wxmac.icns
|
|
|
|
</command>
|
|
|
|
<if cond="BUNDLE_RESOURCES!=''">
|
|
|
|
<command>
|
|
|
|
<!-- copy all other bundle resources: -->
|
|
|
|
cp -f $(BUNDLE_RESOURCES) $(BUNDLE)/Resources
|
|
|
|
</command>
|
|
|
|
</if>
|
|
|
|
|
2003-08-10 21:21:23 +00:00
|
|
|
</modify-target>
|
|
|
|
|
|
|
|
<!-- add pseudo target id_bundle: -->
|
|
|
|
<add-target target="$(id)_bundle" type="phony"
|
2008-06-02 10:39:10 +00:00
|
|
|
cond="target and PLATFORM_MACOSX=='1'"/>
|
2003-08-10 21:21:23 +00:00
|
|
|
<modify-target target="$(id)_bundle">
|
|
|
|
<dependency-of>all</dependency-of>
|
2004-04-15 21:53:36 +00:00
|
|
|
<depends>$(BUNDLE_TGT_REF)</depends>
|
2003-08-10 21:21:23 +00:00
|
|
|
</modify-target>
|
|
|
|
|
|
|
|
<!-- "make clean" should delete the bundle: -->
|
|
|
|
<modify-target target="clean">
|
|
|
|
<command>rm -rf $(id).app</command>
|
|
|
|
</modify-target>
|
|
|
|
|
|
|
|
</define-tag>
|
|
|
|
|
|
|
|
</makefile>
|