2019-02-17 03:08:28 +03:00
|
|
|
#
|
|
|
|
# Makefile for NetSurf Framebuffer frontend
|
|
|
|
#
|
|
|
|
# This file is part of NetSurf
|
|
|
|
#
|
2010-10-27 22:39:24 +04:00
|
|
|
# ----------------------------------------------------------------------------
|
2019-02-17 03:08:28 +03:00
|
|
|
# Framebuffer flag setup (using pkg-config)
|
2010-10-27 22:39:24 +04:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2018-09-07 14:01:21 +03:00
|
|
|
CFLAGS += -std=c99 -g \
|
|
|
|
-Dnsframebuffer -Dsmall
|
2010-10-29 04:54:27 +04:00
|
|
|
|
|
|
|
#resource path
|
2012-08-22 19:58:11 +04:00
|
|
|
CFLAGS += '-DNETSURF_FB_RESPATH="$(NETSURF_FB_RESPATH)"'
|
2010-10-29 04:54:27 +04:00
|
|
|
|
|
|
|
# compile time font locations
|
2011-02-24 01:27:55 +03:00
|
|
|
CFLAGS += '-DNETSURF_FB_FONTPATH="$(NETSURF_FB_FONTPATH)"'
|
2010-10-29 04:54:27 +04:00
|
|
|
CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF="$(NETSURF_FB_FONT_SANS_SERIF)"'
|
|
|
|
CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_BOLD="$(NETSURF_FB_FONT_SANS_SERIF_BOLD)"'
|
|
|
|
CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_ITALIC="$(NETSURF_FB_FONT_SANS_SERIF_ITALIC)"'
|
|
|
|
CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD="$(NETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD)"'
|
|
|
|
CFLAGS += '-DNETSURF_FB_FONT_SERIF="$(NETSURF_FB_FONT_SERIF)"'
|
|
|
|
CFLAGS += '-DNETSURF_FB_FONT_SERIF_BOLD="$(NETSURF_FB_FONT_SERIF_BOLD)"'
|
|
|
|
CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE="$(NETSURF_FB_FONT_MONOSPACE)"'
|
|
|
|
CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE_BOLD="$(NETSURF_FB_FONT_MONOSPACE_BOLD)"'
|
|
|
|
CFLAGS += '-DNETSURF_FB_FONT_CURSIVE="$(NETSURF_FB_FONT_CURSIVE)"'
|
|
|
|
CFLAGS += '-DNETSURF_FB_FONT_FANTASY="$(NETSURF_FB_FONT_FANTASY)"'
|
|
|
|
|
2015-05-03 16:06:11 +03:00
|
|
|
LDFLAGS += -lm
|
2010-10-29 04:54:27 +04:00
|
|
|
|
2018-12-18 14:42:43 +03:00
|
|
|
# freetype is optional but older versions do not use pkg-config
|
|
|
|
ifeq ($(NETSURF_FB_FONTLIB),freetype)
|
|
|
|
NETSURF_USE_FREETYPE2 := AUTO
|
|
|
|
NETSURF_FEATURE_FREETYPE2_CFLAGS := -DFB_USE_FREETYPE
|
|
|
|
|
|
|
|
$(eval $(call pkg_config_find_and_add_enabled,FREETYPE2,freetype2,freetype2))
|
|
|
|
|
|
|
|
# try and use non pkg-config method
|
|
|
|
ifeq ($(NETSURF_USE_FREETYPE2),NO)
|
|
|
|
FREETYPE_CONFIG_EXISTS := $(shell freetype-config --cflags >/dev/null && echo yes)
|
|
|
|
ifeq ($(FREETYPE_CONFIG_EXISTS),yes)
|
|
|
|
NETSURF_USE_FREETYPE2 := YES
|
|
|
|
CFLAGS += $(shell freetype-config --cflags) $(NETSURF_FEATURE_FREETYPE2_CFLAGS)
|
|
|
|
LDFLAGS += $(shell freetype-config --libs)
|
|
|
|
$(info FT2.CNFG: freetype2 (freetype2) enabled)
|
|
|
|
else
|
|
|
|
$(info FT2.CNFG: freetype2 (freetype2) failed)
|
|
|
|
$(error Unable to find library for: freetype2)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2015-05-03 16:06:11 +03:00
|
|
|
# non optional pkg-configed libs
|
|
|
|
LDFLAGS += -Wl,--whole-archive
|
|
|
|
$(eval $(call pkg_config_find_and_add,libnsfb,libnsfb))
|
|
|
|
LDFLAGS += -Wl,--no-whole-archive
|
|
|
|
|
2019-02-17 03:08:28 +03:00
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
# Target setup
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# The filter and target for split messages
|
|
|
|
MESSAGES_FILTER=fb
|
|
|
|
MESSAGES_TARGET=$(FRONTEND_RESOURCES_DIR)
|
|
|
|
|
2018-09-07 14:01:21 +03:00
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
# HOST specific feature flags
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
2019-02-15 19:31:06 +03:00
|
|
|
# enable POSIX and XSI feature flasg except:
|
|
|
|
# - the default set on freebsd already has them enabled
|
|
|
|
# - openbsd does not require the default source flags
|
2018-09-07 14:01:21 +03:00
|
|
|
ifneq ($(HOST),FreeBSD)
|
2019-02-15 19:31:06 +03:00
|
|
|
ifneq ($(HOST),OpenBSD)
|
|
|
|
CFLAGS += -D_POSIX_C_SOURCE=200809L \
|
|
|
|
-D_XOPEN_SOURCE=700 \
|
|
|
|
-D_BSD_SOURCE \
|
|
|
|
-D_DEFAULT_SOURCE \
|
|
|
|
-D_NETBSD_SOURCE
|
|
|
|
else
|
|
|
|
CFLAGS += -D_POSIX_C_SOURCE=200809L
|
|
|
|
endif
|
2018-09-07 14:01:21 +03:00
|
|
|
endif
|
2010-10-29 04:54:27 +04:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# built-in resource setup
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
FB_IMAGE_left_arrow := icons/back.png
|
|
|
|
FB_IMAGE_right_arrow := icons/forward.png
|
|
|
|
FB_IMAGE_reload := icons/reload.png
|
|
|
|
FB_IMAGE_stop_image := icons/stop.png
|
|
|
|
FB_IMAGE_history_image := icons/history.png
|
|
|
|
|
|
|
|
FB_IMAGE_left_arrow_g := icons/back_g.png
|
|
|
|
FB_IMAGE_right_arrow_g := icons/forward_g.png
|
|
|
|
FB_IMAGE_reload_g := icons/reload_g.png
|
|
|
|
FB_IMAGE_stop_image_g := icons/stop_g.png
|
|
|
|
FB_IMAGE_history_image_g := icons/history_g.png
|
|
|
|
|
|
|
|
FB_IMAGE_scrolll := icons/scrolll.png
|
|
|
|
FB_IMAGE_scrollr := icons/scrollr.png
|
|
|
|
FB_IMAGE_scrollu := icons/scrollu.png
|
|
|
|
FB_IMAGE_scrolld := icons/scrolld.png
|
|
|
|
|
|
|
|
FB_IMAGE_osk_image := icons/osk.png
|
|
|
|
|
|
|
|
FB_IMAGE_pointer_image := pointers/default.png
|
|
|
|
FB_IMAGE_hand_image := pointers/point.png
|
|
|
|
FB_IMAGE_caret_image := pointers/caret.png
|
|
|
|
FB_IMAGE_menu_image := pointers/menu.png
|
|
|
|
FB_IMAGE_progress_image := pointers/progress.png
|
|
|
|
FB_IMAGE_move_image := pointers/move.png
|
|
|
|
|
|
|
|
FB_IMAGE_throbber0 := throbber/throbber0.png
|
|
|
|
FB_IMAGE_throbber1 := throbber/throbber1.png
|
|
|
|
FB_IMAGE_throbber2 := throbber/throbber2.png
|
|
|
|
FB_IMAGE_throbber3 := throbber/throbber3.png
|
|
|
|
FB_IMAGE_throbber4 := throbber/throbber4.png
|
|
|
|
FB_IMAGE_throbber5 := throbber/throbber5.png
|
|
|
|
FB_IMAGE_throbber6 := throbber/throbber6.png
|
|
|
|
FB_IMAGE_throbber7 := throbber/throbber7.png
|
|
|
|
FB_IMAGE_throbber8 := throbber/throbber8.png
|
2010-10-29 04:54:27 +04:00
|
|
|
|
2015-05-03 16:06:11 +03:00
|
|
|
# local compiler flags
|
|
|
|
ifeq ($(HOST),OpenBSD)
|
2018-09-07 14:01:21 +03:00
|
|
|
BUILD_CFLAGS += $(shell $(PKG_CONFIG) --cflags libpng)
|
|
|
|
BUILD_LDFLAGS += $(shell $(PKG_CONFIG) --libs libpng)
|
2015-05-03 16:06:11 +03:00
|
|
|
else
|
2018-09-07 14:23:39 +03:00
|
|
|
ifeq ($(HOST),FreeBSD)
|
|
|
|
BUILD_CFLAGS += $(shell $(PKG_CONFIG) --cflags libpng)
|
|
|
|
BUILD_LDFLAGS += $(shell $(PKG_CONFIG) --libs libpng)
|
|
|
|
else
|
|
|
|
BUILD_CFLAGS +=
|
|
|
|
BUILD_LDFLAGS += -lpng
|
|
|
|
endif
|
2015-05-03 16:06:11 +03:00
|
|
|
endif
|
|
|
|
|
2014-08-18 02:49:06 +04:00
|
|
|
# Host tool to convert image bitmaps to source code.
|
|
|
|
#
|
|
|
|
# convert_image dependd on fb_bitmap.h so that if we change that
|
|
|
|
# header, we get new images built.
|
2016-05-06 00:28:51 +03:00
|
|
|
$(TOOLROOT)/convert_image: $(TOOLROOT)/created $(FRONTEND_SOURCE_DIR)/convert_image.c $(FRONTEND_SOURCE_DIR)/fbtk.h
|
2018-09-07 14:01:21 +03:00
|
|
|
$(VQ)echo "BUILD CC: $@"
|
|
|
|
$(Q)$(BUILD_CC) $(BUILD_CFLAGS) -o $@ $(FRONTEND_SOURCE_DIR)/convert_image.c $(BUILD_LDFLAGS)
|
2014-08-18 02:49:06 +04:00
|
|
|
|
2010-10-29 04:54:27 +04:00
|
|
|
# 1: input file
|
|
|
|
# 2: output file
|
|
|
|
# 3: bitmap name
|
|
|
|
define convert_image
|
|
|
|
|
|
|
|
S_IMAGES += $(2)
|
|
|
|
|
|
|
|
$(2): $(1) $(TOOLROOT)/convert_image
|
|
|
|
$(Q)$(TOOLROOT)/convert_image $(1) $(2) $(3)
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
S_IMAGES :=
|
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
$(eval $(foreach V,$(filter FB_IMAGE_%,$(.VARIABLES)),$(call convert_image,$(FRONTEND_RESOURCES_DIR)/$($(V)),$(OBJROOT)/image-$(patsubst FB_IMAGE_%,%,$(V)).c,$(patsubst FB_IMAGE_%,%,$(V)))))
|
2014-08-18 02:49:06 +04:00
|
|
|
|
|
|
|
|
|
|
|
# Internal fonts to generate
|
2016-05-06 00:28:51 +03:00
|
|
|
FB_FONT_internal_ns-sans := fonts/glyph_data
|
2014-08-18 02:49:06 +04:00
|
|
|
|
|
|
|
# Internal font conversion
|
2016-05-06 00:28:51 +03:00
|
|
|
$(TOOLROOT)/convert_font: $(TOOLROOT)/created $(FRONTEND_SOURCE_DIR)/convert_font.c
|
2018-09-07 14:01:21 +03:00
|
|
|
$(VQ)echo "BUILD CC: $@"
|
|
|
|
$(Q)$(BUILD_CC) -o $@ $(FRONTEND_SOURCE_DIR)/convert_font.c
|
2014-08-18 02:49:06 +04:00
|
|
|
|
|
|
|
# 1: input file
|
|
|
|
# 2: output source code file
|
|
|
|
# 3: output header file
|
|
|
|
# 4: font name
|
|
|
|
define convert_font
|
|
|
|
|
|
|
|
S_FONTS += $(2)
|
|
|
|
|
2018-04-21 14:35:35 +03:00
|
|
|
$(2) $(3): $(1) $(TOOLROOT)/convert_font
|
2014-08-18 02:49:06 +04:00
|
|
|
$(VQ)echo " FONT: $(1) ($(4))"
|
|
|
|
$(Q)$(TOOLROOT)/convert_font -H $(3) $(1) $(2)
|
|
|
|
|
2018-04-22 16:10:10 +03:00
|
|
|
frontends/framebuffer/font_internal.c: $(2)
|
2018-04-21 14:35:35 +03:00
|
|
|
|
2014-08-18 02:49:06 +04:00
|
|
|
endef
|
|
|
|
|
|
|
|
S_FONTS :=
|
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
$(eval $(foreach V,$(filter FB_FONT_$(NETSURF_FB_FONTLIB)_%,$(.VARIABLES)),$(call convert_font,$(FRONTEND_RESOURCES_DIR)/$($(V)),$(OBJROOT)/font-$(patsubst FB_FONT_$(NETSURF_FB_FONTLIB)_%,%,$(V)).c,$(OBJROOT)/font-$(patsubst FB_FONT_$(NETSURF_FB_FONTLIB)_%,%,$(V)).h,$(patsubst FB_FONT_$(NETSURF_FB_FONTLIB)_%,%,$(V)))))
|
2010-10-29 04:54:27 +04:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Source file setup
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
# S_FRONTEND are sources purely for the framebuffer build
|
|
|
|
S_FRONTEND := gui.c framebuffer.c schedule.c bitmap.c fetch.c \
|
2017-06-10 17:34:45 +03:00
|
|
|
findfile.c corewindow.c local_history.c clipboard.c
|
2010-10-29 04:54:27 +04:00
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
# toolkit sources
|
2010-10-29 04:54:27 +04:00
|
|
|
S_FRAMEBUFFER_FBTK := fbtk.c event.c fill.c bitmap.c user.c window.c \
|
|
|
|
text.c scroll.c osk.c
|
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
S_FRONTEND += font_$(NETSURF_FB_FONTLIB).c
|
2010-10-29 04:54:27 +04:00
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
S_FRONTEND += $(addprefix fbtk/,$(S_FRAMEBUFFER_FBTK))
|
2010-10-29 04:54:27 +04: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 = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_FRONTEND) $(S_IMAGES) $(S_FONTS)
|
2012-08-23 14:46:31 +04:00
|
|
|
EXETARGET := nsfb
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Install target
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2012-09-30 01:06:26 +04:00
|
|
|
NETSURF_FRAMEBUFFER_RESOURCE_LIST := adblock.css credits.html \
|
2012-11-04 15:44:55 +04:00
|
|
|
default.css internal.css licence.html \
|
2018-05-22 15:04:09 +03:00
|
|
|
netsurf.png quirks.css welcome.html maps.html
|
2012-09-30 01:06:26 +04:00
|
|
|
|
2012-08-23 14:46:31 +04:00
|
|
|
install-framebuffer:
|
2019-02-15 20:53:31 +03:00
|
|
|
$(VQ)echo " INSTALL: $(DESTDIR)/$(PREFIX)"
|
|
|
|
$(Q)$(INSTALL) -d $(DESTDIR)/$(NETSURF_FRAMEBUFFER_BIN)
|
|
|
|
$(Q)$(INSTALL) -T $(EXETARGET) $(DESTDIR)/$(NETSURF_FRAMEBUFFER_BIN)/netsurf-fb
|
|
|
|
$(Q)$(INSTALL) -d $(DESTDIR)/$(NETSURF_FRAMEBUFFER_RESOURCES)
|
|
|
|
$(Q)for F in $(NETSURF_FRAMEBUFFER_RESOURCE_LIST); do $(INSTALL) -m 644 $(FRONTEND_RESOURCES_DIR)/$$F $(DESTDIR)/$(NETSURF_FRAMEBUFFER_RESOURCES); done
|
2019-02-16 12:29:18 +03:00
|
|
|
$(Q)$(RM) $(DESTDIR)/$(NETSURF_FRAMEBUFFER_RESOURCES)/Messages
|
|
|
|
$(Q)$(SPLIT_MESSAGES) -l en -p fb -f messages -o $(DESTDIR)/$(NETSURF_FRAMEBUFFER_RESOURCES)/Messages -z resources/FatMessages
|
2012-08-23 14:46:31 +04:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Package target
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
package-framebuffer:
|