From f6010c7af567c1290444eb98ef1a674f613f9566 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 4 Jan 2010 15:12:58 +0000 Subject: [PATCH] Add config.make containing package name parameters, and extend Makefile to build a full application and .dmg file. Subversion-branch: /launcher Subversion-revision: 1777 --- GNUmakefile | 49 +++++++++++++++++++++++++++++++++++++++---------- config.make | 10 ++++++++++ 2 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 config.make diff --git a/GNUmakefile b/GNUmakefile index cdd457f..a5c05af 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,20 +1,49 @@ +include config.make + +STAGING_DIR=staging +DMG=$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).dmg + +# DMG file containing package: + +$(DMG) : $(STAGING_DIR) + hdiutil create -volname "$(PACKAGE_STRING)" -srcdir $(STAGING_DIR) $@ + +clean : launcher_clean + rm -f $(DMG) + rm -rf $(STAGING_DIR) + +# Staging dir build for package: + +APP_DIR=$(STAGING_DIR)/$(PACKAGE_NAME).app + +$(STAGING_DIR): launcher + rm -rf $(STAGING_DIR) + mkdir $(STAGING_DIR) + cp -R app-skeleton "$(APP_DIR)" + cp launcher "$(APP_DIR)/Contents/MacOS/" + # TODO: copy Doom and setup binaries into app dir + # TODO: copy other documentation into staging dir + +# Launcher build: + CFLAGS=-Wall LDFLAGS=-framework Cocoa -OBJS= AppController.o \ - Execute.o \ - IWADController.o \ - IWADLocation.o \ - LauncherManager.o \ - main.o +LAUNCHER_OBJS= \ + AppController.o \ + Execute.o \ + IWADController.o \ + IWADLocation.o \ + LauncherManager.o \ + main.o -launcher : $(OBJS) - $(CC) $(LDFLAGS) $(OBJS) -o $@ +launcher : $(LAUNCHER_OBJS) + $(CC) $(LDFLAGS) $(LAUNCHER_OBJS) -o $@ %.o : %.m $(CC) -c $(CFLAGS) $^ -o $@ -clean : - rm -f $(OBJS) launcher +launcher_clean : + rm -f $(LAUNCHER_OBJS) launcher diff --git a/config.make b/config.make new file mode 100644 index 0000000..49905c8 --- /dev/null +++ b/config.make @@ -0,0 +1,10 @@ +# File included by the main makefile that contains details +# about the package name. This will eventuall be generated +# by configure. + +PACKAGE = cocoa-doom +PACKAGE_NAME = Cocoa Doom +PACKAGE_STRING = Cocoa Doom 1.2.1 +PACKAGE_TARNAME = cocoa-doom +PACKAGE_VERSION = 1.2.1 +