2012-08-23 14:46:31 +04:00
|
|
|
#
|
|
|
|
# Makefile for NetSurf Windows target
|
|
|
|
#
|
|
|
|
# This file is part of NetSurf
|
2010-10-27 22:39:24 +04:00
|
|
|
|
2017-01-07 16:28:40 +03:00
|
|
|
|
|
|
|
VERSION_MAJ := $(shell sed -n '/_major/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
|
|
|
|
VERSION_MIN := $(shell sed -n '/_minor/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
|
|
|
|
|
|
|
|
|
2012-12-20 19:27:07 +04:00
|
|
|
LDFLAGS += -L${GCCSDK_INSTALL_ENV}/lib
|
|
|
|
CFLAGS += -I${GCCSDK_INSTALL_ENV}/include/
|
2011-02-04 18:44:35 +03:00
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
$(eval $(call pkg_config_find_and_add,libcares,Cares))
|
|
|
|
$(eval $(call pkg_config_find_and_add,zlib,ZLib))
|
|
|
|
|
2016-10-19 12:12:41 +03:00
|
|
|
# libraries for windows API
|
2017-11-24 18:39:31 +03:00
|
|
|
LDFLAGS += -lgnurx -lgdi32 -lcomctl32 -lws2_32 -lmsimg32 -lshlwapi -lcrypt32 -mwindows
|
2011-02-04 18:44:35 +03:00
|
|
|
|
2012-12-20 19:27:07 +04:00
|
|
|
CFLAGS += -U__STRICT_ANSI__ -mwin32
|
|
|
|
# only windows versions after XP are supported
|
2016-10-20 01:07:43 +03:00
|
|
|
# https://msdn.microsoft.com/en-gb/library/windows/desktop/aa383745
|
2012-12-20 19:27:07 +04:00
|
|
|
CFLAGS += '-DWINVER=0x0501'
|
|
|
|
CFLAGS += '-D_WIN32_WINNT=0x0501'
|
|
|
|
CFLAGS += '-D_WIN32_WINDOWS=0x0501'
|
|
|
|
CFLAGS += '-D_WIN32_IE=0x0501'
|
2011-03-30 00:38:40 +04:00
|
|
|
|
2012-12-20 19:27:07 +04:00
|
|
|
#installed resource path
|
|
|
|
CFLAGS += '-DNETSURF_WINDOWS_RESPATH="$(NETSURF_WINDOWS_RESPATH)"'
|
2011-03-30 00:38:40 +04:00
|
|
|
|
2016-10-20 01:07:43 +03:00
|
|
|
WSCFLAGS := -std=c99 -Dnswin32 -DCURL_STATICLIB -DCARES_STATICLIB -g
|
2011-03-30 00:38:40 +04:00
|
|
|
|
2012-12-20 19:27:07 +04:00
|
|
|
CFLAGS += $(WSCFLAGS)
|
|
|
|
LDFLAGS += $(WSCFLAGS)
|
2010-10-27 22:39:24 +04:00
|
|
|
|
2018-08-21 00:26:41 +03:00
|
|
|
# The filter and target for split messages
|
|
|
|
MESSAGES_FILTER=win
|
|
|
|
MESSAGES_TARGET=$(FRONTEND_RESOURCES_DIR)
|
|
|
|
|
2010-10-29 04:54:27 +04:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# built-in resource setup
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2018-08-21 00:26:41 +03:00
|
|
|
$(OBJROOT)/windows_resource.o: $(FRONTEND_RESOURCES_DIR)/resource.rc $(addsuffix /Messages,$(addprefix $(MESSAGES_TARGET)/,$(MESSAGES_LANGUAGES)))
|
2010-10-29 04:54:27 +04:00
|
|
|
$(VQ)echo " WINDRES: compiling windows resources"
|
2012-07-24 00:12:19 +04:00
|
|
|
${Q}$(WINDRES) $< -O coff -o $@
|
2010-10-29 04:54:27 +04:00
|
|
|
|
|
|
|
S_RESOURCES := windows_resource.o
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Source file setup
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2016-05-06 00:28:51 +03:00
|
|
|
# sources purely for the windows build
|
2019-05-10 01:11:05 +03:00
|
|
|
S_FRONTEND := main.c window.c gui.c clipboard.c drawable.c plot.c findfile.c \
|
2018-08-21 00:26:41 +03:00
|
|
|
font.c bitmap.c about.c prefs.c download.c fetch.c file.c \
|
2019-08-14 14:09:04 +03:00
|
|
|
local_history.c schedule.c windbg.c pointers.c \
|
2020-05-22 11:01:39 +03:00
|
|
|
corewindow.c hotlist.c cookies.c global_history.c
|
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_RESOURCES)
|
2010-10-29 04:54:27 +04:00
|
|
|
EXETARGET := NetSurf.exe
|
2012-08-13 00:50:36 +04:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Install target
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2012-08-23 14:46:31 +04:00
|
|
|
install-windows:
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Package target
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
package-windows: netsurf-installer.exe
|
2012-08-13 00:50:36 +04:00
|
|
|
|
2012-11-03 17:40:34 +04:00
|
|
|
WIN_RES_OBJ := installer.nsi NetSurf.ico netsurf.png welcome.html default.css
|
2017-01-07 16:28:40 +03:00
|
|
|
WIN_RES_INS_OBJ := $(addprefix $(FRONTEND_RESOURCES_DIR)/,$(WIN_RES_OBJ)) $(OBJROOT)/messages-en
|
|
|
|
|
|
|
|
# deal with making installer generation verbose
|
|
|
|
ifeq ($(Q),)
|
|
|
|
NSIS_VERBOSE := 4
|
|
|
|
else
|
|
|
|
NSIS_VERBOSE := 0
|
|
|
|
endif
|
2012-11-03 17:40:34 +04:00
|
|
|
|
2017-01-07 16:28:40 +03:00
|
|
|
# installer messages generation
|
2020-06-22 02:03:25 +03:00
|
|
|
$(OBJROOT)/messages-en: $(MESSAGES_TARGET)/en/Messages
|
|
|
|
$(VQ)echo " MSGCP: $< $@"
|
|
|
|
$(Q)$(INSTALL) -m 644 -T $< $@
|
2012-08-13 00:50:36 +04:00
|
|
|
|
|
|
|
netsurf-installer.exe: $(EXETARGET) $(WIN_RES_INS_OBJ)
|
2017-01-07 16:28:40 +03:00
|
|
|
$(VQ)echo "MAKENSIS: $@"
|
|
|
|
$(Q)makensis -V$(NSIS_VERBOSE) -NOCD -DOBJROOT=$(OBJROOT) -DRESDIR=$(FRONTEND_RESOURCES_DIR) -DVERSIONMAJOR=$(VERSION_MAJ) -DVERSIONMINOR=$(VERSION_MIN) -DOUTFNAME=$@ $(FRONTEND_RESOURCES_DIR)/installer.nsi
|
|
|
|
|
|
|
|
clean-installer:
|
|
|
|
$(VQ)echo " CLEAN: netsurf-installer.exe"
|
|
|
|
$(Q)$(RM) netsurf-installer.exe
|
|
|
|
CLEANS += clean-installer
|