-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.macosx
79 lines (67 loc) · 2.8 KB
/
Makefile.macosx
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# this Makefile assumes that you have used macports to install all the depemdencies.
# that is were macports is installed by default
PORTSDIR = /opt/local
CPPPATH = $(PORTSDIR)/include
LIBPATH = $(PORTSDIR)/lib
# note that the default compoler on OS X 10.5 is gcc-4.0.1, which can't handle -std=c++0x
# you can set this simply to "gcc" and "g++" if your default compiler is gcc-4.4 of higher.
CC = $(PORTSDIR)/bin/gcc-mp-4.4
CXX = $(PORTSDIR)/bin/g++-mp-4.4
# the default (BSD) "install" does not support the -D flag, so we're using macports GNU variant
INSTALL = ginstall
# the portable application bundle
BUNDLE = Pingus.app
# the volume name for the package (the filename ,*.dmg, will include the VERSION)
# NOTE: currently an initial size of 100M is used. This has to be increased as needed!
PACKAGE = Pingus
# these files are, beside the bundle, added to the package
PACKAGEDOCS = README NEWS COPYING AUTHORS
build/pingus:
mkdir -p build
scons CPPPATH=$(CPPPATH) LIBPATH=$(LIBPATH) CXX=$(CXX) CC=$(CC)
ln -fs build/pingus
build/pingus.icns: data/images/icons/pingus-icon.png
mkdir -p build
makeicns -in $< -out $@
bundle: install-exec install-data install-icon
create-app-bundle: build/pingus.icns
mkdir -p $(BUNDLE)/Contents/MacOS
mkdir -p $(BUNDLE)/Contents/Resources
mkdir -p $(BUNDLE)/Contents/libs
echo "APPL" > $(BUNDLE)/Contents/PkgInfo
install-icon: create-app-bundle build/pingus
install build/pingus.icns $(BUNDLE)/Contents/Resources
echo "<plist version=\"1.0\"><dict><key>CFBundleIconFile</key><string>pingus.icns</string></dict></plist>" > $(BUNDLE)/Contents/Info.plist
install-exec: create-app-bundle build/pingus
install build/pingus $(BUNDLE)/Contents/MacOS
dylibbundler -b -x $(BUNDLE)/Contents/MacOS/pingus -od -d $(BUNDLE)/Contents/libs/
install-data:
for file in `( cd data ; find . \
-type f -a \( \
-name "*.png" -o \
-name "*.jpg" -o \
-name "*.wav" -o \
-name "*.scm" -o \
-name "*.font" -o \
-name "*.story" -o \
-name "*.credits" -o \
-name "*.prefab" -o \
-name "*.it" -o \
-name "*.ogg" -o \
-name "*.s3m" -o \
-name "*.po" -o \
-name "*.worldmap" -o \
-name "*.res" -o \
-name "*.pingus" -o \
-name "*.levelset" -o \
-name "*.sprite" \
\) )`; do $(INSTALL) -D data/$$file $(BUNDLE)/Contents/Resources/$$file; done
package: bundle
hdiutil create -size 100M -fs HFS+J -volname $(PACKAGE) $(PACKAGE)-tmp.dmg
hdiutil attach $(PACKAGE)-tmp.dmg -readwrite -mount required
cp -R -p $(BUNDLE) /Volumes/$(PACKAGE)/
cp $(PACKAGEDOCS) /Volumes/$(PACKAGE)
hdiutil detach /Volumes/$(PACKAGE) -force
./SLA-dmg.sh COPYING Pingus-tmp.dmg
hdiutil convert $(PACKAGE)-tmp.dmg -format UDZO -imagekey zlib-level=9 -o $(PACKAGE)-`cat VERSION`.dmg
rm $(PACKAGE)-tmp.dmg