Commits

Ivan Vučica committed 5d02230

More generic system for building Mac applications

  • Participants
  • Parent commits aa216bc

Comments (0)

Files changed (5)

File HelloGNUstep.preamble.h

 #import <Foundation/Foundation.h>
 #import <AppKit/AppKit.h>
 
-#define APPNAME @"HelloGNUstepOutlineView"
 #import "StandardMenus.h"
 
 #if !GNUSTEP

File HelloGNUstepOutlineView.m

+#define APPNAME @"HelloGNUstepOutlineView"
+
 #import "HelloGNUstep.preamble.h"
 
 /* This class represents the 'model' for each row in the outline. */

File Info.plist

-<?xml version="1.0"?>
-<plist version="1.0">
-<dict>
-<key>CFBundleDevelopmentRegion</key>
-<string>English</string>
-<key>CFBundleIdentifier</key>
-<string>net.vucica.hellognustep.outlineview</string>
-<key>CFBundleInfoDictionaryVersion</key>
-<string>6.0</string>
-<key>CFBundleName</key>
-<string>HelloGNUstepOutlineView</string>
-<key>CFBundleVersion</key>
-<string>1.0</string>
-<key>NSPrincipalClass</key>
-<string>NSApplication</string>
-</dict>
-</plist>

File Makefile.mac

-EMBED_INFOPLIST=-sectcreate __TEXT __info_plist Info.plist 
+EMBED_INFOPLIST=-sectcreate __TEXT __info_plist # ...plistname here... 
 EMBED_ICON=-sectcreate __ICON __header GNUstep.iconheader -segprot __ICON r r  -sectcreate __ICON app GNUstep.tiff 
 
 CFLAGS=-mmacosx-version-min=10.6
-LDFLAGS+=$(CFLAGS) $(EMBED_INFOPLIST) $(EMBED_ICON) -framework Foundation -framework AppKit
+LDFLAGS=$(CFLAGS) $(EMBED_ICON) -framework Foundation -framework AppKit
 
-#DEPS=Info.plist GNUstep.tiff GNUstep.iconheader
+DEPS=GNUstep.tiff GNUstep.iconheader
 
-all: HelloGNUstepOutlineView
-#HelloGNUstepTableView
+all: HelloGNUstepOutlineView HelloGNUstepTableView
+
+HelloGNUstep%: HelloGNUstep%.o $(DEPS) HelloGNUstep%.Info.plist
+	$(CC) $(LDFLAGS) $(EMBED_INFOPLIST) $@.Info.plist $< -o $@
+
+HelloGNUstep%.Info.plist: template.Info.plist
+	sed 's/%APPNAME%/'`echo $@ | sed 's/.Info.plist//'`'/g' $< > $@
 
 clean:
 	-rm *.o
 	-rm HelloGNUstepOutlineView
-
+	-rm HelloGNUstepTableView
+	-rm HelloGNUstep*.Info.plist
 # Verify using: 
 # otool -s __TEXT __info_plist main|xxd -r

File template.Info.plist

+<?xml version="1.0"?>
+<plist version="1.0">
+<dict>
+<key>CFBundleDevelopmentRegion</key>
+<string>English</string>
+<key>CFBundleIdentifier</key>
+<string>net.vucica.hellognustep.%APPNAME%</string>
+<key>CFBundleInfoDictionaryVersion</key>
+<string>6.0</string>
+<key>CFBundleName</key>
+<string>%APPNAME%</string>
+<key>CFBundleVersion</key>
+<string>1.0</string>
+<key>NSPrincipalClass</key>
+<string>NSApplication</string>
+</dict>
+</plist>