TaskStats: simplify margin formula
[xcsoar.git] / build / osx.mk
blobfff184c768c8511a87726fab416de449458c6fd0
1 ifeq ($(TARGET_IS_DARWIN),y)
3 HDIUTIL = hdiutil
4 HDIUTIL_OPTIONS =
6 ifneq ($(V),2)
7 HDIUTIL_OPTIONS += -quiet
8 endif
10 DMG_TMPDIR = $(TARGET_OUTPUT_DIR)/dmg
11 DMG_TMP = $(TARGET_OUTPUT_DIR)/tmp.dmg
13 # These shared libraries are going to be bundled in the DMG file, so
14 # the user doesn't need to install MacPorts. The install_name_tool
15 # command below changes the search path to @executable_path instead of
16 # /opt/local/lib/.
17 BUNDLED_DYLIBS = $(shell dyldinfo -dylibs $(TARGET_BIN_DIR)/xcsoar |grep /opt/local/lib/)
19 $(DMG_TMP): $(TARGET_BIN_DIR)/xcsoar build/Info.plist $(DATA)/graphics/logo_128.icns
20 @$(NQ)echo " DMG $@"
21 $(Q)rm -rf $(DMG_TMPDIR)
22 $(Q)$(MKDIR) -p $(DMG_TMPDIR)/XCSoar.app/Contents/MacOS
23 $(Q)sed -e "s,VERSION,$(FULL_VERSION)," <build/Info.plist >$(DMG_TMPDIR)/XCSoar.app/Contents/Info.plist
24 $(Q)cp $(TARGET_BIN_DIR)/xcsoar $(DMG_TMPDIR)/XCSoar.app/Contents/MacOS/
25 $(Q)cp $(BUNDLED_DYLIBS) $(DMG_TMPDIR)/XCSoar.app/Contents/MacOS/
26 $(Q)install_name_tool $(foreach path,$(BUNDLED_DYLIBS),-change $(path) @executable_path/$(notdir $(path))) $(DMG_TMPDIR)/XCSoar.app/Contents/MacOS/xcsoar
27 $(Q)$(MKDIR) -p $(DMG_TMPDIR)/XCSoar.app/Contents/Resources
28 $(Q)cp $(DATA)/graphics/logo_128.icns $(DMG_TMPDIR)/XCSoar.app/Contents/Resources/
29 $(Q)rm -f $@
30 $(Q)$(HDIUTIL) create $(HDIUTIL_OPTIONS) -fs HFS+ -volname "XCSoar" -srcfolder $(DMG_TMPDIR) $@
32 $(TARGET_OUTPUT_DIR)/XCSoar.dmg: $(DMG_TMP)
33 @$(NQ)echo " DMG $@"
34 $(Q)rm -f $@
35 $(Q)$(HDIUTIL) convert $(HDIUTIL_OPTIONS) $< -format UDCO -o $@
36 $(Q)$(HDIUTIL) internet-enable $(HDIUTIL_OPTIONS) -yes $@
38 dmg: $(TARGET_OUTPUT_DIR)/XCSoar.dmg
40 endif