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
|
2012-11-10 04:09:11 +04:00
|
|
|
LDFLAGS += $(shell $(PKG_CONFIG) --libs libhubbub libcss libdom)
|
2011-01-23 17:14:35 +03:00
|
|
|
LDFLAGS += -L/usr/X11/lib
|
2012-11-10 04:09:11 +04:00
|
|
|
LDFLAGS += -lm -lcurl -liconv
|
2011-09-26 14:04:29 +04:00
|
|
|
LDFLAGS += -lssl -lcrypto
|
2011-01-19 04:36:21 +03:00
|
|
|
|
2012-12-20 19:27:07 +04:00
|
|
|
CFLAGS += -O $(WARNFLAGS) -Dnscocoa \
|
2011-01-19 04:36:21 +03:00
|
|
|
-D_BSD_SOURCE -D_POSIX_C_SOURCE \
|
2012-12-20 19:27:07 +04:00
|
|
|
-std=c99 -g -Os
|
2011-01-19 04:36:21 +03:00
|
|
|
|
2012-11-10 04:09:11 +04:00
|
|
|
CFLAGS += $(shell $(PKG_CONFIG) --cflags libhubbub libcss libdom)
|
2011-09-26 14:04:29 +04:00
|
|
|
|
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-23 23:31:36 +03:00
|
|
|
CFLAGS += -include cocoa/Prefix.pch
|
|
|
|
|
2012-10-15 19:04:51 +04:00
|
|
|
# VERSION_FULL := $(shell sed -n '/\"/{s/.*"\(.*\)\".*/\1/;p;}' desktop/version.c)
|
2012-10-15 19:15:14 +04:00
|
|
|
# TODO: this needs fixing properly everywhere
|
2012-10-15 19:04:51 +04:00
|
|
|
VERSION_FULL := "3.0 (Dev)"
|
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
|
|
|
|
|
2012-12-13 20:31:05 +04:00
|
|
|
$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
|
|
|
|
$(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
|
|
|
|
$(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG))
|
|
|
|
$(eval $(call pkg_config_find_and_add_enabled,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 \
|
|
|
|
schedule.m \
|
|
|
|
selection.m \
|
|
|
|
thumbnail.m \
|
2011-01-30 16:40:47 +03:00
|
|
|
utils.m \
|
2011-02-17 15:12:51 +03:00
|
|
|
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
|
2012-11-03 20:27:31 +04:00
|
|
|
LOCALIZED_RESOURCES := 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))
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
$$(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
|
|
|
|
2012-08-23 14:46:31 +04:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Install target
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
install-cocoa: NetSurf.app
|
|
|
|
|
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
|
|
|
|
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
|
2012-10-15 18:49:52 +04:00
|
|
|
|