mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-28 09:13:08 +03:00
166 lines
6.5 KiB
Makefile
166 lines
6.5 KiB
Makefile
#
|
|
# Makefile for NetSurf GTK target
|
|
#
|
|
# This file is part of NetSurf
|
|
#
|
|
# ----------------------------------------------------------------------------
|
|
# GTK flag setup (using pkg-config)
|
|
# ----------------------------------------------------------------------------
|
|
|
|
LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcurl libdom libcss)
|
|
LDFLAGS += $(shell $(PKG_CONFIG) --libs openssl)
|
|
|
|
# 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
|
|
NETSURF_FEATURE_JS_CFLAGS := -DWITH_JS -DJS_HAS_FILE_OBJECT=0
|
|
NETSURF_FEATURE_MOZJS_CFLAGS := -DWITH_MOZJS -DJS_HAS_FILE_OBJECT=0
|
|
NETSURF_FEATURE_VIDEO_CFLAGS := -DWITH_VIDEO
|
|
|
|
# add a line similar to below for each optional lib here
|
|
# note: webp lacks pkg-config file
|
|
$(eval $(call pkg_config_find_and_add,PNG,libpng,PNG ))
|
|
$(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,RSVG,librsvg-2.0,SVG))
|
|
$(eval $(call pkg_config_find_and_add,NSSVG,libsvgtiny,SVG))
|
|
$(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,Sprite))
|
|
$(eval $(call feature_enabled,WEBP,-DWITH_WEBP,-lwebp,WebP (libwebp)))
|
|
$(eval $(call pkg_config_find_and_add,MOZJS,mozjs185,JavaScript))
|
|
$(eval $(call pkg_config_find_and_add,JS,mozilla-js,JavaScript))
|
|
$(eval $(call pkg_config_find_and_add,VIDEO,gstreamer-0.10,Video))
|
|
|
|
ifeq ($(NETSURF_USE_MOZJS),YES)
|
|
NETSURF_USE_JS:=YES
|
|
endif
|
|
|
|
# GTK and GLIB flags to disable depricated usage
|
|
GTKDEPFLAGS := -DG_DISABLE_SINGLE_INCLUDES \
|
|
-DG_DISABLE_DEPRECATED \
|
|
-DGTK_DISABLE_SINGLE_INCLUDES \
|
|
-DGTK_DISABLE_DEPRECATED \
|
|
-DGTK_MULTIHEAD_SAFE \
|
|
-DPANGO_DISABLE_DEPRECATED \
|
|
-DGDK_PIXBUF_DISABLE_DEPRECATED
|
|
|
|
# libsexy currently means we cannot enable this
|
|
# -DGDK_DISABLE_DEPRECATED
|
|
|
|
GTKCFLAGS := -std=c99 -Dgtk -Dnsgtk \
|
|
$(GTKDEPFLAGS) \
|
|
-D_BSD_SOURCE \
|
|
-D_XOPEN_SOURCE=600 \
|
|
-D_POSIX_C_SOURCE=200112L \
|
|
-D_NETBSD_SOURCE \
|
|
-DGTK_RESPATH=\"$(NETSURF_GTK_RESOURCES)\" \
|
|
$(WARNFLAGS) -I. -g \
|
|
$(shell $(PKG_CONFIG) --cflags gtk+-$(NETSURF_GTK_MAJOR).0) \
|
|
$(shell $(PKG_CONFIG) --cflags libhubbub libcurl) \
|
|
$(shell $(PKG_CONFIG) --cflags openssl) \
|
|
$(shell xml2-config --cflags)
|
|
|
|
GTKLDFLAGS := $(shell $(PKG_CONFIG) --cflags --libs gtk+-$(NETSURF_GTK_MAJOR).0 gthread-2.0 gmodule-2.0 lcms)
|
|
|
|
CFLAGS += $(GTKCFLAGS)
|
|
LDFLAGS += $(GTKLDFLAGS)
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Windows flag setup
|
|
# ---------------------------------------------------------------------------
|
|
|
|
ifeq ($(HOST),Windows_NT)
|
|
CFLAGS += -U__STRICT_ANSI__
|
|
endif
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
# 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
|
|
|
|
# ----------------------------------------------------------------------------
|
|
# Source file setup
|
|
# ----------------------------------------------------------------------------
|
|
|
|
#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)))
|
|
|
|
# S_GTK are sources purely for the GTK build
|
|
S_GTK := font_pango.c bitmap.c gui.c schedule.c thumbnail.c plotters.c \
|
|
treeview.c scaffolding.c gdk.c completion.c login.c throbber.c \
|
|
selection.c history.c window.c filetype.c download.c menu.c \
|
|
print.c save.c search.c tabs.c theme.c toolbar.c \
|
|
compat.c cookies.c hotlist.c system_colour.c \
|
|
$(addprefix dialogs/,options.c about.c source.c)
|
|
|
|
S_GTK := $(addprefix gtk/,$(S_GTK)) $(addprefix utils/,container.c)
|
|
# code in utils/container.ch is non-universal it seems
|
|
|
|
# This is the final source build list
|
|
# Note this is deliberately *not* expanded here as common and image
|
|
# are not yet available
|
|
SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_PDF) $(S_PIXBUF) $(S_GTK)
|
|
EXETARGET := nsgtk
|
|
|
|
# ----------------------------------------------------------------------------
|
|
# Install target
|
|
# ----------------------------------------------------------------------------
|
|
|
|
install-gtk:
|
|
mkdir -p $(DESTDIR)$(NETSURF_GTK_RESOURCES)throbber
|
|
mkdir -p $(DESTDIR)$(NETSURF_GTK_RESOURCES)icons
|
|
mkdir -p $(DESTDIR)$(NETSURF_GTK_BIN)
|
|
@cp -RLv nsgtk $(DESTDIR)$(NETSURF_GTK_BIN)netsurf
|
|
@cp -RLv gtk/res/adblock.css $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@cp -RLv gtk/res/arrow_down_8x32.png $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@cp -RLv gtk/res/ca-bundle.txt $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@cp -RLv gtk/res/default.css $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@cp -RLv gtk/res/default.ico $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@cp -RLv gtk/res/favicon.png $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@cp -RLv gtk/res/gtkdefault.css $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@cp -RLv gtk/res/icons/*.png $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@cp -RLv gtk/res/internal.css $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@cp -RLv gtk/res/languages $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@cp -RLv gtk/res/license $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@cp -RLv gtk/res/netsurf.png $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@cp -RLv gtk/res/netsurf.xpm $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@cp -RLv gtk/res/netsurf-16x16.xpm $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@cp -RLv gtk/res/quirks.css $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@cp -RLv gtk/res/themelist $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@cp -RLv gtk/res/throbber/*.png $(DESTDIR)$(NETSURF_GTK_RESOURCES)throbber
|
|
@cp -RLv gtk/res/toolbarIndices $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@cp -RLv gtk/res/SearchEngines $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@tar cf - -C gtk/res themes | tar xf - -C $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@# Install translations
|
|
@tar cf - -C gtk/res C de en fr it nl | tar xf - -C $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
@# Install glade templates
|
|
@cp -RLv gtk/res/*.gtk*.ui $(DESTDIR)$(NETSURF_GTK_RESOURCES)
|
|
|
|
# ----------------------------------------------------------------------------
|
|
# Package target
|
|
# ----------------------------------------------------------------------------
|
|
|
|
package-gtk:
|