2012-08-23 14:46:31 +04:00
|
|
|
#
|
|
|
|
# Makefile for NetSurf GTK target
|
|
|
|
#
|
|
|
|
# This file is part of NetSurf
|
|
|
|
#
|
2010-10-27 22:39:24 +04:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# GTK flag setup (using pkg-config)
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2011-09-16 15:09:58 +04:00
|
|
|
# define additional CFLAGS and LDFLAGS requirements for pkg-configed libs here
|
|
|
|
NETSURF_FEATURE_RSVG_CFLAGS := -DWITH_RSVG
|
|
|
|
NETSURF_FEATURE_NSSVG_CFLAGS := -DWITH_NS_SVG
|
|
|
|
NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
|
|
|
|
NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
|
|
|
|
NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
|
|
|
|
NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
|
|
|
|
NETSURF_FEATURE_WEBP_CFLAGS := -DWITH_WEBP
|
2012-01-02 01:42:38 +04:00
|
|
|
NETSURF_FEATURE_JS_CFLAGS := -DWITH_JS -DJS_HAS_FILE_OBJECT=0
|
2012-06-28 03:17:18 +04:00
|
|
|
NETSURF_FEATURE_MOZJS_CFLAGS := -DWITH_MOZJS -DJS_HAS_FILE_OBJECT=0
|
2012-08-21 17:17:11 +04:00
|
|
|
NETSURF_FEATURE_VIDEO_CFLAGS := -DWITH_VIDEO
|
2010-10-27 22:39:24 +04:00
|
|
|
|
2012-08-21 17:17:11 +04:00
|
|
|
# add a line similar to below for each optional lib here
|
|
|
|
# note: webp lacks pkg-config file
|
2012-12-13 21:23:47 +04:00
|
|
|
$(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG))
|
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,RSVG,librsvg-2.0,SVG))
|
|
|
|
$(eval $(call pkg_config_find_and_add_enabled,NSSVG,libsvgtiny,SVG))
|
|
|
|
$(eval $(call pkg_config_find_and_add_enabled,ROSPRITE,librosprite,Sprite))
|
2012-08-21 17:17:11 +04:00
|
|
|
$(eval $(call feature_enabled,WEBP,-DWITH_WEBP,-lwebp,WebP (libwebp)))
|
2012-12-13 20:31:05 +04:00
|
|
|
$(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript))
|
|
|
|
$(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
|
|
|
|
$(eval $(call pkg_config_find_and_add_enabled,VIDEO,gstreamer-0.10,Video))
|
2010-10-27 22:39:24 +04:00
|
|
|
|
2011-09-16 15:09:58 +04:00
|
|
|
# GTK and GLIB flags to disable depricated usage
|
|
|
|
GTKDEPFLAGS := -DG_DISABLE_SINGLE_INCLUDES \
|
|
|
|
-DG_DISABLE_DEPRECATED \
|
|
|
|
-DGTK_DISABLE_SINGLE_INCLUDES \
|
|
|
|
-DGTK_DISABLE_DEPRECATED \
|
2011-09-17 18:58:42 +04:00
|
|
|
-DGTK_MULTIHEAD_SAFE \
|
|
|
|
-DPANGO_DISABLE_DEPRECATED \
|
|
|
|
-DGDK_PIXBUF_DISABLE_DEPRECATED
|
|
|
|
|
|
|
|
# libsexy currently means we cannot enable this
|
|
|
|
# -DGDK_DISABLE_DEPRECATED
|
2010-10-27 22:39:24 +04:00
|
|
|
|
2011-09-16 15:09:58 +04:00
|
|
|
GTKCFLAGS := -std=c99 -Dgtk -Dnsgtk \
|
|
|
|
$(GTKDEPFLAGS) \
|
2010-10-27 22:39:24 +04:00
|
|
|
-D_BSD_SOURCE \
|
|
|
|
-D_XOPEN_SOURCE=600 \
|
|
|
|
-D_POSIX_C_SOURCE=200112L \
|
|
|
|
-D_NETBSD_SOURCE \
|
|
|
|
-DGTK_RESPATH=\"$(NETSURF_GTK_RESOURCES)\" \
|
2012-12-20 19:27:07 +04:00
|
|
|
$(WARNFLAGS) -g
|
2012-12-13 21:23:47 +04:00
|
|
|
|
|
|
|
# non optional pkg-configed libs
|
|
|
|
$(eval $(call pkg_config_find_and_add,libcss,CSS))
|
|
|
|
$(eval $(call pkg_config_find_and_add,libdom,DOM))
|
|
|
|
$(eval $(call pkg_config_find_and_add,libhubbub,Hubbub))
|
|
|
|
$(eval $(call pkg_config_find_and_add,openssl,OpenSSL))
|
|
|
|
$(eval $(call pkg_config_find_and_add,libcurl,Curl ))
|
|
|
|
$(eval $(call pkg_config_find_and_add,gtk+-$(NETSURF_GTK_MAJOR).0,GTK-$(NETSURF_GTK_MAJOR)))
|
|
|
|
$(eval $(call pkg_config_find_and_add,gthread-2.0,GThread2))
|
|
|
|
$(eval $(call pkg_config_find_and_add,gmodule-2.0,GModule2))
|
|
|
|
$(eval $(call pkg_config_find_and_add,lcms,lcms))
|
2010-10-27 22:39:24 +04:00
|
|
|
|
2011-05-08 23:54:35 +04:00
|
|
|
|
2011-09-16 15:09:58 +04:00
|
|
|
CFLAGS += $(GTKCFLAGS)
|
2012-12-13 21:23:47 +04:00
|
|
|
LDFLAGS += -lm
|
2010-10-27 22:39:24 +04:00
|
|
|
|
2011-09-16 15:09:58 +04:00
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
# Windows flag setup
|
|
|
|
# ---------------------------------------------------------------------------
|
2010-10-27 22:39:24 +04:00
|
|
|
|
2011-09-16 15:09:58 +04:00
|
|
|
ifeq ($(HOST),Windows_NT)
|
2010-10-27 22:39:24 +04:00
|
|
|
CFLAGS += -U__STRICT_ANSI__
|
2011-09-16 15:09:58 +04:00
|
|
|
endif
|
2010-10-27 22:39:24 +04:00
|
|
|
|
2012-05-16 23:57:43 +04:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Pixbuf
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
GTK_IMAGE_menu_cursor := gtk/res/menu_cursor.png
|
|
|
|
|
|
|
|
# 1: input file
|
|
|
|
# 2: output file
|
|
|
|
# 3: bitmap name
|
|
|
|
define convert_image
|
|
|
|
|
|
|
|
S_PIXBUF += $(2)
|
|
|
|
|
|
|
|
$(2): $(1)
|
|
|
|
$(Q)echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $(2)
|
|
|
|
$(Q)gdk-pixbuf-csource --extern --struct --name=$(3) $(1) >> $(2) || \
|
|
|
|
( rm -f $(2) && false )
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
2010-10-29 04:54:27 +04:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Source file setup
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2012-05-16 23:57:43 +04:00
|
|
|
#converted pixbuf sources
|
|
|
|
S_PIXBUF :=
|
|
|
|
|
|
|
|
$(eval $(foreach V,$(filter GTK_IMAGE_%,$(.VARIABLES)),$(call convert_image,$($(V)),$(OBJROOT)/$(patsubst GTK_IMAGE_%,%,$(V)).c,$(patsubst GTK_IMAGE_%,%,$(V))_pixdata)))
|
|
|
|
|
2010-10-29 04:54:27 +04:00
|
|
|
# S_GTK are sources purely for the GTK build
|
2011-01-30 02:40:22 +03:00
|
|
|
S_GTK := font_pango.c bitmap.c gui.c schedule.c thumbnail.c plotters.c \
|
2011-12-30 04:58:35 +04:00
|
|
|
treeview.c scaffolding.c gdk.c completion.c login.c throbber.c \
|
2011-01-30 02:40:22 +03:00
|
|
|
selection.c history.c window.c filetype.c download.c menu.c \
|
2013-04-14 14:26:05 +04:00
|
|
|
print.c search.c tabs.c theme.c toolbar.c gettext.c \
|
2013-05-27 17:21:48 +04:00
|
|
|
compat.c cookies.c hotlist.c \
|
2012-12-30 05:17:17 +04:00
|
|
|
$(addprefix dialogs/,preferences.c about.c source.c)
|
2012-05-16 23:57:43 +04:00
|
|
|
|
2010-10-29 04:54:27 +04:00
|
|
|
S_GTK := $(addprefix gtk/,$(S_GTK)) $(addprefix utils/,container.c)
|
|
|
|
# code in utils/container.ch is non-universal it seems
|
|
|
|
|
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
|
2012-05-16 23:57:43 +04:00
|
|
|
SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_PDF) $(S_PIXBUF) $(S_GTK)
|
2010-10-29 04:54:27 +04:00
|
|
|
EXETARGET := nsgtk
|
2012-08-23 14:46:31 +04:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Install target
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2012-11-04 15:17:41 +04:00
|
|
|
GTK_RESOURCES_LIST := adblock.css arrow_down_8x32.png ca-bundle.txt default.css \
|
|
|
|
default.ico favicon.png gtkdefault.css internal.css \
|
|
|
|
languages license netsurf.png netsurf.xpm \
|
|
|
|
netsurf-16x16.xpm quirks.css themelist toolbarIndices \
|
|
|
|
SearchEngines
|
|
|
|
GTK_RESOURCES_LIST := $(addprefix gtk/res/, $(GTK_RESOURCES_LIST)) \
|
|
|
|
$(wildcard gtk/res/*.gtk*.ui)
|
|
|
|
|
|
|
|
# translations with more than just Messages files
|
2013-04-29 01:06:30 +04:00
|
|
|
GTK_TRANSLATIONS_HTML := de en fr it ja nl
|
2012-11-04 15:17:41 +04:00
|
|
|
|
2012-08-23 14:46:31 +04:00
|
|
|
install-gtk:
|
2012-11-04 15:17:41 +04:00
|
|
|
$(Q)mkdir -p $(DESTDIR)$(NETSURF_GTK_RESOURCES)throbber
|
|
|
|
$(Q)mkdir -p $(DESTDIR)$(NETSURF_GTK_RESOURCES)icons
|
|
|
|
$(Q)mkdir -p $(DESTDIR)$(NETSURF_GTK_BIN)
|
2012-11-07 05:32:09 +04:00
|
|
|
$(Q)install nsgtk $(DESTDIR)$(NETSURF_GTK_BIN)netsurf
|
|
|
|
$(Q)install -m 0644 $(GTK_RESOURCES_LIST) $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
|
|
$(Q)install -m 0644 gtk/res/icons/*.png $(DESTDIR)$(NETSURF_GTK_RESOURCES)/icons
|
|
|
|
$(Q)install -m 0644 gtk/res/throbber/*.png $(DESTDIR)$(NETSURF_GTK_RESOURCES)/throbber
|
|
|
|
$(Q)tar -c -h -C gtk/res -f - themes | tar -xv -C $(DESTDIR)$(NETSURF_GTK_RESOURCES) -f -
|
2013-04-29 01:06:30 +04:00
|
|
|
$(Q)tar -c -h -C gtk/res -f - C $(GTK_TRANSLATIONS_HTML) | tar -xv -C $(DESTDIR)$(NETSURF_GTK_RESOURCES) -f -
|
2012-11-03 15:16:33 +04:00
|
|
|
$(call split_install_messages, gtk, $(DESTDIR)$(NETSURF_GTK_RESOURCES))
|
2012-08-23 14:46:31 +04:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Package target
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
package-gtk:
|