summaryrefslogtreecommitdiff
path: root/cocoa/Makefile.target
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2011-01-19 01:36:21 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2011-01-19 01:36:21 +0000
commit6d1169e92d421855284dd27e8695e6bdf1e216f3 (patch)
tree02068006e63ce6809d8411e4cebcd801de8ca53b /cocoa/Makefile.target
parentebc216434fd5e090df3493e4eb444efb330ee8e4 (diff)
downloadnetsurf-6d1169e92d421855284dd27e8695e6bdf1e216f3.tar.gz
netsurf-6d1169e92d421855284dd27e8695e6bdf1e216f3.tar.bz2
Add the required makefile stuff to build NetSurf for OSX using 'make cocoa' in trunk/. Crashes for now though. Requires some libs installed with macports to /opt/local.
svn path=/trunk/netsurf/; revision=11380
Diffstat (limited to 'cocoa/Makefile.target')
-rw-r--r--cocoa/Makefile.target84
1 files changed, 84 insertions, 0 deletions
diff --git a/cocoa/Makefile.target b/cocoa/Makefile.target
new file mode 100644
index 000000000..d7dacfa36
--- /dev/null
+++ b/cocoa/Makefile.target
@@ -0,0 +1,84 @@
+# ----------------------------------------------------------------------------
+# Mac OS X target setup
+# ----------------------------------------------------------------------------
+
+
+ $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
+
+ LDFLAGS += -L/opt/local/lib
+ LDFLAGS += -lm -lxml2 -lcurl -liconv
+ LDFLAGS += -lssl -lcrypto -lhubbub -lcss -lparserutils -lwapcaplet
+
+ CFLAGS += -I. -O $(WARNFLAGS) -Dnscocoa \
+ -D_BSD_SOURCE -D_POSIX_C_SOURCE \
+ -std=c99
+
+ # DEBUG
+ CFLAGS += -g -O0 -Wno-uninitialized
+ # -DDEBUG=1
+
+ # shut up zconf.h and zlib.h
+ #CFLAGS += -D_LARGEFILE64_SOURCE=1
+
+ # for timerisset()
+ CFLAGS += -D_DARWIN_C_SOURCE
+
+ CFLAGS += -I/opt/local/include
+ CFLAGS += -I/opt/local/include/libxml2
+
+ VERSION_FULL := $(shell sed -n '/"/{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)
+ ifeq ($(HOST),macosx)
+ CFLAGS +=
+ else
+ endif
+ LDFLAGS += -Wl,-framework,Cocoa $(NETLDFLAGS)
+
+ $(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny)))
+ ifeq ($(HOST),macosx)
+ CFLAGS += -I$(PREFIX)/include
+ LDFLAGS += -L$(PREFIX)/lib
+ $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp)))
+ $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif)))
+ $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
+ else
+ NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
+ NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
+ NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
+ $(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
+ $(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
+ $(eval $(call pkg_config_find_and_add,PNG,libpng,PNG ))
+ endif
+
+# ----------------------------------------------------------------------------
+# Source file setup
+# ----------------------------------------------------------------------------
+
+# S_COCOA are sources purely for the Mac OS X build
+S_COCOA := \
+ BrowserView.m \
+ BrowserWindow.m \
+ DownloadWindowController.m \
+ NetSurfAppDelegate.m \
+ NetsurfApp.m \
+ ScrollableView.m \
+ TreeView.m \
+ bitmap.m \
+ fetch.m \
+ font.m \
+ gui.m \
+ plotter.m \
+ save.m \
+ schedule.m \
+ selection.m \
+ thumbnail.m \
+ url.m \
+ utf8.m \
+ utils.m
+
+S_COCOA := $(addprefix cocoa/,$(S_COCOA))
+
+# complete source file list
+SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_COCOA)
+EXETARGET := NetSurf