You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
netsurf/frontends/kolibrios/Makefile

146 lines
7.7 KiB

ENVDIR := $(PREFIX)
KOLIBRI_SVN_CHECKOUT := $(ENVDIR)/kolibrios
KOL_OBJ_DIR := $(ENVDIR)/obj
KOL_LIBC := $(KOLIBRI_SVN_CHECKOUT)/contrib/sdk/sources/newlib/libc/include/
KOL_LIB_DIR := $(KOLIBRI_SVN_CHECKOUT)/contrib/sdk/lib
LIB_LDFLAGS := -L$(KOL_LIB_DIR) -L/opt/netsurf/kos32-gcc/cross/autobuild/tools/win32/lib -lfreetype
OS_LDFLAGS := -static -S -T$(KOLIBRI_SVN_CHECKOUT)/contrib/sdk/sources/newlib/app-dynamic.lds --image-base 0 -Map netsurf-kolibrios.map
NS_INCLUDE := $(PREFIX)/include
NS_LIB_LDFLAGS := -L$(PREFIX)/lib/ -lnsbmp -lnsutils -lwapcaplet -lsvgtiny -lnsgif -lutf8proc -lcss -lnsfb -lparserutils -ldom -lhubbub
CFLAGS += -c -fno-ident -fomit-frame-pointer -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -U__BSD_VISIBLE -I$(KOL_LIBC) -I$(NS_INCLUDE)
LDFLAGS += $(OS_LDFLAGS) $(NS_LIB_LDFLAGS) $(LIB_LDFLAGS) -lz -lgcc -lc.dll
CWARNFLAGS += -Wno-error -Wno-redundant-decls -Wno-char-subscripts -Wno-undef -Wno-implicit-function-declaration -Wno-nested-externs -Wno-format-extra-args -Wno-format
DMACROS := -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -D_NETBSD_SOURCE -D_TARGET_IS_KOLIBRIOS -DKOLIBRI_USE_FREETYPE -DFB_USE_FREETYPE
KOL_OTHER_INCLUDES := -I$(KOLIBRI_SVN_CHECKOUT)/contrib/sdk/sources/libpng/ -I$(KOLIBRI_SVN_CHECKOUT)/contrib/sdk/sources/zlib -I$(KOLIBRI_SVN_CHECKOUT)/contrib/sdk/sources/freetype/include -I$(KOLIBRI_SVN_CHECKOUT)/contrib/sdk/sources/freetype/include -I$(KOLIBRI_SVN_CHECKOUT)/contrib/sdk/sources/libjpeg
CFLAGS += $(KOL_OTHER_INCLUDES) $(DMACROS) -std=c99 -g
CFLAGS += '-DNETSURF_USE_KOLIBRI_HTTPLIB'
##########################################################################
# Only for FB compat with kolibri. Get rid soon.
CFLAGS += '-DKOLIBRI_RUNTIME_RESPATH="$(NETSURF_KOLIBRI_RESPATH)"'
# compile time font locations
CFLAGS += '-DNETSURF_FB_FONTPATH="$(NETSURF_KOLIBRI_FONTPATH)"'
CFLAGS += '-DKOLIBRI_FONT_FREETYPE_SANS_SERIF="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_BOLD="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_ITALIC="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
CFLAGS += '-DNETSURF_FB_FONT_SERIF="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
CFLAGS += '-DNETSURF_FB_FONT_SERIF_BOLD="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE_BOLD="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
CFLAGS += '-DNETSURF_FB_FONT_CURSIVE="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
CFLAGS += '-DNETSURF_FB_FONT_FANTASY="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
CFLAGS += '-DWITH_NSLOG'
CFLAGS += '-w'
#########################################################################
KOLIBRI_IMAGE_left_arrow := $(FRONTEND_SOURCE_DIR)/res/icons/back.png
KOLIBRI_IMAGE_right_arrow := $(FRONTEND_SOURCE_DIR)/res/icons/forward.png
KOLIBRI_IMAGE_reload := $(FRONTEND_SOURCE_DIR)/res/icons/reload.png
KOLIBRI_IMAGE_stop_image := $(FRONTEND_SOURCE_DIR)/res/icons/stop.png
KOLIBRI_IMAGE_history_image := $(FRONTEND_SOURCE_DIR)/res/icons/history.png
KOLIBRI_IMAGE_left_arrow_g := $(FRONTEND_SOURCE_DIR)/res/icons/back_g.png
KOLIBRI_IMAGE_right_arrow_g := $(FRONTEND_SOURCE_DIR)/res/icons/forward_g.png
KOLIBRI_IMAGE_reload_g := $(FRONTEND_SOURCE_DIR)/res/icons/reload_g.png
KOLIBRI_IMAGE_stop_image_g := $(FRONTEND_SOURCE_DIR)/res/icons/stop_g.png
KOLIBRI_IMAGE_history_image_g := $(FRONTEND_SOURCE_DIR)/res/icons/history_g.png
KOLIBRI_IMAGE_scrolll := $(FRONTEND_SOURCE_DIR)/res/icons/scrolll.png
KOLIBRI_IMAGE_scrollr := $(FRONTEND_SOURCE_DIR)/res/icons/scrollr.png
KOLIBRI_IMAGE_scrollu := $(FRONTEND_SOURCE_DIR)/res/icons/scrollu.png
KOLIBRI_IMAGE_scrolld := $(FRONTEND_SOURCE_DIR)/res/icons/scrolld.png
KOLIBRI_IMAGE_osk_image := $(FRONTEND_SOURCE_DIR)/res/icons/osk.png
KOLIBRI_IMAGE_pointer_image := $(FRONTEND_SOURCE_DIR)/res/pointers/default.png
KOLIBRI_IMAGE_hand_image := $(FRONTEND_SOURCE_DIR)/res/pointers/point.png
KOLIBRI_IMAGE_caret_image := $(FRONTEND_SOURCE_DIR)/res/pointers/caret.png
KOLIBRI_IMAGE_menu_image := $(FRONTEND_SOURCE_DIR)/res/pointers/menu.png
KOLIBRI_IMAGE_progress_image := $(FRONTEND_SOURCE_DIR)/res/pointers/progress.png
KOLIBRI_IMAGE_move_image := $(FRONTEND_SOURCE_DIR)/res/pointers/move.png
KOLIBRI_IMAGE_throbber0 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber0.png
KOLIBRI_IMAGE_throbber1 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber1.png
KOLIBRI_IMAGE_throbber2 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber2.png
KOLIBRI_IMAGE_throbber3 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber3.png
KOLIBRI_IMAGE_throbber4 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber4.png
KOLIBRI_IMAGE_throbber5 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber5.png
KOLIBRI_IMAGE_throbber6 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber6.png
KOLIBRI_IMAGE_throbber7 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber7.png
KOLIBRI_IMAGE_throbber8 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber8.png
# Host tool to convert image bitmaps to source code.
#
# convert_image depends on fb_bitmap.h so that if we change that
# header, we get new images built.
HOST_LDFLAGS += -lpng
$(TOOLROOT)/convert_image: $(TOOLROOT)/created $(FRONTEND_SOURCE_DIR)/fbsources/convert_image.c
$(VQ)echo " HOST CC: $@"
$(Q)$(HOST_CC) $(HOST_CFLAGS) -o $@ $(FRONTEND_SOURCE_DIR)/fbsources/convert_image.c $(HOST_LDFLAGS)
# 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 :=
$(eval $(foreach V,$(filter KOLIBRI_IMAGE_%,$(.VARIABLES)),$(call convert_image,$($(V)),$(OBJROOT)/image-$(patsubst KOLIBRI_IMAGE_%,%,$(V)).c,$(patsubst KOLIBRI_IMAGE_%,%,$(V)))))
# non optional pkg-configed libs
#$(eval $(call pkg_config_find_and_add,libcurl,Curl ))
#$(eval $(call pkg_config_find_and_add,openssl,OpenSSL))
#$(eval $(call pkg_config_find_and_add,glib-2.0,GLib2))
# optional pkg-config configured libraries
# $(eval $(call pkg_config_find_and_add_enabled,NSSVG,libsvgtiny,SVG))
# $(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,JPEG,libnsjpeg,JPEG))
# $(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG ))
# $(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript))
# $(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
#S_KOLIBRIOS := main.c kolibri_misc.c kolibri_debug.c kolibri_filesystem.c kolibri_regex.c
S_KOLIBRIOS := kolibri_http.c gui.c schedule.c
S_FRAMEBUFFER := framebuffer.c bitmap.c fetch.c findfile.c local_history.c corewindow.c clipboard.c font_$(NETSURF_KOLIBRI_FONTLIB).c
S_FRAMEBUFFER_FBTK := fbtk.c event.c fill.c bitmap.c user.c window.c text.c scroll.c osk.c
S_FRAMEBUFFER := $(addprefix fbsources/,$(S_FRAMEBUFFER))
S_FRAMEBUFFER += $(addprefix fbsources/fbtk/,$(S_FRAMEBUFFER_FBTK))
S_KOLIBRIOS += $(S_FRAMEBUFFER)
S_FRONTEND := $(S_KOLIBRIOS)
SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_FRONTEND) $(S_IMAGES)
EXETARGET := nskolibrios
KOLOBJECTS = $(KOL_OBJ_DIR)/dirent.o $(KOL_OBJ_DIR)/iconv.o $(KOL_OBJ_DIR)/loadhttp.obj
## Install specific stuff
DESTDIR := $(PREFIX)/bin
DESTRESDIR := $(PREFIX)/bin/res
KOLIBRI_RES_DIR := $(HOME)/NETSURFLIBS/netsurf/frontends/kolibrios/res
RELEASENAME :=
# make install is buggy with -jN when it cannot find the EXETARGET as it tries to install it before it is created.
install-kolibrios:
$(Q)$(MKDIR) -p $(DESTDIR)
$(Q)install $(EXETARGET) $(DESTDIR)/netsurf-kolibrios
$(Q)cp -r $(KOLIBRI_RES_DIR) $(DESTRESDIR)
$(Q)cp netsurf-kolibrios.map $(DESTDIR)/