]>
Commit | Line | Data |
---|---|---|
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"> | |
732c71cf | 19 | $(TOP_SRCDIR)src/osx/carbon/Info.plist.in |
425c0d76 | 20 | </set> |
425c0d76 | 21 | <set var="BUNDLE_ICONS"> |
732c71cf | 22 | $(TOP_SRCDIR)src/osx/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> | |
b6460890 VS |
34 | |
35 | <add-target target="$(BUNDLE_TGT)" type="action" | |
36 | cond="target and PLATFORM_MACOSX=='1'"/> | |
54eba47d | 37 | <modify-target target="$(BUNDLE_TGT)"> |
425c0d76 VS |
38 | <!-- required data: --> |
39 | <depends>$(id)</depends> | |
40 | <depends-on-file>$(BUNDLE_PLIST)</depends-on-file> | |
425c0d76 VS |
41 | <depends-on-file>$(BUNDLE_ICONS)</depends-on-file> |
42 | ||
43 | <command> | |
44 | <!-- create the directories: --> | |
45 | mkdir -p $(BUNDLE) | |
46 | mkdir -p $(BUNDLE)/MacOS | |
47 | mkdir -p $(BUNDLE)/Resources | |
48 | ||
49 | <!-- Info.plist: --> | |
50 | sed -e "s/IDENTIFIER/$(BUNDLE_IDENTIFIER)/" \ | |
51 | -e "s/EXECUTABLE/$(id)/" \ | |
52 | -e "s/VERSION/$(WX_VERSION)/" \ | |
53 | $(BUNDLE_PLIST) >$(BUNDLE)/Info.plist | |
54 | ||
55 | <!-- PkgInfo: --> | |
56 | echo -n "APPL????" >$(BUNDLE)/PkgInfo | |
57 | ||
58 | <!-- make a hardlink to the binary: --> | |
59 | ln -f $(ref("__targetdir",id))$(ref("__targetname",id)) $(BUNDLE)/MacOS/$(id) | |
60 | ||
77ffb593 | 61 | <!-- ditto wxWidgets resources and icons: --> |
6919b35e | 62 | cp -f $(BUNDLE_ICONS) $(BUNDLE)/Resources/wxmac.icns |
425c0d76 VS |
63 | </command> |
64 | </modify-target> | |
65 | ||
66 | <!-- add pseudo target id_bundle: --> | |
67 | <add-target target="$(id)_bundle" type="phony" | |
b6460890 | 68 | cond="target and PLATFORM_MACOSX=='1'"/> |
425c0d76 VS |
69 | <modify-target target="$(id)_bundle"> |
70 | <dependency-of>all</dependency-of> | |
0e6450e1 | 71 | <depends>$(BUNDLE_TGT_REF)</depends> |
425c0d76 VS |
72 | </modify-target> |
73 | ||
74 | <!-- "make clean" should delete the bundle: --> | |
75 | <modify-target target="clean"> | |
76 | <command>rm -rf $(id).app</command> | |
77 | </modify-target> | |
78 | ||
79 | </define-tag> | |
80 | ||
81 | </makefile> |