2010-10-27 22:39:24 +04:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Framebuffer target setup
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2010-10-29 04:54:27 +04:00
|
|
|
# define additional CFLAGS and LDFLAGS requirements for pkg-configed libs here
|
|
|
|
NETSURF_FEATURE_RSVG_CFLAGS := -DWITH_RSVG
|
|
|
|
NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
|
|
|
|
NETSURF_FEATURE_HUBBUB_CFLAGS := -DWITH_HUBBUB
|
2015-05-03 16:06:11 +03:00
|
|
|
NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
|
2010-10-29 04:54:27 +04:00
|
|
|
NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
|
|
|
|
NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
|
2012-10-22 19:17:09 +04:00
|
|
|
NETSURF_FEATURE_JS_CFLAGS := -DWITH_JS -DJS_HAS_FILE_OBJECT=0
|
|
|
|
NETSURF_FEATURE_MOZJS_CFLAGS := -DWITH_MOZJS -DJS_HAS_FILE_OBJECT=0
|
2010-10-29 04:54:27 +04:00
|
|
|
|
|
|
|
CFLAGS += -Dnsframebuffer
|
|
|
|
|
|
|
|
#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)"'
|
|
|
|
|
2014-09-05 19:01:44 +04:00
|
|
|
CFLAGS += -std=c99 -g -Dsmall \
|
2010-10-29 04:54:27 +04:00
|
|
|
-D_BSD_SOURCE \
|
2015-03-28 21:15:27 +03:00
|
|
|
-D_DEFAULT_SOURCE \
|
2010-10-29 04:54:27 +04:00
|
|
|
-D_XOPEN_SOURCE=600 \
|
2015-05-03 16:06:11 +03:00
|
|
|
-D_POSIX_C_SOURCE=200112L
|
2010-10-29 04:54:27 +04:00
|
|
|
|
2015-05-03 16:06:11 +03:00
|
|
|
LDFLAGS += -lm
|
2010-10-29 04:54:27 +04:00
|
|
|
|
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
|
|
|
|
|
|
|
|
$(eval $(call pkg_config_find_and_add,openssl,OpenSSL))
|
|
|
|
|
|
|
|
# freemint does not support pkg-config for libcurl
|
2010-10-29 04:54:27 +04:00
|
|
|
ifeq ($(HOST),mint)
|
2010-10-27 22:39:24 +04:00
|
|
|
CFLAGS += $(shell curl-config --cflags)
|
|
|
|
LDFLAGS += $(shell curl-config --libs)
|
2015-05-03 16:06:11 +03:00
|
|
|
LDFLAGS += -L/usr/lib/ -lz -liconv
|
2010-10-29 04:54:27 +04:00
|
|
|
else
|
2015-05-03 16:06:11 +03:00
|
|
|
$(eval $(call pkg_config_find_and_add,libcurl,Curl ))
|
|
|
|
endif
|
2010-10-29 04:54:27 +04:00
|
|
|
|
2015-05-03 16:06:11 +03:00
|
|
|
# freetype is optional but does not use pkg-config
|
|
|
|
ifeq ($(NETSURF_FB_FONTLIB),freetype)
|
|
|
|
CFLAGS += -DFB_USE_FREETYPE $(shell freetype-config --cflags)
|
|
|
|
LDFLAGS += $(shell freetype-config --libs)
|
2010-10-29 04:54:27 +04:00
|
|
|
endif
|
|
|
|
|
2015-05-03 16:06:11 +03:00
|
|
|
# optional pkg configured libraries
|
|
|
|
$(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG))
|
|
|
|
$(eval $(call pkg_config_find_and_add_enabled,ROSPRITE,librosprite,Sprite))
|
|
|
|
$(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,MOZJS,mozjs185,JavaScript))
|
|
|
|
$(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
|
|
|
|
|
2010-10-29 04:54:27 +04:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# built-in resource setup
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
FB_IMAGE_left_arrow := framebuffer/res/icons/back.png
|
|
|
|
FB_IMAGE_right_arrow := framebuffer/res/icons/forward.png
|
|
|
|
FB_IMAGE_reload := framebuffer/res/icons/reload.png
|
|
|
|
FB_IMAGE_stop_image := framebuffer/res/icons/stop.png
|
|
|
|
FB_IMAGE_history_image := framebuffer/res/icons/history.png
|
|
|
|
|
|
|
|
FB_IMAGE_left_arrow_g := framebuffer/res/icons/back_g.png
|
|
|
|
FB_IMAGE_right_arrow_g := framebuffer/res/icons/forward_g.png
|
|
|
|
FB_IMAGE_reload_g := framebuffer/res/icons/reload_g.png
|
|
|
|
FB_IMAGE_stop_image_g := framebuffer/res/icons/stop_g.png
|
|
|
|
FB_IMAGE_history_image_g := framebuffer/res/icons/history_g.png
|
|
|
|
|
|
|
|
FB_IMAGE_scrolll := framebuffer/res/icons/scrolll.png
|
|
|
|
FB_IMAGE_scrollr := framebuffer/res/icons/scrollr.png
|
|
|
|
FB_IMAGE_scrollu := framebuffer/res/icons/scrollu.png
|
|
|
|
FB_IMAGE_scrolld := framebuffer/res/icons/scrolld.png
|
|
|
|
|
2012-09-28 22:52:21 +04:00
|
|
|
FB_IMAGE_osk_image := framebuffer/res/icons/osk.png
|
2010-10-29 04:54:27 +04:00
|
|
|
|
|
|
|
FB_IMAGE_pointer_image := framebuffer/res/pointers/default.png
|
|
|
|
FB_IMAGE_hand_image := framebuffer/res/pointers/point.png
|
|
|
|
FB_IMAGE_caret_image := framebuffer/res/pointers/caret.png
|
|
|
|
FB_IMAGE_menu_image := framebuffer/res/pointers/menu.png
|
|
|
|
FB_IMAGE_progress_image := framebuffer/res/pointers/progress.png
|
2012-08-02 00:48:16 +04:00
|
|
|
FB_IMAGE_move_image := framebuffer/res/pointers/move.png
|
2010-10-29 04:54:27 +04:00
|
|
|
|
|
|
|
FB_IMAGE_throbber0 := framebuffer/res/throbber/throbber0.png
|
|
|
|
FB_IMAGE_throbber1 := framebuffer/res/throbber/throbber1.png
|
|
|
|
FB_IMAGE_throbber2 := framebuffer/res/throbber/throbber2.png
|
|
|
|
FB_IMAGE_throbber3 := framebuffer/res/throbber/throbber3.png
|
|
|
|
FB_IMAGE_throbber4 := framebuffer/res/throbber/throbber4.png
|
|
|
|
FB_IMAGE_throbber5 := framebuffer/res/throbber/throbber5.png
|
|
|
|
FB_IMAGE_throbber6 := framebuffer/res/throbber/throbber6.png
|
|
|
|
FB_IMAGE_throbber7 := framebuffer/res/throbber/throbber7.png
|
|
|
|
FB_IMAGE_throbber8 := framebuffer/res/throbber/throbber8.png
|
|
|
|
|
2015-05-03 16:06:11 +03:00
|
|
|
# local compiler flags
|
|
|
|
ifeq ($(HOST),OpenBSD)
|
|
|
|
HOST_CFLAGS += $(shell $(PKG_CONFIG) --cflags libpng)
|
2015-05-03 16:10:34 +03:00
|
|
|
HOST_LDFLAGS += $(shell $(PKG_CONFIG) --libs libpng)
|
2015-05-03 16:06:11 +03:00
|
|
|
else
|
|
|
|
HOST_CFLAGS +=
|
|
|
|
HOST_LDFLAGS += -lpng
|
|
|
|
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.
|
|
|
|
$(TOOLROOT)/convert_image: $(TOOLROOT)/created framebuffer/convert_image.c framebuffer/fbtk.h
|
|
|
|
$(VQ)echo " HOST CC: $@"
|
2015-05-03 16:06:11 +03:00
|
|
|
$(Q)$(HOST_CC) $(HOST_CFLAGS) -o $@ framebuffer/convert_image.c $(HOST_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 :=
|
|
|
|
|
2014-08-18 02:49:06 +04:00
|
|
|
$(eval $(foreach V,$(filter FB_IMAGE_%,$(.VARIABLES)),$(call convert_image,$($(V)),$(OBJROOT)/image-$(patsubst FB_IMAGE_%,%,$(V)).c,$(patsubst FB_IMAGE_%,%,$(V)))))
|
|
|
|
|
|
|
|
|
|
|
|
# Internal fonts to generate
|
2014-09-02 12:42:56 +04:00
|
|
|
FB_FONT_internal_ns-sans := framebuffer/res/fonts/glyph_data
|
2014-08-18 02:49:06 +04:00
|
|
|
|
|
|
|
# Internal font conversion
|
|
|
|
$(TOOLROOT)/convert_font: $(TOOLROOT)/created framebuffer/convert_font.c
|
|
|
|
$(VQ)echo " HOST CC: $@"
|
|
|
|
$(Q)$(HOST_CC) -o $@ framebuffer/convert_font.c
|
|
|
|
|
|
|
|
# 1: input file
|
|
|
|
# 2: output source code file
|
|
|
|
# 3: output header file
|
|
|
|
# 4: font name
|
|
|
|
define convert_font
|
|
|
|
|
|
|
|
S_FONTS += $(2)
|
|
|
|
|
|
|
|
$(2): $(1) $(TOOLROOT)/convert_font
|
|
|
|
$(VQ)echo " FONT: $(1) ($(4))"
|
|
|
|
$(Q)$(TOOLROOT)/convert_font -H $(3) $(1) $(2)
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
S_FONTS :=
|
|
|
|
|
|
|
|
$(eval $(foreach V,$(filter FB_FONT_$(NETSURF_FB_FONTLIB)_%,$(.VARIABLES)),$(call convert_font,$($(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
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# S_FRAMEBUFFER are sources purely for the framebuffer build
|
2015-04-24 00:48:01 +03:00
|
|
|
S_FRAMEBUFFER := gui.c framebuffer.c schedule.c misc.c bitmap.c fetch.c \
|
|
|
|
findfile.c localhistory.c clipboard.c
|
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
|
|
|
|
|
|
|
|
S_FRAMEBUFFER += font_$(NETSURF_FB_FONTLIB).c
|
|
|
|
|
|
|
|
S_FRAMEBUFFER := $(addprefix framebuffer/,$(S_FRAMEBUFFER)) $(addprefix framebuffer/fbtk/,$(S_FRAMEBUFFER_FBTK))
|
|
|
|
|
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
|
2014-08-18 02:49:06 +04:00
|
|
|
SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_FRAMEBUFFER) $(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 \
|
2014-10-22 23:39:43 +04:00
|
|
|
netsurf.png quirks.css welcome.html maps.html Messages
|
2012-09-30 01:06:26 +04:00
|
|
|
|
2012-08-23 14:46:31 +04:00
|
|
|
install-framebuffer:
|
2012-11-04 15:44:55 +04:00
|
|
|
$(Q)mkdir -p $(DESTDIR)$(NETSURF_FRAMEBUFFER_BIN)
|
|
|
|
$(Q)mkdir -p $(DESTDIR)$(NETSURF_FRAMEBUFFER_RESOURCES)
|
|
|
|
$(Q)cp -v $(EXETARGET) $(DESTDIR)/$(NETSURF_FRAMEBUFFER_BIN)netsurf$(SUBTARGET)
|
|
|
|
$(Q)for F in $(NETSURF_FRAMEBUFFER_RESOURCE_LIST); do cp -vL framebuffer/res/$$F $(DESTDIR)/$(NETSURF_FRAMEBUFFER_RESOURCES); done
|
2013-05-02 12:24:18 +04:00
|
|
|
$(Q)$(SPLIT_MESSAGES) -l en -p fb -f messages resources/FatMessages | gzip -9n > $(DESTDIR)$(NETSURF_FRAMEBUFFER_RESOURCES)messages
|
2012-08-23 14:46:31 +04:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Package target
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
package-framebuffer:
|