]> git.saurik.com Git - wxWidgets.git/blame - build/bakefiles/mac_bundles.bkl
require bakefile 0.2.2 and not 0.2.1 and do it for all platforms (part of patch 1604462)
[wxWidgets.git] / build / bakefiles / mac_bundles.bkl
CommitLineData
425c0d76
VS
1<?xml version="1.0" ?>
2<!-- $Id$ -->
3
4<makefile>
5
6 <!--
77ffb593 7 Support for application bundles, for wxWidgets samples.
425c0d76
VS
8 -->
9
10 <!--
11 Nasty hack: use $(srcdir) to obtain usable CFBundleIdentifier suffix;
12 converts $(srcdir) like "../../samples/minimal" to "samples.minimal".
13 -->
14 <set var="BUNDLE_IDENTIFIER">
15 `echo $(DOLLAR)(srcdir) | sed -e 's,\.\./,,g' | sed -e 's,/,.,g'`
16 </set>
17
18 <set var="BUNDLE_PLIST">
0b9d77ce 19 $(TOP_SRCDIR)src/mac/carbon/Info.plist.in
425c0d76 20 </set>
425c0d76 21 <set var="BUNDLE_ICONS">
0b9d77ce 22 $(TOP_SRCDIR)src/mac/carbon/wxmac.icns
425c0d76
VS
23 </set>
24
25 <define-tag name="wx-mac-app-bundle" rules="exe">
26
27 <!-- bundle directory: -->
28 <set var="BUNDLE">$(id).app/Contents</set>
54eba47d 29 <set var="BUNDLE_TGT">$(BUNDLE)/PkgInfo</set>
0e6450e1
VS
30 <set var="BUNDLE_TGT_REF">
31 <if cond="TOOLKIT=='MAC'">$(BUNDLE)/PkgInfo</if>
32 <if cond="TOOLKIT=='COCOA'">$(BUNDLE)/PkgInfo</if>
33 </set>
425c0d76 34
54eba47d
VS
35 <add-target target="$(BUNDLE_TGT)" type="action"/>
36 <modify-target target="$(BUNDLE_TGT)">
425c0d76
VS
37 <!-- required data: -->
38 <depends>$(id)</depends>
39 <depends-on-file>$(BUNDLE_PLIST)</depends-on-file>
425c0d76
VS
40 <depends-on-file>$(BUNDLE_ICONS)</depends-on-file>
41
42 <command>
43 <!-- create the directories: -->
44 mkdir -p $(BUNDLE)
45 mkdir -p $(BUNDLE)/MacOS
46 mkdir -p $(BUNDLE)/Resources
47
48 <!-- Info.plist: -->
49 sed -e "s/IDENTIFIER/$(BUNDLE_IDENTIFIER)/" \
50 -e "s/EXECUTABLE/$(id)/" \
51 -e "s/VERSION/$(WX_VERSION)/" \
52 $(BUNDLE_PLIST) >$(BUNDLE)/Info.plist
53
54 <!-- PkgInfo: -->
55 echo -n "APPL????" >$(BUNDLE)/PkgInfo
56
57 <!-- make a hardlink to the binary: -->
58 ln -f $(ref("__targetdir",id))$(ref("__targetname",id)) $(BUNDLE)/MacOS/$(id)
59
77ffb593 60 <!-- ditto wxWidgets resources and icons: -->
6919b35e 61 cp -f $(BUNDLE_ICONS) $(BUNDLE)/Resources/wxmac.icns
425c0d76
VS
62 </command>
63 </modify-target>
64
65 <!-- add pseudo target id_bundle: -->
66 <add-target target="$(id)_bundle" type="phony"
67 cond="PLATFORM_MACOSX=='1'"/>
68 <modify-target target="$(id)_bundle">
69 <dependency-of>all</dependency-of>
0e6450e1 70 <depends>$(BUNDLE_TGT_REF)</depends>
425c0d76
VS
71 </modify-target>
72
73 <!-- "make clean" should delete the bundle: -->
74 <modify-target target="clean">
75 <command>rm -rf $(id).app</command>
76 </modify-target>
77
78 </define-tag>
79
80</makefile>