MacOS X bundles support
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22755 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -40,6 +40,7 @@
|
|||||||
|
|
||||||
<template id="wx_sample" template="wx_util">
|
<template id="wx_sample" template="wx_util">
|
||||||
<if cond="FORMAT=='autoconf'">
|
<if cond="FORMAT=='autoconf'">
|
||||||
|
<wx-mac-app-bundle/>
|
||||||
<ldflags>$(SAMPLES_RPATH_FLAG)</ldflags>
|
<ldflags>$(SAMPLES_RPATH_FLAG)</ldflags>
|
||||||
<__command>$(LF)$(SAMPLES_RPATH_POSTLINK)</__command>
|
<__command>$(LF)$(SAMPLES_RPATH_POSTLINK)</__command>
|
||||||
</if>
|
</if>
|
||||||
@@ -78,4 +79,8 @@
|
|||||||
-->
|
-->
|
||||||
</define-rule>
|
</define-rule>
|
||||||
|
|
||||||
|
<if cond="FORMAT=='autoconf'">
|
||||||
|
<include file="mac_bundles.bkl"/>
|
||||||
|
</if>
|
||||||
|
|
||||||
</makefile>
|
</makefile>
|
||||||
|
80
build/bakefiles/mac_bundles.bkl
Normal file
80
build/bakefiles/mac_bundles.bkl
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<?xml version="1.0" ?>
|
||||||
|
<!-- $Id$ -->
|
||||||
|
|
||||||
|
<makefile>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Support for application bundles, for wxWindows samples.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!--
|
||||||
|
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">
|
||||||
|
$(TOP_SRCDIR)src/mac/Info.plist.in
|
||||||
|
</set>
|
||||||
|
<set var="BUNDLE_RESOURCE">
|
||||||
|
$(LIBDIRNAME)/libwx_$(TOOLCHAIN_NAME).$(WXSOVERSION[0]).rsrc
|
||||||
|
</set>
|
||||||
|
<set var="BUNDLE_ICONS">
|
||||||
|
$(TOP_SRCDIR)src/mac/wxmac.icns
|
||||||
|
</set>
|
||||||
|
|
||||||
|
<define-tag name="wx-mac-app-bundle" rules="exe">
|
||||||
|
|
||||||
|
<!-- bundle directory: -->
|
||||||
|
<set var="BUNDLE">$(id).app/Contents</set>
|
||||||
|
|
||||||
|
<add-target target="$(BUNDLE)" type="action"/>
|
||||||
|
<modify-target target="$(BUNDLE)">
|
||||||
|
<!-- required data: -->
|
||||||
|
<depends>$(id)</depends>
|
||||||
|
<depends-on-file>$(BUNDLE_PLIST)</depends-on-file>
|
||||||
|
<depends-on-file>$(BUNDLE_RESOURCE)</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)
|
||||||
|
|
||||||
|
<!-- ditto wxWindows resources and icons: -->
|
||||||
|
ln -f $(BUNDLE_RESOURCE) $(BUNDLE)/Resources/$(id).rsrc
|
||||||
|
ln -f $(BUNDLE_ICONS) $(BUNDLE)/Resources/wxmac.icns
|
||||||
|
</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>
|
||||||
|
<depends>$(BUNDLE)</depends>
|
||||||
|
</modify-target>
|
||||||
|
|
||||||
|
<!-- "make clean" should delete the bundle: -->
|
||||||
|
<modify-target target="clean">
|
||||||
|
<command>rm -rf $(id).app</command>
|
||||||
|
</modify-target>
|
||||||
|
|
||||||
|
</define-tag>
|
||||||
|
|
||||||
|
</makefile>
|
@@ -123,15 +123,17 @@ COND_MONOLITHIC_1___WXLIB_MONO_p = \
|
|||||||
@COND_PLATFORM_MAC_1@__minimal___mac_setfilecmd = \
|
@COND_PLATFORM_MAC_1@__minimal___mac_setfilecmd = \
|
||||||
@COND_PLATFORM_MAC_1@ $(SETFILE) -a C minimal$(EXEEXT)
|
@COND_PLATFORM_MAC_1@ $(SETFILE) -a C minimal$(EXEEXT)
|
||||||
@COND_PLATFORM_WIN32_1@__minimal___win32rc = minimal_sample_rc.o
|
@COND_PLATFORM_WIN32_1@__minimal___win32rc = minimal_sample_rc.o
|
||||||
|
@COND_PLATFORM_MACOSX_1@__minimal_bundle___depname = minimal_bundle
|
||||||
|
|
||||||
### Targets: ###
|
### Targets: ###
|
||||||
|
|
||||||
all: minimal$(EXEEXT)
|
all: minimal$(EXEEXT) $(__minimal_bundle___depname)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf ./.deps ./.pch
|
rm -rf ./.deps ./.pch
|
||||||
rm -f ./*.o
|
rm -f ./*.o
|
||||||
rm -f minimal$(EXEEXT)
|
rm -f minimal$(EXEEXT)
|
||||||
|
rm -rf minimal.app
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
rm -f configure config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile
|
rm -f configure config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile
|
||||||
@@ -146,6 +148,29 @@ minimal$(EXEEXT): $(MINIMAL_OBJECTS) $(__minimal___win32rc)
|
|||||||
$(__minimal___mac_setfilecmd)
|
$(__minimal___mac_setfilecmd)
|
||||||
$(SAMPLES_RPATH_POSTLINK)
|
$(SAMPLES_RPATH_POSTLINK)
|
||||||
|
|
||||||
|
minimal.app/Contents: minimal$(EXEEXT) $(top_srcdir)/src/mac/Info.plist.in $(LIBDIRNAME)/libwx_$(TOOLCHAIN_NAME).0.rsrc $(top_srcdir)/src/mac/wxmac.icns
|
||||||
|
mkdir -p minimal.app/Contents
|
||||||
|
mkdir -p minimal.app/Contents/MacOS
|
||||||
|
mkdir -p minimal.app/Contents/Resources
|
||||||
|
|
||||||
|
|
||||||
|
sed -e "s/IDENTIFIER/`echo $(srcdir) | sed -e 's,\.\./,,g' | sed -e 's,/,.,g'`/" \
|
||||||
|
-e "s/EXECUTABLE/minimal/" \
|
||||||
|
-e "s/VERSION/2.5.0/" \
|
||||||
|
$(top_srcdir)/src/mac/Info.plist.in >minimal.app/Contents/Info.plist
|
||||||
|
|
||||||
|
|
||||||
|
echo -n "APPL????" >minimal.app/Contents/PkgInfo
|
||||||
|
|
||||||
|
|
||||||
|
ln -f minimal$(EXEEXT) minimal.app/Contents/MacOS/minimal
|
||||||
|
|
||||||
|
|
||||||
|
ln -f $(LIBDIRNAME)/libwx_$(TOOLCHAIN_NAME).0.rsrc minimal.app/Contents/Resources/minimal.rsrc
|
||||||
|
ln -f $(top_srcdir)/src/mac/wxmac.icns minimal.app/Contents/Resources/wxmac.icns
|
||||||
|
|
||||||
|
@COND_PLATFORM_MACOSX_1@minimal_bundle: minimal.app/Contents
|
||||||
|
|
||||||
minimal_minimal.o: $(srcdir)/minimal.cpp
|
minimal_minimal.o: $(srcdir)/minimal.cpp
|
||||||
$(CXXC) -c -o $@ $(MINIMAL_CXXFLAGS) $<
|
$(CXXC) -c -o $@ $(MINIMAL_CXXFLAGS) $<
|
||||||
|
|
||||||
@@ -158,4 +183,4 @@ uninstall:
|
|||||||
# Include dependency info, if present:
|
# Include dependency info, if present:
|
||||||
@IF_GNU_MAKE@-include .deps/*.d
|
@IF_GNU_MAKE@-include .deps/*.d
|
||||||
|
|
||||||
.PHONY: all clean distclean install uninstall
|
.PHONY: all clean distclean install minimal_bundle uninstall
|
||||||
|
Reference in New Issue
Block a user