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-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
|
|
|
|
LDFLAGS += -lssl -lcrypto -lhubbub -lcss -lparserutils -lwapcaplet
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
# shut up zconf.h and zlib.h
|
|
|
|
#CFLAGS += -D_LARGEFILE64_SOURCE=1
|
2011-01-30 16:40:47 +03:00
|
|
|
|
2011-01-19 04:36:21 +03:00
|
|
|
# for timerisset()
|
|
|
|
CFLAGS += -D_DARWIN_C_SOURCE
|
|
|
|
|
2011-01-23 17:14:35 +03:00
|
|
|
MACOSX_VERSION := 10.5
|
2011-01-23 18:26:26 +03:00
|
|
|
SDK_PATH := /Developer/SDKs/MacOSX$(MACOSX_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-01-23 22:03:19 +03:00
|
|
|
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) ))
|
2011-01-19 04:36:21 +03:00
|
|
|
$(eval $(call feature_enabled,NSSVG,-DWITH_NS_SVG,-lsvgtiny,SVG (libsvgtiny)))
|
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
|
|
|
|
|
|
|
# complete source file list
|
2011-01-19 23:19:43 +03:00
|
|
|
SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_COCOA) $(S_TABBAR)
|
2011-01-31 10:57:52 +03:00
|
|
|
SOURCES := $(addprefix $(shell pwd)/,$(SOURCES))
|
|
|
|
|
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-03-03 17:36:44 +03:00
|
|
|
R_RESOURCES := default.css adblock.css quirks.css NetSurf.icns HomeTemplate.pdf Icons ca-bundle
|
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
|
|
|
|
$(Q)cocoa/compile-xib.sh cocoa/res/$(1) $(2) $$@
|
|
|
|
|
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
|
|
|
|
$(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
|