2011-01-19 04:36:21 +03:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Mac OS X target setup
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2014-03-20 00:37:26 +04:00
|
|
|
POSTEXES += NetSurf.app
|
2011-01-19 04:36:21 +03:00
|
|
|
|
2014-03-20 00:37:26 +04:00
|
|
|
# shut up zconf.h and zlib.h
|
|
|
|
#CFLAGS += -D_LARGEFILE64_SOURCE=1
|
2011-01-30 16:40:47 +03:00
|
|
|
|
2016-02-09 00:19:15 +03:00
|
|
|
# add Mac Ports include and library paths for openssl
|
|
|
|
ifneq ($(shell test -d /opt/local && echo 'yes'),)
|
2011-05-07 03:58:58 +04:00
|
|
|
LDFLAGS += -L/opt/local/lib
|
|
|
|
CFLAGS += -I/opt/local/include
|
|
|
|
endif
|
|
|
|
|
2016-02-09 00:19:15 +03:00
|
|
|
ifeq ($(SDK_VERSION),)
|
|
|
|
# if no SDK_VERSION has been specified select one from those available
|
|
|
|
SDK_PARAM := $(shell xcodebuild -showsdks | awk '/^$$/{p=0};p; /OS X SDKs:/{p=1}' | tail -1 | cut -f3)
|
|
|
|
SDK_VERSION := $(MACOSX_VERSION)
|
|
|
|
else
|
|
|
|
SDK_PARAM := -sdk macosx$(SDK_VERSION)
|
|
|
|
endif
|
2011-01-19 04:36:21 +03:00
|
|
|
|
2016-02-08 02:29:01 +03:00
|
|
|
SDK_PATH ?= $(shell xcodebuild -version $(SDK_PARAM) Path)
|
2016-02-09 00:19:15 +03:00
|
|
|
SDK_FLAGS := -isysroot $(SDK_PATH) -mmacosx-version-min=$(SDK_VERSION)
|
2014-03-20 00:37:26 +04: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
|
|
|
|
2016-02-09 00:19:15 +03:00
|
|
|
# for timerisset()
|
|
|
|
CFLAGS += -D_DARWIN_C_SOURCE
|
|
|
|
|
|
|
|
LDFLAGS += -L/usr/lib
|
|
|
|
LDFLAGS += -L/usr/X11/lib
|
|
|
|
LDFLAGS += -lm -lcurl
|
|
|
|
LDFLAGS += -lssl -lcrypto
|
|
|
|
|
|
|
|
CFLAGS += -Dnscocoa -D_BSD_SOURCE -D_POSIX_C_SOURCE -std=c99 -g -Os
|
|
|
|
|
2014-03-20 00:37:26 +04:00
|
|
|
CFLAGS += -I/usr/X11/include
|
|
|
|
CFLAGS += -include cocoa/Prefix.pch
|
2011-01-23 23:31:36 +03:00
|
|
|
|
2016-04-06 14:01:07 +03:00
|
|
|
VERSION_FULL := $(shell sed -n '/_version.*=.*"/{s/.*"\(.*\)".*/\1/;p;}' desktop/version.c)
|
2014-03-20 00:37:26 +04: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
|
|
|
|
2014-03-20 00:37:26 +04:00
|
|
|
LDFLAGS += -Wl,-framework,Cocoa -Wl,-framework,Carbon $(NETLDFLAGS)
|
2011-01-19 04:36:21 +03:00
|
|
|
|
2014-03-20 00:37:26 +04:00
|
|
|
$(eval $(call feature_enabled,IMAGEIO,-DWITH_APPLE_IMAGE,,Apple ImageIO ))
|
2011-01-23 17:14:35 +03:00
|
|
|
|
2014-03-20 00:37:26 +04:00
|
|
|
ifneq ($(UNIVERSAL),)
|
2011-01-23 18:26:26 +03:00
|
|
|
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)
|
2014-03-20 00:37:26 +04:00
|
|
|
endif
|
2011-01-23 18:26:26 +03:00
|
|
|
|
2011-01-19 04:36:21 +03:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Source file setup
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
# sources purely for the Mac OS X build
|
|
|
|
S_FRONTEND := \
|
|
|
|
BookmarksController.m \
|
|
|
|
BrowserView.m \
|
|
|
|
BrowserViewController.m \
|
|
|
|
BrowserWindowController.m \
|
|
|
|
BrowserWindow.m \
|
|
|
|
DownloadWindowController.m \
|
|
|
|
NetSurfAppDelegate.m \
|
|
|
|
NetsurfApp.m \
|
|
|
|
PreferencesWindowController.m \
|
|
|
|
ScrollableView.m \
|
|
|
|
SearchWindowController.m \
|
|
|
|
URLFieldCell.m \
|
|
|
|
Tree.m \
|
|
|
|
TreeView.m \
|
|
|
|
HistoryView.m \
|
|
|
|
HistoryWindowController.m \
|
|
|
|
FormSelectMenu.m \
|
|
|
|
bitmap.m \
|
|
|
|
fetch.m \
|
|
|
|
font.m \
|
|
|
|
gui.m \
|
|
|
|
plotter.m \
|
|
|
|
schedule.m \
|
|
|
|
selection.m \
|
|
|
|
ArrowBox.m \
|
|
|
|
ArrowWindow.m \
|
|
|
|
BlackScroller.m \
|
|
|
|
LocalHistoryController.m \
|
2011-03-05 12:49:15 +03:00
|
|
|
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 \
|
2016-05-06 00:28:51 +03:00
|
|
|
PSMRolloverButton.m \
|
|
|
|
PSMTabBarCell.m \
|
|
|
|
PSMTabBarControl.m \
|
2011-01-19 23:19:43 +03:00
|
|
|
PSMTabBarController.m \
|
|
|
|
PSMTabDragAssistant.m \
|
2016-05-06 00:28:51 +03:00
|
|
|
PSMTabDragView.m \
|
|
|
|
PSMTabDragWindow.m \
|
|
|
|
PSMTabDragWindowController.m \
|
2011-01-19 23:19:43 +03:00
|
|
|
PSMUnifiedTabStyle.m
|
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
S_FRONTEND += $(addprefix 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
|
2016-05-06 00:28:51 +03:00
|
|
|
SOURCES = $(addprefix $(shell pwd)/,$(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_FRONTEND))
|
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
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
S_XIBS := \
|
|
|
|
MainMenu.xib \
|
|
|
|
Browser.xib \
|
|
|
|
BrowserWindow.xib \
|
|
|
|
DownloadWindow.xib \
|
|
|
|
SearchWindow.xib \
|
|
|
|
PreferencesWindow.xib \
|
|
|
|
HistoryWindow.xib \
|
|
|
|
BookmarksWindow.xib \
|
|
|
|
LocalHistoryPanel.xib
|
|
|
|
|
|
|
|
R_RESOURCES := \
|
|
|
|
default.css \
|
|
|
|
adblock.css \
|
|
|
|
internal.css \
|
|
|
|
quirks.css \
|
|
|
|
NetSurf.icns \
|
|
|
|
HomeTemplate.pdf \
|
|
|
|
Icons \
|
|
|
|
ca-bundle \
|
2011-05-14 04:16:40 +04:00
|
|
|
netsurf.png
|
2011-01-23 17:14:35 +03:00
|
|
|
|
2011-01-30 16:40:47 +03:00
|
|
|
|
2016-05-06 00:28:51 +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 \
|
|
|
|
AquaTabNewRollover.png \
|
|
|
|
overflowImage.png \
|
|
|
|
overflowImagePressed.png \
|
2011-01-26 13:52:13 +03:00
|
|
|
pi.png
|
2011-01-23 17:14:35 +03:00
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
R_RESOURCES := $(addprefix $(FRONTEND_RESOURCES_DIR)/,$(R_RESOURCES))
|
|
|
|
|
2016-05-15 17:43:38 +03:00
|
|
|
R_RESOURCES += $(addprefix $(FRONTEND_SOURCE_DIR)/PSMTabBarControl/Images/,$(TABBAR_RESOURCES))
|
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
LANGUAGES := de en fr it nl
|
|
|
|
LOCALIZED_RESOURCES := Localizable.strings
|
2011-01-23 17:14:35 +03:00
|
|
|
|
2012-11-03 20:27:31 +04:00
|
|
|
#languiage project macro
|
|
|
|
# $1 is language name
|
|
|
|
# $2 is list of resources per language
|
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) $$@
|
2013-05-02 12:24:18 +04:00
|
|
|
$(Q)$(SPLIT_MESSAGES) -l $(1) -p cocoa -f messages resources/FatMessages > $$@/Messages
|
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)
|
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
$$(OBJROOT)/$(2).lproj/$(1:.xib=.nib): $(FRONTEND_RESOURCES_DIR)/$(1) $$(OBJROOT)/created
|
2011-02-26 00:50:21 +03:00
|
|
|
$(VQ)echo Compiling XIB $(1) for language $(2)
|
|
|
|
$(Q)mkdir -p $$(OBJROOT)/$(2).lproj
|
2016-05-15 15:59:29 +03:00
|
|
|
$(Q)$(FRONTEND_SOURCE_DIR)/compile-xib.sh $(FRONTEND_RESOURCES_DIR)/$(1) $(2) $$@
|
2011-08-28 18:29:15 +04:00
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
ifeq ($(wildcard $(FRONTEND_RESOURCES_DIR)/$(2).lproj/$(1).strings),$(FRONTEND_RESOURCES_DIR)/$(2).lproj/$(1).strings)
|
|
|
|
$$(OBJROOT)/$(2).lproj/$(1:.xib=.nib): $(FRONTEND_RESOURCES_DIR)/$(2).lproj/$(1).strings
|
2011-02-26 00:50:21 +03:00
|
|
|
endif
|
|
|
|
|
2011-01-31 20:35:46 +03:00
|
|
|
endef
|
2011-01-31 18:13:38 +03:00
|
|
|
|
2016-05-15 16:53:19 +03:00
|
|
|
$(foreach lang,$(LANGUAGES),$(eval $(call make_lproj,$(lang),$(addprefix $(FRONTEND_RESOURCES_DIR)/$(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
|
|
|
|
2012-08-23 14:46:31 +04:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Install target
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
install-cocoa: NetSurf.app
|
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
NetSurf.app: NetSurf $(FRONTEND_SOURCE_DIR)/Makefile $(R_RESOURCES) NetSurf.app/Contents/Info.plist
|
2011-01-31 20:35:46 +03:00
|
|
|
$(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
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
NetSurf.app/Contents/Info.plist: $(FRONTEND_RESOURCES_DIR)/NetSurf-Info.plist $(FRONTEND_SOURCE_DIR)/Makefile
|
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)/' \
|
2016-05-06 00:28:51 +03:00
|
|
|
< $(FRONTEND_RESOURCES_DIR)/NetSurf-Info.plist > NetSurf.app/Contents/Info.plist
|
2011-08-31 17:49:14 +04:00
|
|
|
|
2012-08-23 14:46:31 +04:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Package target
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
package-cocoa: NetSurf.dmg
|
|
|
|
|
2012-10-15 18:49:52 +04:00
|
|
|
.INTERMEDIATE: NetSurf.tmp.dmg
|
|
|
|
|
2011-08-31 17:49:14 +04:00
|
|
|
NetSurf.tmp.dmg: NetSurf.app
|
|
|
|
hdiutil create -size 8m -fs HFS+ -volname "NetSurf" $@
|
2012-10-15 18:49:52 +04:00
|
|
|
sleep 2
|
2011-08-31 17:49:14 +04:00
|
|
|
hdiutil attach $@
|
2012-10-15 18:49:52 +04:00
|
|
|
sleep 2
|
2012-10-15 19:15:14 +04:00
|
|
|
cp -pPR $^ /Volumes/NetSurf/
|
2011-08-31 17:49:14 +04:00
|
|
|
hdiutil detach $$(echo $$(hdiutil attach $@ | cut -f 1) | cut -f 1 -d ' ')
|
2012-10-15 18:49:52 +04:00
|
|
|
sleep 2
|
2011-08-31 17:49:14 +04:00
|
|
|
|
|
|
|
NetSurf.dmg: NetSurf.tmp.dmg
|
|
|
|
hdiutil convert $^ -format UDZO -o $@
|
|
|
|
|
2012-10-15 18:49:52 +04:00
|
|
|
CLEANS += clean-package-cocoa
|
|
|
|
|
|
|
|
clean-package-cocoa:
|
2012-10-15 19:15:14 +04:00
|
|
|
$(VQ)echo " CLEAN: NetSurf.tmp.dmg"
|
|
|
|
$(Q)$(RM) NetSurf.tmp.dmg
|
|
|
|
$(VQ)echo " CLEAN: NetSurf.dmg"
|
|
|
|
$(Q)$(RM) NetSurf.dmg
|
|
|
|
$(VQ)echo " CLEAN: NetSurf.app"
|
|
|
|
$(Q)$(RM) -r NetSurf.app
|