2018-04-24 12:51:04 +02:00
|
|
|
# NMake Makefile portion for enabling features for Windows builds
|
|
|
|
|
|
|
|
# You may change these lines to customize various items
|
|
|
|
|
|
|
|
!ifndef PSL_FILE
|
|
|
|
PSL_FILE=..\list\public_suffix_list.dat
|
|
|
|
!endif
|
|
|
|
|
|
|
|
!ifndef PSL_TESTFILE
|
|
|
|
PSL_TESTFILE=..\list\tests\tests.txt
|
|
|
|
!endif
|
|
|
|
|
|
|
|
PSL_FILE_INPUT = $(PSL_FILE:\=/)
|
|
|
|
PSL_TESTFILE_INPUT = $(PSL_TESTFILE:\=/)
|
|
|
|
|
2022-03-07 14:14:41 +01:00
|
|
|
# We only support using the ICU runtime, or no runtime
|
|
|
|
# for Visual Studio builds
|
2018-04-24 12:51:04 +02:00
|
|
|
!if "$(CFG)" == "Release" || "$(CFG)" == "release"
|
|
|
|
ICUUC_LIB = icuuc.lib
|
|
|
|
!else
|
|
|
|
ICUUC_LIB = icuucd.lib
|
|
|
|
!endif
|
|
|
|
|
|
|
|
ICONV_LIB = iconv.lib
|
|
|
|
GETTEXT_LIB = intl.lib
|
|
|
|
|
|
|
|
# Please do not change anything beneath this line unless maintaining the NMake Makefiles
|
|
|
|
# Version info
|
|
|
|
|
|
|
|
PACKAGE_NAME=@PACKAGE_NAME@
|
|
|
|
PACKAGE_VERSION=@PACKAGE_VERSION@
|
|
|
|
PACKAGE_URL=@PACKAGE_URL@
|
|
|
|
|
|
|
|
# Bare minimum features and sources built into libpsl on Windows
|
|
|
|
|
|
|
|
!if "$(PLAT)" == "x64"
|
|
|
|
SSIZE_T_DEF = signed __int64
|
|
|
|
!else
|
|
|
|
SSIZE_T_DEF = signed int
|
|
|
|
!endif
|
|
|
|
|
|
|
|
PSL_ADDITIONAL_LIBS = ws2_32.lib
|
|
|
|
PSL_ADDITIONAL_CFLAGS = /DBUILDING_PSL
|
|
|
|
|
|
|
|
BASE_CFLAGS = \
|
|
|
|
$(CFLAGS) \
|
|
|
|
/D_CRT_SECURE_NO_WARNINGS \
|
|
|
|
/D_CRT_NONSTDC_NO_WARNINGS \
|
|
|
|
/DHAVE_CONFIG_H \
|
|
|
|
/Dssize_t="$(SSIZE_T_DEF)"
|
|
|
|
|
2019-10-30 10:50:48 +01:00
|
|
|
PSL_INCLUDES = /I..\include /I.. /Ivs$(VSVER)\$(CFG)\$(PLAT)\libpsl /I$(PREFIX)\include
|
2018-04-24 12:51:04 +02:00
|
|
|
|
|
|
|
# We build the psl.dll or psl.lib at least, with the psl.exe utility
|
2019-10-30 10:50:48 +01:00
|
|
|
PSL_LIB = vs$(VSVER)\$(CFG)\$(PLAT)\psl.lib
|
|
|
|
PSL_UTILS = vs$(VSVER)\$(CFG)\$(PLAT)\psl.exe
|
2018-04-24 12:51:04 +02:00
|
|
|
|
|
|
|
PSL_TESTS = \
|
2019-10-30 10:50:48 +01:00
|
|
|
vs$(VSVER)\$(CFG)\$(PLAT)\test-is-public.exe \
|
|
|
|
vs$(VSVER)\$(CFG)\$(PLAT)\test-is-public-all.exe \
|
|
|
|
vs$(VSVER)\$(CFG)\$(PLAT)\test-is-cookie-domain-acceptable.exe
|
2018-04-24 12:51:04 +02:00
|
|
|
|
|
|
|
PSL_TEST_DATA = \
|
2019-10-30 10:50:48 +01:00
|
|
|
vs$(VSVER)\$(CFG)\$(PLAT)\psl.dafsa \
|
|
|
|
vs$(VSVER)\$(CFG)\$(PLAT)\psl_ascii.dafsa
|
2018-04-24 12:51:04 +02:00
|
|
|
|
|
|
|
PSL_MAKE_OPTIONS = CFG^=$(CFG)
|
|
|
|
|
|
|
|
!ifndef STATIC
|
|
|
|
!ifdef USE_LIBTOOL_DLLNAME
|
|
|
|
PSL_DLL_PREFIX = lib
|
|
|
|
PSL_DLL_SUFFIX = -5
|
|
|
|
PSL_MAKE_OPTIONS = $(PSL_MAKE_OPTIONS) USE_LIBTOOL_DLLNAME^=$(USE_LIBTOOL_DLLNAME)
|
|
|
|
!else
|
|
|
|
PSL_DLL_PREFIX =
|
|
|
|
PSL_DLL_SUFFIX =
|
|
|
|
!endif
|
|
|
|
!endif
|
|
|
|
|
2019-10-30 10:50:48 +01:00
|
|
|
PSL_DLL = vs$(VSVER)\$(CFG)\$(PLAT)\$(PSL_DLL_PREFIX)psl$(PSL_DLL_SUFFIX).dll
|
2018-04-24 12:51:04 +02:00
|
|
|
|
2022-03-07 14:14:41 +01:00
|
|
|
# ENABLED_RUNTIME and ENABLE_BUILTIN are currently dummy arguments to NMake
|
2018-04-24 12:51:04 +02:00
|
|
|
ENABLED_RUNTIME =
|
2022-03-07 14:14:41 +01:00
|
|
|
ENABLE_BUILTIN =
|
2018-04-24 12:51:04 +02:00
|
|
|
|
|
|
|
!ifndef DISABLE_RUNTIME
|
|
|
|
BASE_CFLAGS = $(BASE_CFLAGS) /DWITH_LIBICU=1
|
|
|
|
ENABLED_RUNTIME = libicu
|
|
|
|
!else
|
|
|
|
PSL_MAKE_OPTIONS = $(PSL_MAKE_OPTIONS) DISABLE_RUNTIME^=1
|
|
|
|
ENABLED_RUNTIME = none
|
|
|
|
!endif
|
|
|
|
|
|
|
|
!ifndef DISABLE_BUILTIN
|
2022-03-07 14:14:41 +01:00
|
|
|
BASE_CFLAGS = $(BASE_CFLAGS) /DENABLE_BUILTIN=1
|
|
|
|
ENABLE_BUILTIN = yes
|
2018-04-24 12:51:04 +02:00
|
|
|
!else
|
|
|
|
PSL_MAKE_OPTIONS = $(PSL_MAKE_OPTIONS) DISABLE_BUILTIN^=1
|
2022-03-07 14:14:41 +01:00
|
|
|
ENABLE_BUILTIN = no
|
2018-04-24 12:51:04 +02:00
|
|
|
!endif
|
|
|
|
|
|
|
|
!ifdef STATIC
|
|
|
|
BASE_CFLAGS = $(BASE_CFLAGS) /DPSL_STATIC
|
|
|
|
PSL_MAKE_OPTIONS = $(PSL_MAKE_OPTIONS) STATIC^=1
|
|
|
|
PSL_LIBTYPE = static
|
|
|
|
!else
|
|
|
|
PSL_LIBTYPE = DLL
|
|
|
|
!endif
|
|
|
|
|
2022-03-07 14:14:41 +01:00
|
|
|
!if "$(DISABLE_RUNTIME)" == ""
|
2018-04-24 12:51:04 +02:00
|
|
|
PSL_ADDITIONAL_LIBS = $(PSL_ADDITIONAL_LIBS) $(ICUUC_LIB)
|
2022-03-07 14:14:41 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
!if "$(DISABLE_BUILTIN)" == ""
|
2018-04-24 12:51:04 +02:00
|
|
|
PSL_TESTS = \
|
|
|
|
$(PSL_TESTS) \
|
2019-10-30 10:50:48 +01:00
|
|
|
vs$(VSVER)\$(CFG)\$(PLAT)\test-is-public-builtin.exe \
|
|
|
|
vs$(VSVER)\$(CFG)\$(PLAT)\test-registrable-domain.exe
|
2018-04-24 12:51:04 +02:00
|
|
|
!endif
|
|
|
|
|
|
|
|
!ifdef USE_GETTEXT
|
|
|
|
USE_ICONV=1
|
|
|
|
PSL_ADDITIONAL_LIBS = $(PSL_ADDITIONAL_LIBS) $(GETTEXT_LIB)
|
|
|
|
BASE_CFLAGS = $(BASE_CFLAGS) /DUSE_GETTEXT=1
|
|
|
|
PSL_MAKE_OPTIONS = $(PSL_MAKE_OPTIONS) USE_GETTEXT^=1
|
|
|
|
!endif
|
|
|
|
|
|
|
|
!ifdef USE_ICONV
|
|
|
|
PSL_ADDITIONAL_LIBS = $(PSL_ADDITIONAL_LIBS) $(ICONV_LIB)
|
|
|
|
BASE_CFLAGS = $(BASE_CFLAGS) /DUSE_ICONV=1
|
|
|
|
PSL_MAKE_OPTIONS = $(PSL_MAKE_OPTIONS) USE_ICONV^=1
|
|
|
|
!endif
|
|
|
|
|
2019-10-30 08:26:02 +01:00
|
|
|
PSL_TEST_CFLAGS = \
|
|
|
|
$(BASE_CFLAGS) \
|
|
|
|
/DPSL_TESTFILE=\"$(PSL_TESTFILE_INPUT)\" \
|
|
|
|
/DPSL_FILE=\"$(PSL_FILE_INPUT)\" \
|
2019-10-30 10:50:48 +01:00
|
|
|
/DPSL_DAFSA=\"$(MAKEDIR:\=/)/vs$(VSVER)/$(CFG)/$(PLAT)/psl.dafsa\" \
|
|
|
|
/DPSL_ASCII_DAFSA=\"$(MAKEDIR:\=/)/vs$(VSVER)/$(CFG)/$(PLAT)/psl_ascii.dafsa\"
|
2018-04-24 12:51:04 +02:00
|
|
|
|
|
|
|
# Visual Studio 2013 or earlier does not have snprintf(),
|
|
|
|
# so use _snprintf() which seems to be enough for our purposes
|
|
|
|
!if $(VSVER) < 14
|
|
|
|
PSL_TEST_CFLAGS = $(PSL_TEST_CFLAGS) /Dsnprintf=_snprintf
|
|
|
|
!endif
|