netsurf/gtk/Makefile.target
Vincent Sanders 802f58f10d Futher simplification of the makefile
Use target makefiles to set build sources

svn path=/trunk/netsurf/; revision=10916
2010-10-29 00:54:27 +00:00

73 lines
3.0 KiB
Makefile

# ----------------------------------------------------------------------------
# GTK flag setup (using pkg-config)
# ----------------------------------------------------------------------------
LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcurl libhubbub 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
# add a line similar to below for each optional pkg-configed lib here
$(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 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,PNG,libpng,PNG ))
# no pkg-config for this library
$(eval $(call feature_enabled,WEBP,-DWITH_WEBP,-lwebp -lvpx,WebP (libwebp)))
GTKCFLAGS := -std=c99 -Dgtk -Dnsgtk \
-DGTK_DISABLE_DEPRECATED \
-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 libglade-2.0 gtk+-2.0) \
$(shell $(PKG_CONFIG) --cflags libhubbub libcurl) \
$(shell $(PKG_CONFIG) --cflags openssl) \
$(shell xml2-config --cflags)
GTKLDFLAGS := $(shell $(PKG_CONFIG) --cflags --libs libglade-2.0 gtk+-2.0 gthread-2.0 gmodule-2.0 lcms)
CFLAGS += $(GTKCFLAGS)
LDFLAGS += $(GTKLDFLAGS)
# ---------------------------------------------------------------------------
# Windows flag setup
# ---------------------------------------------------------------------------
ifeq ($(HOST),Windows_NT)
CFLAGS += -U__STRICT_ANSI__
endif
# ----------------------------------------------------------------------------
# Source file setup
# ----------------------------------------------------------------------------
# S_GTK are sources purely for the GTK build
S_GTK := font_pango.c gtk_bitmap.c gtk_gui.c gtk_schedule.c \
gtk_thumbnail.c gtk_plotters.c gtk_treeview.c gtk_scaffolding.c \
gtk_completion.c gtk_login.c gtk_throbber.c gtk_selection.c \
gtk_history.c gtk_window.c gtk_filetype.c gtk_download.c \
gtk_menu.c gtk_print.c gtk_save.c gtk_search.c gtk_tabs.c \
gtk_theme.c gtk_toolbar.c sexy_icon_entry.c gtk_compat.c \
gtk_cookies.c gtk_hotlist.c \
$(addprefix dialogs/,gtk_options.c gtk_about.c gtk_source.c)
S_GTK := $(addprefix gtk/,$(S_GTK)) $(addprefix utils/,container.c)
# code in utils/container.ch is non-universal it seems
SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_PDF) $(S_GTK)
EXETARGET := nsgtk