5 PROGRAM_NAME ?
= bin
/vlmcsd
6 CLIENT_NAME ?
= bin
/vlmcs
7 MULTI_NAME ?
= bin
/vlmcsdmulti
8 OBJ_NAME ?
= build
/libkms-static.o
11 BASE_PROGRAM_NAME
=$(notdir $(PROGRAM_NAME
))
12 BASE_CLIENT_NAME
=$(notdir $(CLIENT_NAME
))
13 BASE_MULTI_NAME
=$(notdir $(MULTI_NAME
))
14 BASE_DLL_NAME
=$(notdir $(DLL_NAME
))
15 BASE_A_NAME
=$(notdir $(A_NAME
))
17 TARGETPLATFORM
:= $(shell LANG
=en_US.UTF-8
$(CC
) -v
2>&1 | grep
'^Target: ' | cut
-f
2 -d
' ')
19 ifneq (,$(findstring darwin
,$(TARGETPLATFORM
)))
24 ifneq (,$(findstring android
,$(TARGETPLATFORM
)))
30 ifneq (,$(findstring minix
,$(TARGETPLATFORM
)))
36 ifneq (,$(findstring mingw
,$(TARGETPLATFORM
)))
42 ifneq (,$(findstring cygwin
,$(TARGETPLATFORM
)))
48 ifneq (,$(findstring cygnus
,$(TARGETPLATFORM
)))
54 ifneq (,$(findstring freebsd
,$(TARGETPLATFORM
)))
61 ifneq (,$(findstring netbsd
,$(TARGETPLATFORM
)))
68 ifneq (,$(findstring openbsd
,$(TARGETPLATFORM
)))
75 ifneq (,$(findstring solaris
,$(TARGETPLATFORM
)))
81 ifneq (,$(findstring linux
,$(TARGETPLATFORM
)))
87 ifneq (,$(findstring gnu
,$(TARGETPLATFORM
)))
88 ifeq (,$(findstring linux
,$(TARGETPLATFORM
)))
96 DLL_NAME ?
= lib
/cygkms.dll
98 DLL_NAME ?
= lib
/libkms.dll
99 else ifeq ($(DARWIN
),1)
100 DLL_NAME ?
= lib
/libkms.dylib
102 DLL_NAME ?
= lib
/libkms.so
106 +@
(test -d bin || mkdir bin
) & (test -d lib || mkdir lib
) & (test -d build || mkdir build
)
107 +@
$(MAKE
) -j
$(MAX_THREADS
) -C src
$@ FROM_PARENT
=1 PROGRAM_NAME
=$(PROGRAM_NAME
) CLIENT_NAME
=$(CLIENT_NAME
) MULTI_NAME
=$(MULTI_NAME
) DLL_NAME
=$(DLL_NAME
) A_NAME
=$(A_NAME
)
110 +@
(test -d bin || mkdir bin
) & (test -d lib || mkdir lib
) & (test -d build || mkdir build
)
111 +@
$(MAKE
) -j
$(MAX_THREADS
) -C src
$@ FROM_PARENT
=1 PROGRAM_NAME
=$(PROGRAM_NAME
) CLIENT_NAME
=$(CLIENT_NAME
) MULTI_NAME
=$(MULTI_NAME
) DLL_NAME
=$(DLL_NAME
) A_NAME
=$(A_NAME
)
114 +@
$(MAKE
) -j
$(MAX_THREADS
) -C src
$@ FROM_PARENT
=1 PROGRAM_NAME
=$(PROGRAM_NAME
) CLIENT_NAME
=$(CLIENT_NAME
) MULTI_NAME
=$(MULTI_NAME
) DLL_NAME
=$(DLL_NAME
) A_NAME
=$(A_NAME
)
115 +@
$(MAKE
) -j
$(MAX_THREADS
) -C man
$@
118 +@
$(MAKE
) -j
$(MAX_THREADS
) -C man
$@
121 +@
$(MAKE
) -j
$(MAX_THREADS
) -C man
$@
124 +@
$(MAKE
) -j
$(MAX_THREADS
) -C man
$@
127 +@
$(MAKE
) -j
$(MAX_THREADS
) -C man
$@
130 +@
$(MAKE
) -j
$(MAX_THREADS
) -C man
$@
136 @echo
" ${MAKE} - to build $(BASE_PROGRAM_NAME) and $(BASE_CLIENT_NAME)"
137 @echo
" ${MAKE} clean - to remove all targets and temporary files"
138 @echo
" ${MAKE} pdfdocs - Create PDF versions of the documentation (Requires groff with PDF support)."
139 @echo
" ${MAKE} htmldocs - Create HTML versions of the documentation."
140 @echo
" ${MAKE} unixdocs - Create Unix TXT versions of the documentation."
141 @echo
" ${MAKE} dosdocs - Create DOS/Windows TXT versions of the documentation."
142 @echo
" ${MAKE} alldocs - Create all versions of the documentation."
143 @echo
" ${MAKE} vlmcsd - to build KMS server $(PROGRAM_NAME)"
144 @echo
" ${MAKE} vlmcs - to build KMS client $(CLIENT_NAME)"
145 @echo
" ${MAKE} vlmcsdmulti - to build $(BASE_PROGRAM_NAME) and $(BASE_CLIENT_NAME) in a single multi-call binary $(MULTI_NAME)"
146 @echo
" ${MAKE} libkms - to build the shared library $(DLL_NAME)"
147 @echo
" ${MAKE} libkms-static - to build the static library $(A_NAME)"
150 @echo
" CONFIG=<x> Compile <x> as instead of config.h."
151 @echo
" INI=<x> Compile $(BASE_PROGRAM_NAME) with default ini file <x>"
152 @echo
" PROGRAM_NAME=<x> Use <x> as output file name for the KMS server. Defaults to vlmcsd."
153 @echo
" CLIENT_NAME=<x> Use <x> as output file name for the KMS client. Defaults to vlmcs."
154 @echo
" MULTI_NAME=<x> Use <x> as output file name for the multi-call binary. Defaults to vlmcsdmulti."
155 @echo
" DEPENDENCIES=1 Create dependency files."
156 @echo
" CRYPTO=openssl Use openssl for SHA256/HMAC calculations."
157 @echo
" CRYPTO=openssl_with_aes EXPERIMENTAL: Use openssl for SHA256/HMAC and AES calculations (hardware, e.g. AES-NI on x86)."
158 @echo
" CRYPTO=openssl_with_aes_soft EXPERIMENTAL: Use openssl for SHA256/HMAC and AES calculations (software)."
159 @echo
" CRYPTO=polarssl Use polarssl instead of internal crypto code for SHA256/HMAC calculations."
160 @echo
" CRYPTO=windows Use Windows CryptoAPI instead of internal crypto code for SHA256/HMAC calculations."
161 @echo
" MSRPC=1 Use Microsoft RPC instead of vlmcsd's internal RPC. Only works with Windows and Cygwin targets."
162 @echo
" CC=<x> Use compiler <x>. Supported compilers are gcc, icc, tcc and clang. Others may or may not work."
163 @echo
" AR=<x> Use <x> instead of ar to build $(BASE_A_NAME). Set to gcc-ar if you want to use gcc's LTO feature."
164 @echo
" COMPILER_LANGUAGE=<x> May be c or c++."
165 @echo
" TERMINAL_WIDTH=<x> Assume a fixed terminal width of <x> columns. Use in case of problems only."
166 @echo
" VLMCSD_VERSION=<x> Sets <x> as your version identifier. Defaults to \"private build\"."
167 @echo
" CFLAGS=<x> Pass <x> as additional arguments to the compiler."
168 @echo
" LDFLAGS=<x> Pass <x> as additional arguments to the linker."
169 @echo
" PLATFORMFLAGS=<x> Pass <x> as additional arguments to the compiler and the linker."
170 @echo
" BASECFLAGS=<x> Pass only <x> as arguments to the compiler (advanced users only)."
171 @echo
" BASELDFLAGS=<x> Pass only <x> as arguments to the linker (advanced users only)."
172 @echo
" STRIP=0 Don't strip debug information from $(BASE_PROGRAM_NAME) and $(BASE_CLIENT_NAME) (for developers)."
173 @echo
" VERBOSE=1 Be verbose when making targets."
174 @echo
" VERBOSE=3 Show name of compiler."
175 @echo
" THREADS=1 Use threads instead of fork(). Automatically set for native Windows. Recommended for Cygwin."
176 @echo
" WINDOWS=<x> Use <x> as the default ePID for Windows (when using $(BASE_PROGRAM_NAME) with -r 0)."
177 @echo
" OFFICE2010=<x> Use <x> as the default ePID for Office2010 (when using $(BASE_PROGRAM_NAME) with -r 0)."
178 @echo
" OFFICE2013=<x> Use <x> as the default ePID for Office2013 (when using $(BASE_PROGRAM_NAME) with -r 0)."
179 @echo
" OFFICE2016=<x> Use <x> as the default ePID for Office2016 (when using $(BASE_PROGRAM_NAME) with -r 0)."
180 @echo
" HWID=<x> Use <x> as the default HWID (when it can't be found in an ini file)."
181 @echo
" FEATURES=full Compile $(BASE_PROGRAM_NAME) with all features (default)."
182 @echo
" FEATURES=most Compile $(BASE_PROGRAM_NAME) without rarely used features."
183 @echo
" FEATURES=embedded Compile $(BASE_PROGRAM_NAME) with typical features for embedded systems."
184 @echo
" FEATURES=autostart Removes features typically not needed if you place $(BASE_PROGRAM_NAME) in an autostart script."
185 @echo
" FEATURES=inetd Compile $(BASE_PROGRAM_NAME) for running through an internet superserver only."
186 @echo
" FEATURES=minimum Compiles only basic features of $(BASE_PROGRAM_NAME)."
187 @echo
" FEATURES=fixedepids $(BASE_PROGRAM_NAME) only uses bultin internal ePIDs."
189 @echo
"Useful CFLAGS to save memory when running $(BASE_PROGRAM_NAME) on very small embedded devices (finer control than FEATURES=)"
190 @echo
" -DNO_EXTENDED_PRODUCT_LIST Don't compile the detailed product list."
191 @echo
" -DNO_BASIC_PRODUCT_LIST Don't compile the basic product list."
192 @echo
" -DNO_STRICT_MODES Don't support enhanced emulator detection prevention."
193 @echo
" -DNO_CLIENT_LIST Don't support maintaining a client list (CMIDs)."
194 @echo
" -DNO_VERBOSE_LOG Don't support verbose logging. Removes -v option."
195 @echo
" -DNO_LOG Don't add support for logging. Implies -DNO_VERBOSE_LOG -DNO_EXTENDED_PRODUCT_LIST and -DNO_BASIC_PRODUCT_LIST."
196 @echo
" -DNO_RANDOM_EPID Don't support random ePIDs."
197 @echo
" -DNO_INI_FILE Don't support reading ePIDs/HWIDs from a file."
198 @echo
" -DNO_PID_FILE Don't support writing a PID file. Removes -p option."
199 @echo
" -DNO_USER_SWITCH Don't support changing uid/gid after program start. Removes -u and -g options."
200 @echo
" -DNO_HELP Don't support command line help."
201 @echo
" -DNO_CUSTOM_INTERVALS Don't support custom intervals for retry and refresh activation. Removes -A and -R options."
202 @echo
" -DNO_FREEBIND Don't support binding to foreign IP addresses. Removes -F0 and -F1 options. Only affects FreeBSD and Linux."
203 @echo
" -DNO_SOCKETS Don't support standalone operation. Requires an internet superserver to start $(BASE_PROGRAM_NAME)."
204 @echo
" -DSIMPLE_SOCKETS Don't support listening on explicit IP addresses. Always listens on all IP addresses."
205 @echo
" -DSIMPLE_RPC Don't support RPC with NDR64 and BTFN in $(BASE_PROGRAM_NAME) (but do in $(BASE_CLIENT_NAME)). Makes emulator detection easy."
206 @echo
" -DNO_CL_PIDS Don't support specifying ePIDs and HwId from the command line in $(BASE_PROGRAM_NAME)."
207 @echo
" -DNO_LIMIT Don't support limiting concurrent clients in $(BASE_PROGRAM_NAME)."
208 @echo
" -DNO_SIGHUP Don't support SIGHUP handling in $(BASE_PROGRAM_NAME)."
209 @echo
" -DNO_VERSION_INFORMATION Don't support displaying version information in $(BASE_PROGRAM_NAME) and $(BASE_CLIENT_NAME). Removes -V option."
210 @echo
" -DNO_PRIVATE_IP_DETECT Don't support protection against clients with public IP addresses in $(BASE_PROGRAM_NAME)"
211 @echo
" -DSIMPLE_SOCKETS Compile $(BASE_PROGRAM_NAME) with basic socket support only. Removes -L option."
212 @echo
" -DSMALL_AES Use a smaller (saves about 200 bytes) but slower implementation of AES."
214 @echo
"Troubleshooting options"
215 @echo
" CAT=1 Combine all sources in a single in-memory file and compile directly to target."
216 @echo
" NOPROCFS=1 Don't rely on a properly mounted proc filesystem in /proc."
217 @echo
" AUXV=1 Use /proc/self/auxv (requires Linux with glibc >= 2.16 or musl.)"
218 @echo
" NOLPTHREAD=1 Disable detection if -lpthread is required (for use with Android NDK)."
219 @echo
" NOLRESOLV=1 Disable detection if -lresolv is required (for use with Android NDK)."
220 @echo
" NOLIBS=1 Do not attempt to autodetect any library dependencies."
221 @echo
" OPENSSL_HMAC=0 Compile for openssl versions that don't have HMAC support (required on some embedded devices)."
222 @echo
" NO_TIMEOUT=1 Do not set timeouts for sockets (for systems that don't support it)."
223 @echo
" CHILD_HANDLER=1 Install a handler for SIGCHLD (for systems that don't support SA_NOCLDWAIT)."
224 @echo
" NO_DNS=1 Compile $(BASE_CLIENT_NAME) without support for detecting KMS servers via DNS."
225 @echo
" NO_GETIFADDRS=1 Compile $(BASE_PROGRAM_NAME) without using getifaddrs()."
226 @echo
" GETIFADDRS=musl Compile $(BASE_PROGRAM_NAME) with its own implementation of getifaddrs() based on musl."
227 @echo
" DNS_PARSER=internal Use $(BASE_CLIENT_NAME) internal DNS parsing routines. No effect on MingW (native Windows)."
229 @echo
"Other useful CFLAGS"
230 @echo
" -DSUPPORT_WINE Add code that the Windows version of $(BASE_PROGRAM_NAME) runs on Wine if MSRPC=1"
231 @echo
" -D_PEDANTIC Report rare error/warning conditions instead of silently ignoring them."
232 @echo
" -DINCLUDE_BETAS Include SKU / activation IDs for obsolete beta/preview products."
233 @echo
" -DFD_SETSIZE=<x> Allow <x> -L statements in $(BASE_PROGRAM_NAME) (default: 64 on Windows, 1024 on most Unixes)."