• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NMake Makefile portion for enabling features for Windows builds
2
3# You may change these lines to customize various items
4
5!ifndef PSL_FILE
6PSL_FILE=..\list\public_suffix_list.dat
7!endif
8
9!ifndef PSL_TESTFILE
10PSL_TESTFILE=..\list\tests\tests.txt
11!endif
12
13PSL_FILE_INPUT = $(PSL_FILE:\=/)
14PSL_TESTFILE_INPUT = $(PSL_TESTFILE:\=/)
15
16# We only support using the ICU runtime and/or builtin, or no runtime
17# and/or builtin for Visual Studio builds
18!if "$(CFG)" == "Release" || "$(CFG)" == "release"
19ICUUC_LIB = icuuc.lib
20!else
21ICUUC_LIB = icuucd.lib
22!endif
23
24ICONV_LIB = iconv.lib
25GETTEXT_LIB = intl.lib
26
27# Please do not change anything beneath this line unless maintaining the NMake Makefiles
28# Version info
29
30PACKAGE_NAME=@PACKAGE_NAME@
31PACKAGE_VERSION=@PACKAGE_VERSION@
32PACKAGE_URL=@PACKAGE_URL@
33
34# Bare minimum features and sources built into libpsl on Windows
35
36!if "$(PLAT)" == "x64"
37SSIZE_T_DEF = signed __int64
38!else
39SSIZE_T_DEF = signed int
40!endif
41
42PSL_ADDITIONAL_LIBS = ws2_32.lib
43PSL_ADDITIONAL_CFLAGS = /DBUILDING_PSL
44
45BASE_CFLAGS =	\
46	$(CFLAGS)	\
47	/D_CRT_SECURE_NO_WARNINGS	\
48	/D_CRT_NONSTDC_NO_WARNINGS	\
49	/DHAVE_CONFIG_H				\
50	/Dssize_t="$(SSIZE_T_DEF)"
51
52PSL_INCLUDES = /I..\include /I.. /Ivs$(VSVER)\$(CFG)\$(PLAT)\libpsl /I$(PREFIX)\include
53
54# We build the psl.dll or psl.lib at least, with the psl.exe utility
55PSL_LIB = vs$(VSVER)\$(CFG)\$(PLAT)\psl.lib
56PSL_UTILS = vs$(VSVER)\$(CFG)\$(PLAT)\psl.exe
57
58PSL_TESTS =	\
59	vs$(VSVER)\$(CFG)\$(PLAT)\test-is-public.exe		\
60	vs$(VSVER)\$(CFG)\$(PLAT)\test-is-public-all.exe	\
61	vs$(VSVER)\$(CFG)\$(PLAT)\test-is-cookie-domain-acceptable.exe
62
63PSL_TEST_DATA =	\
64	vs$(VSVER)\$(CFG)\$(PLAT)\psl.dafsa	\
65	vs$(VSVER)\$(CFG)\$(PLAT)\psl_ascii.dafsa
66
67PSL_MAKE_OPTIONS = CFG^=$(CFG)
68
69!ifndef STATIC
70!ifdef USE_LIBTOOL_DLLNAME
71PSL_DLL_PREFIX = lib
72PSL_DLL_SUFFIX = -5
73PSL_MAKE_OPTIONS = $(PSL_MAKE_OPTIONS) USE_LIBTOOL_DLLNAME^=$(USE_LIBTOOL_DLLNAME)
74!else
75PSL_DLL_PREFIX =
76PSL_DLL_SUFFIX =
77!endif
78!endif
79
80PSL_DLL = vs$(VSVER)\$(CFG)\$(PLAT)\$(PSL_DLL_PREFIX)psl$(PSL_DLL_SUFFIX).dll
81
82# ENABLE_RUNTIME_ICU and ENABLE_BUILTIN_ICU are currently dummy arguments to NMake
83ENABLED_RUNTIME =
84ENABLED_BUILTIN =
85
86!ifndef DISABLE_RUNTIME
87BASE_CFLAGS = $(BASE_CFLAGS) /DWITH_LIBICU=1
88ENABLED_RUNTIME = libicu
89!else
90PSL_MAKE_OPTIONS = $(PSL_MAKE_OPTIONS) DISABLE_RUNTIME^=1
91ENABLED_RUNTIME = none
92!endif
93
94!ifndef DISABLE_BUILTIN
95BASE_CFLAGS = $(BASE_CFLAGS) /DBUILTIN_GENERATOR_LIBICU=1
96ENABLED_BUILTIN = libicu
97!else
98PSL_MAKE_OPTIONS = $(PSL_MAKE_OPTIONS) DISABLE_BUILTIN^=1
99ENABLED_BUILTIN = none
100!endif
101
102!ifdef STATIC
103BASE_CFLAGS = $(BASE_CFLAGS) /DPSL_STATIC
104PSL_MAKE_OPTIONS = $(PSL_MAKE_OPTIONS) STATIC^=1
105PSL_LIBTYPE = static
106!else
107PSL_LIBTYPE = DLL
108!endif
109
110!if "$(DISABLE_RUNTIME)" == "" || "$(DISABLE_BUILTIN)" == ""
111PSL_ADDITIONAL_LIBS = $(PSL_ADDITIONAL_LIBS) $(ICUUC_LIB)
112PSL_TESTS =	\
113	$(PSL_TESTS)	\
114	vs$(VSVER)\$(CFG)\$(PLAT)\test-is-public-builtin.exe	\
115	vs$(VSVER)\$(CFG)\$(PLAT)\test-registrable-domain.exe
116!endif
117
118!ifdef USE_GETTEXT
119USE_ICONV=1
120PSL_ADDITIONAL_LIBS = $(PSL_ADDITIONAL_LIBS) $(GETTEXT_LIB)
121BASE_CFLAGS = $(BASE_CFLAGS) /DUSE_GETTEXT=1
122PSL_MAKE_OPTIONS = $(PSL_MAKE_OPTIONS) USE_GETTEXT^=1
123!endif
124
125!ifdef USE_ICONV
126PSL_ADDITIONAL_LIBS = $(PSL_ADDITIONAL_LIBS) $(ICONV_LIB)
127BASE_CFLAGS = $(BASE_CFLAGS) /DUSE_ICONV=1
128PSL_MAKE_OPTIONS = $(PSL_MAKE_OPTIONS) USE_ICONV^=1
129!endif
130
131PSL_TEST_CFLAGS =	\
132	$(BASE_CFLAGS)	\
133	/DPSL_TESTFILE=\"$(PSL_TESTFILE_INPUT)\"	\
134	/DPSL_FILE=\"$(PSL_FILE_INPUT)\"	\
135	/DPSL_DAFSA=\"$(MAKEDIR:\=/)/vs$(VSVER)/$(CFG)/$(PLAT)/psl.dafsa\" 	\
136	/DPSL_ASCII_DAFSA=\"$(MAKEDIR:\=/)/vs$(VSVER)/$(CFG)/$(PLAT)/psl_ascii.dafsa\"
137
138# Visual Studio 2013 or earlier does not have snprintf(),
139# so use _snprintf() which seems to be enough for our purposes
140!if $(VSVER) < 14
141PSL_TEST_CFLAGS = $(PSL_TEST_CFLAGS) /Dsnprintf=_snprintf
142!endif
143