basic makefile and app setup
This commit is contained in:
parent
7f2702294f
commit
f96fde69a2
2
Makefile
2
Makefile
|
@ -109,7 +109,7 @@ ifeq ($(TARGET),)
|
|||
endif
|
||||
|
||||
# valid values for the TARGET
|
||||
VLDTARGET := riscos gtk2 gtk3 beos amiga amigaos3 framebuffer windows atari monkey
|
||||
VLDTARGET := riscos gtk2 gtk3 beos amiga amigaos3 framebuffer windows atari monkey gnustep
|
||||
|
||||
# Check for valid TARGET
|
||||
ifeq ($(filter $(VLDTARGET),$(TARGET)),)
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
@interface AppDelegate: NSResponder<NSApplicationDelegate> {
|
||||
@private
|
||||
}
|
||||
@end
|
|
@ -0,0 +1,24 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
#import "AppDelegate.h"
|
||||
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
-(void)applicationDidFinishLaunching: (NSNotification*)aNotification {
|
||||
NSLog(@"NSApp did finish launching..");
|
||||
[NSBundle loadNibNamed: @"NetSurf" owner: self];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
NSApplication *app = [NSApplication sharedApplication];
|
||||
AppDelegate *delegate = [AppDelegate new];
|
||||
[app setDelegate: delegate];
|
||||
[app run];
|
||||
[pool release];
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
# ----------------------------------------------------------------------------
|
||||
# Mac OS X target setup
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
POSTEXES += NetSurf.app
|
||||
EXETARGET := nscocoa
|
||||
|
||||
SDK_FLAGS := $(gnustep-config --objc-flags)
|
||||
CFLAGS := $(SDK_FLAGS) $(CFLAGS)
|
||||
CFLAGS += -I/usr/local/include/gnustep
|
||||
LDFLAGS := $(LDFLAGS)
|
||||
CXXFLAGS := $(SDK_FLAGS) $(CXXFLAGS)
|
||||
|
||||
# for timerisset()
|
||||
CFLAGS += -D_DARWIN_C_SOURCE
|
||||
CFLAGS += -g
|
||||
|
||||
LDFLAGS += -L/usr/lib
|
||||
LDFLAGS += -L/usr/X11/lib
|
||||
LDFLAGS += -lm -lcurl
|
||||
LDFLAGS += -lssl -lcrypto
|
||||
LDFLAGS += -lobjc2 -lgnustep-gui -lgnustep-base
|
||||
|
||||
CFLAGS += -Dnscocoa -D_BSD_SOURCE -D_POSIX_C_SOURCE -std=c99 -g -Os
|
||||
CFLAGS += -DFONT_SIZE_SCALE=1.0
|
||||
CFLAGS += -I/usr/X11/include
|
||||
|
||||
VERSION_FULL := $(shell sed -n '/_version.*=.*"/{s/.*"\(.*\)".*/\1/;p;}' desktop/version.c)
|
||||
VERSION_MAJ := $(shell sed -n '/_major/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
|
||||
VERSION_MIN := $(shell sed -n '/_minor/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Source file setup
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# sources purely for the Mac OS X build
|
||||
S_FRONTEND := \
|
||||
AppDelegate.m \
|
||||
|
||||
|
||||
# This is the final source build list
|
||||
# Note this is deliberately *not* expanded here as common and image
|
||||
# are not yet available
|
||||
SOURCES = $(addprefix $(shell pwd)/,$(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_FRONTEND))
|
||||
|
||||
# Since we prefix the sources with the pwd, also create a special
|
||||
# prefixed rule so that the testament is run
|
||||
$(shell pwd)/content/fetchers/about.c: testament
|
||||
|
||||
EXETARGET := NetSurf
|
||||
|
||||
R_RESOURCES := \
|
||||
NetSurf.gorm \
|
||||
|
||||
R_RESOURCES := $(addprefix $(FRONTEND_RESOURCES_DIR)/,$(R_RESOURCES))
|
||||
|
||||
LANGUAGES := en
|
||||
LOCALIZED_RESOURCES := Localizable.strings
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Install target
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
install-cocoa: NetSurf.app
|
||||
|
||||
NetSurf.app: NetSurf $(FRONTEND_SOURCE_DIR)/Makefile $(R_RESOURCES) NetSurf.app/Resources/Info-gnustep.plist
|
||||
$(VQ)echo Assembling NetSurf.app bundle
|
||||
$(Q)cp NetSurf NetSurf.app/
|
||||
$(Q)mkdir -p NetSurf.app/Resources
|
||||
$(Q)cp -pLR $(R_RESOURCES) NetSurf.app/Resources
|
||||
|
||||
NetSurf.app/Resources/Info-gnustep.plist: $(FRONTEND_RESOURCES_DIR)/NetSurf-Info.plist $(FRONTEND_SOURCE_DIR)/Makefile
|
||||
$(VQ)echo Generating Info.plist
|
||||
$(Q)rm -rf NetSurf.app/Resources
|
||||
$(Q)mkdir -p NetSurf.app/Resources
|
||||
$(Q)sed -e 's/$${EXECUTABLE_NAME}/$(EXETARGET)/' \
|
||||
-e 's/$${PRODUCT_NAME.*}/$(EXETARGET)/' \
|
||||
-e 's/$${MACOSX_DEPLOYMENT_TARGET}/$(MACOSX_VERSION)/' \
|
||||
-e 's/$${NETSURF_VERSION}/$(VERSION_FULL)/' \
|
||||
-e 's/$${NETSURF_SHORT_VERSION}/$(VERSION_MAJ).$(VERSION_MIN)/' \
|
||||
< $(FRONTEND_RESOURCES_DIR)/NetSurf-Info.plist > NetSurf.app/Resources/Info-gnustep.plist
|
||||
|
||||
|
||||
CLEANS += clean-package-cocoa
|
||||
|
||||
clean-package-cocoa:
|
||||
$(VQ)echo " CLEAN: NetSurf.app"
|
||||
$(Q)$(RM) -r NetSurf.app
|
|
@ -0,0 +1,111 @@
|
|||
<?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>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array/>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array/>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>HTML</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>public.html</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>NetSurf</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.netsurf-browser.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${NETSURF_VERSION}</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>org.netsurf-browser.NetSurf.URI</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>http</string>
|
||||
<string>https</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${NETSURF_SHORT_VERSION}</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NetSurfApp</string>
|
||||
<key>NSServices</key>
|
||||
<array/>
|
||||
<key>UTExportedTypeDeclarations</key>
|
||||
<array/>
|
||||
<key>UTImportedTypeDeclarations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.text</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>HTML</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>public.html</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>html</string>
|
||||
<string>htm</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<array>
|
||||
<string>text/html</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.source-code</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>CSS</string>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.w3.css</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>css</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<array>
|
||||
<string>text/css</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"## Comment" = "Do NOT change this file, Gorm maintains it";
|
||||
BrowserWindowController = {
|
||||
Actions = (
|
||||
);
|
||||
Outlets = (
|
||||
);
|
||||
Super = NSWindowController;
|
||||
};
|
||||
}
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue