summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2012-03-02 01:12:26 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2012-03-02 01:12:26 (GMT)
commit7fb6ab0a73c36a9d79f7607652b4194e389a70a0 (patch)
tree57d481c463d89373597c0da3281279318a3fa9ec
parentce1c547246ad8455b3f516a6505919b21e663cf1 (diff)
downloadgrv-7fb6ab0a73c36a9d79f7607652b4194e389a70a0.zip
grv-7fb6ab0a73c36a9d79f7607652b4194e389a70a0.tar.gz
grv-7fb6ab0a73c36a9d79f7607652b4194e389a70a0.tar.bz2
grv-7fb6ab0a73c36a9d79f7607652b4194e389a70a0.tar.xz
Actually be able to make a MacOS X bundle
We still turn it into a zip file instead of a native MacOS X disk image (dmg) file though... not sure how to do that on Linux.
-rw-r--r--Info.plist26
-rw-r--r--Makefile.darwinx24
2 files changed, 46 insertions, 4 deletions
diff --git a/Info.plist b/Info.plist
new file mode 100644
index 0000000..d36d108
--- /dev/null
+++ b/Info.plist
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleName</key>
+ <string>Grv</string>
+ <key>CFBundleDisplayName</key>
+ <string>Grv</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.zytor.Grv</string>
+ <key>CFBundleVersion</key>
+ <string>2003.7.1</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>GRVX</string>
+ <key>CFBundleExecutable</key>
+ <string>grv</string>
+ <key>CFBundleShortVersionString</key>
+ <string>2003.7.1</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>10.4.0</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright 1984-2012 H. Peter Anvin</string>
+</dict>
+</plist>
diff --git a/Makefile.darwinx b/Makefile.darwinx
index 5c70e7e..6b6ae8f 100644
--- a/Makefile.darwinx
+++ b/Makefile.darwinx
@@ -4,7 +4,7 @@
#
SDLROOT = /home/hpa/games/SDL_mac
-SDL = $(SDLROOT)/SDL.framework/Version/Current
+SDL = $(SDLROOT)/SDL.framework/Versions/Current
SDLMAIN = $(SDLROOT)/devel-lite
CC = darwinx-gcc -arch i386
@@ -14,12 +14,14 @@ OPTFLAGS = -O2 -g
INCLUDE = -I$(SDL)/Headers
CFLAGS = $(CWARN) $(REQFLAGS) $(OPTFLAGS) $(INCLUDE)
LDFLAGS =
-# We need an extra helping of -lmingw32 before -lSDLMain to make sure
-# WinMain is pulled in correctly
LIBS = -F$(SDLROOT) -framework SDL -framework Cocoa
+INT = darwinx-install_name_tool
+
X =
-ALL = grv$(X)
+ALL = grv$(X) Grv.zip
+
+APP = Grv.app
OBJS = grv.o drawlevel.o play.o action.o bullets.o mystery.o \
prefs.o intro.o \
@@ -34,6 +36,9 @@ all: $(ALL)
grv$(X): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
+ $(INT) -change '@rpath/SDL.framework/Versions/A/SDL' \
+ '@executable_path/../Frameworks/SDL.framework/Versions/A/SDL' \
+ $@
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
@@ -50,5 +55,16 @@ grvfont.c: grvfont.psf psftoc.pl
SDLMain.o: $(SDLMAIN)/SDLMain.m $(SDLMAIN)/SDLMain.h
$(CC) $(CFLAGS) -I$(SDLMAIN) -c -o $@ $<
+Grv.zip: grv$(X) Info.plist
+ rm -f $@
+ rm -rf $(APP)
+ mkdir -p $(APP)/Contents/MacOS $(APP)/Contents/Frameworks
+ cp Info.plist $(APP)/Contents/
+ cp $< $(APP)/Contents/MacOS/
+ cp -a $(SDLROOT)/SDL.framework $(APP)/Contents/Frameworks/
+ find $(APP) -name Headers | xargs rm -rf
+ zip -9r --symlinks $@ $(APP)
+
clean:
rm -f *.o *.i *.s $(ALL)
+ rm -rf $(APP)