2011-01-19 04:36:21 +03:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Mac OS X target setup
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2011-01-23 18:26:26 +03:00
|
|
|
POSTEXES += NetSurf.app
|
2011-01-19 04:36:21 +03:00
|
|
|
|
2011-09-26 14:04:29 +04:00
|
|
|
LDFLAGS += -L/usr/lib
|
|
|
|
LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libhubbub libcss)
|
2011-01-23 17:14:35 +03:00
|
|
|
LDFLAGS += -L/usr/X11/lib
|
2011-01-19 04:36:21 +03:00
|
|
|
LDFLAGS += -lm -lxml2 -lcurl -liconv
|
2011-09-26 14:04:29 +04:00
|
|
|
LDFLAGS += -lssl -lcrypto
|
2011-01-19 04:36:21 +03:00
|
|
|
|
|
|
|
CFLAGS += -I. -O $(WARNFLAGS) -Dnscocoa \
|
|
|
|
-D_BSD_SOURCE -D_POSIX_C_SOURCE \
|
|
|
|
-std=c99
|
|
|
|
|
2011-01-23 22:03:19 +03:00
|
|
|
CFLAGS += -g -Os -Wno-uninitialized
|
2011-01-19 04:36:21 +03:00
|
|
|
|
2011-09-26 14:04:29 +04:00
|
|
|
CFLAGS += $(shell $(PKG_CONFIG) --cflags libxml-2.0 libhubbub libcss)
|
|
|
|
|
2011-01-19 04:36:21 +03:00
|
|
|
# shut up zconf.h and zlib.h
|
|
|
|
#CFLAGS += -D_LARGEFILE64_SOURCE=1
|
2011-01-30 16:40:47 +03:00
|
|
|
|
2011-05-07 03:58:58 +04:00
|
|
|
ifneq ($(WITH_MACPORTS),)
|
|
|
|
LDFLAGS += -L/opt/local/lib
|
|
|
|
CFLAGS += -I/opt/local/include
|
|
|
|
endif
|
|
|
|
|
2011-01-19 04:36:21 +03:00
|
|
|
# for timerisset()
|
|
|
|
CFLAGS += -D_DARWIN_C_SOURCE
|
|
|
|
|
2011-03-14 17:17:53 +03:00
|
|
|
MACOSX_VERSION ?= 10.5
|
2011-03-14 21:22:42 +03:00
|
|
|
SDK_VERSION ?= $(MACOSX_VERSION)
|
|
|
|
SDK_PATH ?= $(DEVELOPER_PATH)/SDKs/MacOSX$(SDK_VERSION).sdk
|
2011-01-23 22:03:19 +03:00
|
|
|
SDK_FLAGS := -isysroot $(SDK_PATH) -mmacosx-version-min=$(MACOSX_VERSION)
|
2011-01-23 18:26:26 +03:00
|
|
|
CFLAGS := $(SDK_FLAGS) $(CFLAGS)
|
|
|
|
LDFLAGS := $(SDK_FLAGS) -Wl,-syslibroot,$(SDK_PATH) $(LDFLAGS)
|
|
|
|
CXXFLAGS := $(SDK_FLAGS) $(CXXFLAGS)
|
2011-01-23 17:14:35 +03:00
|
|
|
|
|
|
|
CFLAGS += -I/usr/X11/include
|
2011-01-19 23:19:43 +03:00
|
|
|
CFLAGS += -I/usr/include/libxml2
|
2011-01-23 23:31:36 +03:00
|
|
|
CFLAGS += -include cocoa/Prefix.pch
|
|
|
|
|
2011-01-31 20:35:46 +03:00
|
|
|
VERSION_FULL := $(shell sed -n '/\"/{s/.*"\(.*\)\".*/\1/;p;}' desktop/version.c)
|
2011-01-19 04:36:21 +03:00
|
|
|
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)
|
2011-01-23 22:03:19 +03:00
|
|
|
|
2011-01-19 23:19:43 +03:00
|
|
|
LDFLAGS += -Wl,-framework,Cocoa -Wl,-framework,Carbon $(NETLDFLAGS)
|
2011-01-19 04:36:21 +03:00
|
|
|
|
2011-09-26 14:04:29 +04:00
|
|
|
NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
|
|
|
|
NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
|
|
|
|
NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
|
|
|
|
NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG
|
|
|
|
|
|
|
|
$(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))
|
|
|
|
$(eval $(call pkg_config_find_and_add,NSSVG,libsvgtiny,SVG))
|
2011-03-07 19:47:39 +03:00
|
|
|
$(eval $(call feature_enabled,IMAGEIO,-DWITH_APPLE_IMAGE,,Apple ImageIO ))
|
2011-01-23 17:14:35 +03:00
|
|
|
|
2011-01-23 18:26:26 +03:00
|
|
|
ifneq ($(UNIVERSAL),)
|
|
|
|
UNIVERSAL_FLAGS := $(foreach arch,$(UNIVERSAL),-arch $(arch) )
|
|
|
|
CFLAGS += $(UNIVERSAL_FLAGS)
|
2011-01-30 16:40:47 +03:00
|
|
|
LDFLAGS += $(UNIVERSAL_FLAGS)
|
2011-01-23 18:26:26 +03:00
|
|
|
CXXFLAGS += $(UNIVERSAL_FLAGS)
|
|
|
|
endif
|
|
|
|
|
2011-01-19 04:36:21 +03:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Source file setup
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# S_COCOA are sources purely for the Mac OS X build
|
|
|
|
S_COCOA := \
|
2011-02-01 13:27:54 +03:00
|
|
|
BookmarksController.m \
|
2011-01-19 04:36:21 +03:00
|
|
|
BrowserView.m \
|
2011-01-19 23:19:43 +03:00
|
|
|
BrowserViewController.m \
|
|
|
|
BrowserWindowController.m \
|
2011-01-31 18:13:38 +03:00
|
|
|
BrowserWindow.m \
|
2011-01-19 04:36:21 +03:00
|
|
|
DownloadWindowController.m \
|
|
|
|
NetSurfAppDelegate.m \
|
|
|
|
NetsurfApp.m \
|
2011-01-31 21:38:03 +03:00
|
|
|
PreferencesWindowController.m \
|
2011-01-19 04:36:21 +03:00
|
|
|
ScrollableView.m \
|
2011-01-31 18:13:38 +03:00
|
|
|
SearchWindowController.m \
|
2011-01-24 12:12:22 +03:00
|
|
|
URLFieldCell.m \
|
2011-02-01 11:39:32 +03:00
|
|
|
Tree.m \
|
2011-01-19 04:36:21 +03:00
|
|
|
TreeView.m \
|
2011-01-24 18:01:34 +03:00
|
|
|
HistoryView.m \
|
2011-02-01 11:39:35 +03:00
|
|
|
HistoryWindowController.m \
|
2011-01-25 18:09:06 +03:00
|
|
|
FormSelectMenu.m \
|
2011-01-19 04:36:21 +03:00
|
|
|
bitmap.m \
|
|
|
|
fetch.m \
|
|
|
|
font.m \
|
|
|
|
gui.m \
|
|
|
|
plotter.m \
|
|
|
|
save.m \
|
|
|
|
schedule.m \
|
|
|
|
selection.m \
|
|
|
|
thumbnail.m \
|
|
|
|
url.m \
|
|
|
|
utf8.m \
|
2011-01-30 16:40:47 +03:00
|
|
|
utils.m \
|
2011-02-17 15:12:51 +03:00
|
|
|
system_colour.m \
|
|
|
|
ArrowBox.m \
|
|
|
|
ArrowWindow.m \
|
|
|
|
BlackScroller.m \
|
2011-03-05 12:49:15 +03:00
|
|
|
LocalHistoryController.m \
|
|
|
|
apple_image.m
|
2011-01-19 04:36:21 +03:00
|
|
|
|
2011-01-19 23:19:43 +03:00
|
|
|
S_TABBAR := \
|
|
|
|
NSBezierPath_AMShading.m \
|
|
|
|
NSString_AITruncation.m \
|
|
|
|
PSMOverflowPopUpButton.m \
|
|
|
|
PSMProgressIndicator.m \
|
|
|
|
PSMRolloverButton.m \
|
|
|
|
PSMTabBarCell.m \
|
|
|
|
PSMTabBarControl.m \
|
|
|
|
PSMTabBarController.m \
|
|
|
|
PSMTabDragAssistant.m \
|
|
|
|
PSMTabDragView.m \
|
|
|
|
PSMTabDragWindow.m \
|
|
|
|
PSMTabDragWindowController.m \
|
|
|
|
PSMUnifiedTabStyle.m
|
|
|
|
|
2011-01-19 04:36:21 +03:00
|
|
|
S_COCOA := $(addprefix cocoa/,$(S_COCOA))
|
2011-01-19 23:19:43 +03:00
|
|
|
S_TABBAR := $(addprefix cocoa/PSMTabBarControl/,$(S_TABBAR))
|
2011-01-19 04:36:21 +03:00
|
|
|
|
2011-08-28 18:29:15 +04:00
|
|
|
# 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_COCOA) $(S_TABBAR))
|
2011-01-31 10:57:52 +03:00
|
|
|
|
2011-03-22 15:42:30 +03:00
|
|
|
# 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
|
|
|
|
|
2011-01-19 04:36:21 +03:00
|
|
|
EXETARGET := NetSurf
|
2011-01-23 17:14:35 +03:00
|
|
|
|
2011-02-01 11:39:35 +03:00
|
|
|
S_XIBS := MainMenu.xib Browser.xib BrowserWindow.xib DownloadWindow.xib SearchWindow.xib PreferencesWindow.xib \
|
2011-02-17 15:12:51 +03:00
|
|
|
HistoryWindow.xib BookmarksWindow.xib LocalHistoryPanel.xib
|
2011-01-23 17:14:35 +03:00
|
|
|
|
2011-05-14 04:16:40 +04:00
|
|
|
R_RESOURCES := default.css adblock.css internal.css quirks.css NetSurf.icns HomeTemplate.pdf Icons ca-bundle \
|
|
|
|
netsurf.png
|
2011-01-23 17:14:35 +03:00
|
|
|
R_RESOURCES := $(addprefix cocoa/res/,$(R_RESOURCES))
|
|
|
|
|
2011-01-23 22:03:19 +03:00
|
|
|
LANGUAGES := de en fr it nl
|
2011-02-25 19:20:16 +03:00
|
|
|
LOCALIZED_RESOURCES := Messages Localizable.strings
|
2011-01-30 16:40:47 +03:00
|
|
|
|
2011-01-23 17:14:35 +03:00
|
|
|
TABBAR_RESOURCES := AquaTabClose_Front_Pressed.png \
|
|
|
|
AquaTabClose_Front_Rollover.png \
|
|
|
|
AquaTabClose_Front.png \
|
|
|
|
AquaTabCloseDirty_Front_Pressed.png \
|
|
|
|
AquaTabCloseDirty_Front_Rollover.png \
|
|
|
|
AquaTabCloseDirty_Front.png \
|
|
|
|
AquaTabNew.png \
|
|
|
|
AquaTabNewPressed.png \
|
2011-01-26 13:52:13 +03:00
|
|
|
AquaTabNewRollover.png \
|
|
|
|
overflowImage.png \
|
|
|
|
overflowImagePressed.png \
|
|
|
|
pi.png
|
2011-01-23 17:14:35 +03:00
|
|
|
|
|
|
|
R_RESOURCES += $(addprefix cocoa/PSMTabBarControl/Images/,$(TABBAR_RESOURCES))
|
|
|
|
|
2011-01-23 22:03:19 +03:00
|
|
|
define make_lproj
|
|
|
|
R_RESOURCES += $$(OBJROOT)/$(1).lproj
|
2011-01-31 20:35:46 +03:00
|
|
|
$$(OBJROOT)/$(1).lproj: $(2)
|
|
|
|
$(VQ)echo Bundling language $(1)
|
|
|
|
$(Q)mkdir -p $$@
|
|
|
|
$(Q)cp -pLR $(2) $$@
|
2011-01-23 22:03:19 +03:00
|
|
|
endef
|
|
|
|
|
2011-02-26 00:50:21 +03:00
|
|
|
# compile_xib (xib) (lang)
|
2011-01-31 20:35:46 +03:00
|
|
|
define compile_xib
|
2011-02-26 00:50:21 +03:00
|
|
|
$$(OBJROOT)/$(2).lproj: $$(OBJROOT)/$(2).lproj/$(1:.xib=.nib)
|
|
|
|
|
|
|
|
$$(OBJROOT)/$(2).lproj/$(1:.xib=.nib): cocoa/res/$(1) $$(OBJROOT)/created
|
|
|
|
$(VQ)echo Compiling XIB $(1) for language $(2)
|
|
|
|
$(Q)mkdir -p $$(OBJROOT)/$(2).lproj
|
2011-03-14 21:36:41 +03:00
|
|
|
$(Q)cocoa/compile-xib.sh $(DEVELOPER_PATH) cocoa/res/$(1) $(2) $$@
|
2011-08-28 18:29:15 +04:00
|
|
|
|
2011-02-26 01:09:16 +03:00
|
|
|
ifeq ($(wildcard cocoa/res/$(2).lproj/$(1).strings),cocoa/res/$(2).lproj/$(1).strings)
|
2011-02-26 00:50:21 +03:00
|
|
|
$$(OBJROOT)/$(2).lproj/$(1:.xib=.nib): cocoa/res/$(2).lproj/$(1).strings
|
|
|
|
endif
|
|
|
|
|
2011-01-31 20:35:46 +03:00
|
|
|
endef
|
2011-01-31 18:13:38 +03:00
|
|
|
|
2011-01-31 20:35:46 +03:00
|
|
|
$(foreach lang,$(LANGUAGES),$(eval $(call make_lproj,$(lang),$(addprefix cocoa/res/$(lang).lproj/,$(LOCALIZED_RESOURCES)))))
|
2011-02-26 00:50:21 +03:00
|
|
|
$(foreach lang,$(LANGUAGES),$(foreach xib,$(S_XIBS),$(eval $(call compile_xib,$(xib),$(lang)))))
|
2011-01-23 17:14:35 +03:00
|
|
|
|
2011-01-31 20:35:46 +03:00
|
|
|
NetSurf.app: NetSurf cocoa/Makefile.target $(R_RESOURCES) NetSurf.app/Contents/Info.plist
|
|
|
|
$(VQ)echo Assembling NetSurf.app bundle
|
|
|
|
$(Q)mkdir -p NetSurf.app/Contents/MacOS
|
|
|
|
$(Q)cp NetSurf NetSurf.app/Contents/MacOS
|
2011-05-09 22:39:42 +04:00
|
|
|
$(Q)rm -rf NetSurf.app/Contents/Resources
|
2011-01-31 20:35:46 +03:00
|
|
|
$(Q)mkdir -p NetSurf.app/Contents/Resources
|
|
|
|
$(Q)cp -pLR $(R_RESOURCES) NetSurf.app/Contents/Resources
|
|
|
|
$(Q)echo 'APPL????' > NetSurf.app/Contents/PkgInfo
|
2011-01-30 16:40:47 +03:00
|
|
|
|
2011-01-23 17:14:35 +03:00
|
|
|
NetSurf.app/Contents/Info.plist: cocoa/res/NetSurf-Info.plist cocoa/Makefile.target
|
2011-01-31 20:35:46 +03:00
|
|
|
$(VQ)echo Generating Info.plist
|
|
|
|
$(Q)mkdir -p NetSurf.app/Contents
|
|
|
|
$(Q)sed -e 's/$${EXECUTABLE_NAME}/$(EXETARGET)/' \
|
2011-01-23 17:14:35 +03:00
|
|
|
-e 's/$${PRODUCT_NAME.*}/$(EXETARGET)/' \
|
|
|
|
-e 's/$${MACOSX_DEPLOYMENT_TARGET}/$(MACOSX_VERSION)/' \
|
2011-01-23 22:03:39 +03:00
|
|
|
-e 's/$${NETSURF_VERSION}/$(VERSION_FULL)/' \
|
|
|
|
-e 's/$${NETSURF_SHORT_VERSION}/$(VERSION_MAJ).$(VERSION_MIN)/' \
|
2011-01-23 23:31:36 +03:00
|
|
|
< cocoa/res/NetSurf-Info.plist > NetSurf.app/Contents/Info.plist
|
2011-08-31 17:49:14 +04:00
|
|
|
|
|
|
|
NetSurf.tmp.dmg: NetSurf.app
|
|
|
|
hdiutil create -size 8m -fs HFS+ -volname "NetSurf" $@
|
|
|
|
hdiutil attach $@
|
|
|
|
cp -a $^ /Volumes/NetSurf/
|
|
|
|
hdiutil detach $$(echo $$(hdiutil attach $@ | cut -f 1) | cut -f 1 -d ' ')
|
|
|
|
|
|
|
|
NetSurf.dmg: NetSurf.tmp.dmg
|
|
|
|
hdiutil convert $^ -format UDZO -o $@
|
|
|
|
|