Add config.make containing package name parameters, and extend Makefile

to build a full application and .dmg file.

Subversion-branch: /launcher
Subversion-revision: 1777
This commit is contained in:
Simon Howard 2010-01-04 15:12:58 +00:00
parent 5a3faa3eee
commit f6010c7af5
2 changed files with 49 additions and 10 deletions

View file

@ -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 CFLAGS=-Wall
LDFLAGS=-framework Cocoa LDFLAGS=-framework Cocoa
OBJS= AppController.o \ LAUNCHER_OBJS= \
Execute.o \ AppController.o \
IWADController.o \ Execute.o \
IWADLocation.o \ IWADController.o \
LauncherManager.o \ IWADLocation.o \
main.o LauncherManager.o \
main.o
launcher : $(OBJS) launcher : $(LAUNCHER_OBJS)
$(CC) $(LDFLAGS) $(OBJS) -o $@ $(CC) $(LDFLAGS) $(LAUNCHER_OBJS) -o $@
%.o : %.m %.o : %.m
$(CC) -c $(CFLAGS) $^ -o $@ $(CC) -c $(CFLAGS) $^ -o $@
clean : launcher_clean :
rm -f $(OBJS) launcher rm -f $(LAUNCHER_OBJS) launcher

10
config.make Normal file
View file

@ -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