File: Makefile.mac

package info (click to toggle)
sailcut 1.3.2-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,504 kB
  • ctags: 1,066
  • sloc: cpp: 11,930; sh: 9,126; makefile: 214
file content (45 lines) | stat: -rw-r--r-- 1,386 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
##### MacOS distribution generation #####

STRIP = strip

VERSION := $(shell cat configure.in | grep AC_INIT | sed -e 's/.*, \([0-9a-zA-Z\.]*\).*/\1/')

mac_configure= ../configure
mac_builddir = mac-build
mac_distdir = mac-dist
mac_contents = $(mac_distdir)/Sailcut.app/Contents
mac_image := sailcut-$(VERSION)-macosx-$(shell uname -p)

mac-dist: mac-image mac-clean

mac-build-stamp:
	mkdir -p $(mac_builddir)
	cd $(mac_builddir) && \
	  $(mac_configure) \
	    --with-datadir=../Resources/Translations \
	    --with-docdir=../Resources/Documentation \
	    --with-icondir=../Resources
	make -C $(mac_builddir)
	touch $@

mac-install-stamp: mac-build-stamp
	rm -rf $(mac_distdir)
	mkdir -p $(mac_contents)/MacOS
	make -C $(mac_builddir) DESTDIR=$(CURDIR)/$(mac_contents)/MacOS/ bindir=. install
	# rename and strip binary
	mv $(mac_contents)/MacOS/sailcut $(mac_contents)/MacOS/Sailcut
	$(STRIP) $(mac_contents)/MacOS/Sailcut
	# add extra files
	echo -n "APPL????" > $(mac_contents)/PkgInfo
	cp $(mac_builddir)/sailcut.plist $(mac_contents)/Info.plist
	touch $@

mac-image: mac-install-stamp
	@echo; echo "## Building Mac image ##"; echo
	rm -f $(mac_image).dmg
	hdiutil create $(mac_image).dmg -srcdir $(mac_distdir) -fs HFS+ -volname "Sailcut CAD $(VERSION)"

mac-clean:
	rm -rf $(mac_distdir) $(mac_builddir) mac-build-stamp mac-install-stamp

.PHONY: mac-dist mac-clean mac-image