7 Support for application bundles, for wxWidgets samples.
11 Nasty hack: use $(srcdir) to obtain usable CFBundleIdentifier suffix;
12 converts $(srcdir) like "../../samples/minimal" to "samples.minimal".
14 <set var=
"BUNDLE_IDENTIFIER">
15 `echo $(DOLLAR)(srcdir) | sed -e 's,\.\./,,g' | sed -e 's,/,.,g'`
18 <set var=
"BUNDLE_PLIST">
19 $(TOP_SRCDIR)src/mac/carbon/Info.plist.in
21 <set var=
"BUNDLE_RESOURCE">
22 $(LIBDIRNAME)/libwx_$(TOOLCHAIN_NAME).$(WXSOVERSION[
0]).rsrc
24 <set var=
"BUNDLE_ICONS">
25 $(TOP_SRCDIR)src/mac/carbon/wxmac.icns
28 <define-tag name=
"wx-mac-app-bundle" rules=
"exe">
30 <!-- bundle directory: -->
31 <set var=
"BUNDLE">$(id).app/Contents
</set>
32 <set var=
"BUNDLE_TGT">$(BUNDLE)/PkgInfo
</set>
33 <set var=
"BUNDLE_TGT_REF">
34 <if cond=
"TOOLKIT=='MAC'">$(BUNDLE)/PkgInfo
</if>
35 <if cond=
"TOOLKIT=='COCOA'">$(BUNDLE)/PkgInfo
</if>
38 <add-target target=
"$(BUNDLE_TGT)" type=
"action"/>
39 <modify-target target=
"$(BUNDLE_TGT)">
40 <!-- required data: -->
41 <depends>$(id)
</depends>
42 <depends-on-file>$(BUNDLE_PLIST)
</depends-on-file>
43 <depends-on-file>$(BUNDLE_RESOURCE)
</depends-on-file>
44 <depends-on-file>$(BUNDLE_ICONS)
</depends-on-file>
47 <!-- create the directories: -->
49 mkdir -p $(BUNDLE)/MacOS
50 mkdir -p $(BUNDLE)/Resources
53 sed -e "s/IDENTIFIER/$(BUNDLE_IDENTIFIER)/" \
54 -e "s/EXECUTABLE/$(id)/" \
55 -e "s/VERSION/$(WX_VERSION)/" \
56 $(BUNDLE_PLIST)
>$(BUNDLE)/Info.plist
59 echo -n "APPL????"
>$(BUNDLE)/PkgInfo
61 <!-- make a hardlink to the binary: -->
62 ln -f $(ref("__targetdir",id))$(ref("__targetname",id)) $(BUNDLE)/MacOS/$(id)
64 <!-- ditto wxWidgets resources and icons: -->
65 cp -f $(BUNDLE_RESOURCE) $(BUNDLE)/Resources/$(id).rsrc
66 cp -f $(BUNDLE_ICONS) $(BUNDLE)/Resources/wxmac.icns
70 <!-- add pseudo target id_bundle: -->
71 <add-target target=
"$(id)_bundle" type=
"phony"
72 cond=
"PLATFORM_MACOSX=='1'"/>
73 <modify-target target=
"$(id)_bundle">
74 <dependency-of>all
</dependency-of>
75 <depends>$(BUNDLE_TGT_REF)
</depends>
78 <!-- "make clean" should delete the bundle: -->
79 <modify-target target=
"clean">
80 <command>rm -rf $(id).app
</command>