7 Support for application bundles, for wxWindows 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>
34 <add-target target=
"$(BUNDLE_TGT)" type=
"action"/>
35 <modify-target target=
"$(BUNDLE_TGT)">
36 <!-- required data: -->
37 <depends>$(id)
</depends>
38 <depends-on-file>$(BUNDLE_PLIST)
</depends-on-file>
39 <depends-on-file>$(BUNDLE_RESOURCE)
</depends-on-file>
40 <depends-on-file>$(BUNDLE_ICONS)
</depends-on-file>
43 <!-- create the directories: -->
45 mkdir -p $(BUNDLE)/MacOS
46 mkdir -p $(BUNDLE)/Resources
49 sed -e "s/IDENTIFIER/$(BUNDLE_IDENTIFIER)/" \
50 -e "s/EXECUTABLE/$(id)/" \
51 -e "s/VERSION/$(WX_VERSION)/" \
52 $(BUNDLE_PLIST)
>$(BUNDLE)/Info.plist
55 echo -n "APPL????"
>$(BUNDLE)/PkgInfo
57 <!-- make a hardlink to the binary: -->
58 ln -f $(ref("__targetdir",id))$(ref("__targetname",id)) $(BUNDLE)/MacOS/$(id)
60 <!-- ditto wxWindows resources and icons: -->
61 ln -sf $(BUNDLE_RESOURCE) $(BUNDLE)/Resources/$(id).rsrc
62 ln -sf $(BUNDLE_ICONS) $(BUNDLE)/Resources/wxmac.icns
66 <!-- add pseudo target id_bundle: -->
67 <add-target target=
"$(id)_bundle" type=
"phony"
68 cond=
"PLATFORM_MACOSX=='1'"/>
69 <modify-target target=
"$(id)_bundle">
70 <dependency-of>all
</dependency-of>
71 <depends>$(BUNDLE_TGT)
</depends>
74 <!-- "make clean" should delete the bundle: -->
75 <modify-target target=
"clean">
76 <command>rm -rf $(id).app
</command>