2003-08-10 17:21:23 -04:00
|
|
|
<?xml version="1.0" ?>
|
|
|
|
<!-- $Id$ -->
|
|
|
|
|
|
|
|
<makefile>
|
|
|
|
|
|
|
|
<!--
|
2004-05-23 10:56:36 -04:00
|
|
|
Support for application bundles, for wxWidgets samples.
|
2003-08-10 17:21:23 -04: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>
|
|
|
|
|
|
|
|
<set var="BUNDLE_PLIST">
|
2004-03-27 05:38:21 -05:00
|
|
|
$(TOP_SRCDIR)src/mac/carbon/Info.plist.in
|
2003-08-10 17:21:23 -04:00
|
|
|
</set>
|
|
|
|
<set var="BUNDLE_ICONS">
|
2004-03-27 05:38:21 -05:00
|
|
|
$(TOP_SRCDIR)src/mac/carbon/wxmac.icns
|
2003-08-10 17:21:23 -04:00
|
|
|
</set>
|
|
|
|
|
|
|
|
<define-tag name="wx-mac-app-bundle" rules="exe">
|
|
|
|
|
|
|
|
<!-- bundle directory: -->
|
|
|
|
<set var="BUNDLE">$(id).app/Contents</set>
|
2003-08-23 17:51:13 -04:00
|
|
|
<set var="BUNDLE_TGT">$(BUNDLE)/PkgInfo</set>
|
2004-04-15 17:53:36 -04:00
|
|
|
<set var="BUNDLE_TGT_REF">
|
|
|
|
<if cond="TOOLKIT=='MAC'">$(BUNDLE)/PkgInfo</if>
|
|
|
|
<if cond="TOOLKIT=='COCOA'">$(BUNDLE)/PkgInfo</if>
|
|
|
|
</set>
|
2003-08-10 17:21:23 -04:00
|
|
|
|
2003-08-23 17:51:13 -04:00
|
|
|
<add-target target="$(BUNDLE_TGT)" type="action"/>
|
|
|
|
<modify-target target="$(BUNDLE_TGT)">
|
2003-08-10 17:21:23 -04:00
|
|
|
<!-- required data: -->
|
|
|
|
<depends>$(id)</depends>
|
|
|
|
<depends-on-file>$(BUNDLE_PLIST)</depends-on-file>
|
|
|
|
<depends-on-file>$(BUNDLE_ICONS)</depends-on-file>
|
|
|
|
|
|
|
|
<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
|
|
|
|
|
|
|
|
<!-- make a hardlink to the binary: -->
|
|
|
|
ln -f $(ref("__targetdir",id))$(ref("__targetname",id)) $(BUNDLE)/MacOS/$(id)
|
|
|
|
|
2004-05-23 10:56:36 -04:00
|
|
|
<!-- ditto wxWidgets resources and icons: -->
|
2004-04-14 12:00:01 -04:00
|
|
|
cp -f $(BUNDLE_ICONS) $(BUNDLE)/Resources/wxmac.icns
|
2003-08-10 17:21:23 -04:00
|
|
|
</command>
|
|
|
|
</modify-target>
|
|
|
|
|
|
|
|
<!-- add pseudo target id_bundle: -->
|
|
|
|
<add-target target="$(id)_bundle" type="phony"
|
|
|
|
cond="PLATFORM_MACOSX=='1'"/>
|
|
|
|
<modify-target target="$(id)_bundle">
|
|
|
|
<dependency-of>all</dependency-of>
|
2004-04-15 17:53:36 -04:00
|
|
|
<depends>$(BUNDLE_TGT_REF)</depends>
|
2003-08-10 17:21:23 -04:00
|
|
|
</modify-target>
|
|
|
|
|
|
|
|
<!-- "make clean" should delete the bundle: -->
|
|
|
|
<modify-target target="clean">
|
|
|
|
<command>rm -rf $(id).app</command>
|
|
|
|
</modify-target>
|
|
|
|
|
|
|
|
</define-tag>
|
|
|
|
|
|
|
|
</makefile>
|