GNUmakefile 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. ################################################################################
  2. .PHONY: clean
  3. PROGRAM_NAME ?= vlmcsd
  4. CLIENT_NAME ?= vlmcs
  5. MULTI_NAME ?= vlmcsdmulti
  6. CONFIG ?= config.h
  7. # crypto library to use for standard algos, could save ~1-2kb ;)
  8. # can be either 'openssl', 'polarssl' or anything other for internal impl
  9. CRYPTO ?= internal
  10. # use DNS_PARSER=internal if your OS doesn't supply the DNS parser routines
  11. DNS_PARSER ?= OS
  12. # You should supply your own version string here
  13. VLMCSD_VERSION ?= $(shell test -d .svn && echo svn`svnversion`)
  14. FEATURES ?= full
  15. VERBOSE ?= NO
  16. ################################################################################
  17. CC ?= gcc
  18. TARGETPLATFORM := $(shell LANG=en_US.UTF-8 $(CC) -v 2>&1 | grep '^Target: ' | cut -f 2 -d ' ')
  19. ifneq (,$(findstring darwin,$(TARGETPLATFORM)))
  20. DARWIN := 1
  21. UNIX := 1
  22. endif
  23. ifneq (,$(findstring androideabi,$(TARGETPLATFORM)))
  24. ANDROID := 1
  25. UNIX := 1
  26. endif
  27. ifneq (,$(findstring minix,$(TARGETPLATFORM)))
  28. MINIX := 1
  29. UNIX := 1
  30. endif
  31. ifneq (,$(findstring mingw,$(TARGETPLATFORM)))
  32. MINGW := 1
  33. WIN := 1
  34. endif
  35. ifneq (,$(findstring cygwin,$(TARGETPLATFORM)))
  36. CYGWIN := 1
  37. WIN := 1
  38. endif
  39. ifneq (,$(findstring freebsd,$(TARGETPLATFORM)))
  40. FREEBSD := 1
  41. UNIX := 1
  42. BSD := 1
  43. endif
  44. ifneq (,$(findstring netbsd,$(TARGETPLATFORM)))
  45. NETBSD := 1
  46. UNIX := 1
  47. BSD := 1
  48. endif
  49. ifneq (,$(findstring openbsd,$(TARGETPLATFORM)))
  50. OPENBSD := 1
  51. UNIX := 1
  52. BSD := 1
  53. endif
  54. ifneq (,$(findstring solaris,$(TARGETPLATFORM)))
  55. SOLARIS := 1
  56. UNIX := 1
  57. endif
  58. ifneq (,$(findstring linux,$(TARGETPLATFORM)))
  59. LINUX := 1
  60. UNIX := 1
  61. endif
  62. ifeq ($(CYGWIN),1)
  63. DLL_NAME ?= cygkms.dll
  64. else ifeq ($(WIN),1)
  65. DLL_NAME ?= libkms.dll
  66. else ifeq ($(DARWIN),1)
  67. DLL_NAME ?= libkms.dylib
  68. else
  69. DLL_NAME ?= libkms.so
  70. endif
  71. BASECFLAGS = -DCONFIG=\"$(CONFIG)\" -DBUILD_TIME=$(shell date '+%s') -g -Os -fno-strict-aliasing -fomit-frame-pointer -ffunction-sections -fdata-sections
  72. BASELDFLAGS =
  73. STRIPFLAGS =
  74. CLIENTLDFLAGS =
  75. SERVERLDFLAGS =
  76. ifeq ($(NOLIBS),1)
  77. NOLRESOLV=1
  78. NOLPTHREAD=1
  79. endif
  80. ifneq ($(NO_DNS),1)
  81. ifneq ($(ANDROID),1)
  82. ifneq ($(NOLRESOLV),1)
  83. ifeq ($(MINGW),1)
  84. BASELDFLAGS += -ldnsapi
  85. endif
  86. ifeq ($(LINUX),1)
  87. BASELDFLAGS += -lresolv
  88. endif
  89. ifeq ($(DARWIN),1)
  90. BASELDFLAGS += -lresolv
  91. endif
  92. ifeq ($(CYGWIN),1)
  93. DNS_PARSER := internal
  94. BASELDFLAGS += -lresolv
  95. endif
  96. ifeq ($(OPENBSD),1)
  97. DNS_PARSER := internal
  98. endif
  99. ifeq ($(SOLARIS),1)
  100. BASELDFLAGS += -lresolv
  101. endif
  102. endif
  103. endif
  104. else
  105. BASECFLAGS += -DNO_DNS
  106. endif
  107. ifneq ($(CAT),2)
  108. BASECFLAGS += "-Wall"
  109. endif
  110. ifeq ($(DARWIN), 1)
  111. STRIPFLAGS += -Wl,-S -Wl,-x
  112. BASECFLAGS += -Wno-deprecated-declarations
  113. else ifeq ($(shell uname), SunOS)
  114. STRIPFLAGS += -s
  115. ifeq ($(notdir $(LD_ALTEXEC)),gld)
  116. BASELDFLAGS += -Wl,--gc-sections
  117. endif
  118. BASELDFLAGS += -lsocket
  119. else
  120. ifneq ($(CC),tcc)
  121. BASELDFLAGS += -Wl,--gc-sections
  122. endif
  123. STRIPFLAGS += -s
  124. endif
  125. ifeq ($(FEATURES), embedded)
  126. BASECFLAGS += -DNO_HELP -DNO_USER_SWITCH -DNO_BASIC_PRODUCT_LIST -DNO_CUSTOM_INTERVALS -DNO_PID_FILE -DNO_VERBOSE_LOG
  127. else ifeq ($(FEATURES), autostart)
  128. BASECFLAGS += -DNO_HELP
  129. else ifeq ($(FEATURES), minimum)
  130. BASECFLAGS += -DNO_TIMEOUT -DNO_SIGHUP -DNO_CL_PIDS -DNO_EXTENDED_PRODUCT_LIST -DNO_BASIC_PRODUCT_LIST -DNO_LOG -DNO_RANDOM_EPID -DNO_INI_FILE -DNO_INI_FILE -DNO_HELP -DNO_CUSTOM_INTERVALS -DNO_PID_FILE -DNO_USER_SWITCH -DNO_VERBOSE_LOG -DNO_LIMIT
  131. else ifeq ($(FEATURES), most)
  132. BASECFLAGS += -DNO_SIGHUP -DNO_PID_FILE -DNO_LIMIT
  133. else ifeq ($(FEATURES), inetd)
  134. BASECFLAGS += -DNO_SIGHUP -DNO_SOCKETS -DNO_PID_FILE -DNO_LIMIT
  135. else ifeq ($(FEATURES), fixedepids)
  136. BASECFLAGS += -DNO_SIGHUP -DNO_CL_PIDS -DNO_RANDOM_EPID -DNO_INI_FILE
  137. endif
  138. ifdef INI
  139. BASECFLAGS += -DINI_FILE=\"$(INI)\"
  140. endif
  141. ifeq ($(THREADS), 1)
  142. BASECFLAGS += -DUSE_THREADS
  143. endif
  144. ifeq ($(CHILD_HANDLER), 1)
  145. BASECFLAGS += -DCHILD_HANDLER
  146. endif
  147. ifeq ($(NO_TIMEOUT), 1)
  148. BASECFLAGS += -DNO_TIMEOUT
  149. endif
  150. ifdef WINDOWS
  151. BASECFLAGS += -DEPID_WINDOWS=\"$(WINDOWS)\"
  152. endif
  153. ifdef OFFICE2010
  154. BASECFLAGS += -DEPID_OFFICE2010=\"$(OFFICE2010)\"
  155. endif
  156. ifdef OFFICE2013
  157. BASECFLAGS += -DEPID_OFFICE2013=\"$(OFFICE2013)\"
  158. endif
  159. ifdef HWID
  160. BASECFLAGS += -DHWID=$(HWID)
  161. endif
  162. ifdef TERMINAL_WIDTH
  163. BASECFLAGS += -DTERMINAL_FIXED_WIDTH=$(TERMINAL_WIDTH)
  164. endif
  165. ifeq ($(NOPROCFS), 1)
  166. BASECFLAGS += -DNO_PROCFS
  167. endif
  168. ifeq ($(AUXV), 1)
  169. BASECFLAGS += -DUSE_AUXV
  170. endif
  171. ifneq ($(ANDROID), 1)
  172. ifneq ($(MINIX), 1)
  173. ifneq ($(NOLPTHREAD), 1)
  174. ifeq ($(findstring NO_LIMIT,$(CFLAGS) $(BASECFLAGS)),)
  175. BASELDFLAGS += -lpthread
  176. endif
  177. ifneq ($(findstring USE_THREADS,$(BASECFLAGS)),)
  178. BASELDFLAGS += -lpthread
  179. endif
  180. endif
  181. endif
  182. endif
  183. $(MULTI_NAME): BASECFLAGS += -DMULTI_CALL_BINARY=1
  184. all: $(CLIENT_NAME) $(PROGRAM_NAME)
  185. ifdef CAT
  186. allmulti: $(CLIENT_NAME) $(PROGRAM_NAME) $(MULTI_NAME)
  187. endif
  188. ifneq ($(strip $(VLMCSD_VERSION)),)
  189. BASECFLAGS += -DVERSION=\"$(VLMCSD_VERSION),\ built\ $(shell date -u '+%Y-%m-%d %H:%M:%S' | sed -e 's/ /\\ /g')\ UTC\"
  190. endif
  191. ifdef CAT
  192. BASECFLAGS += -DONE_FILE
  193. endif
  194. SRCS = crypto.c kms.c endian.c output.c shared_globals.c helpers.c
  195. HEADERS = $(CONFIG) types.h rpc.h vlmcsd.h endian.h crypto.h kms.h network.h output.h shared_globals.h vlmcs.h helpers.h
  196. DEPS = $(MULTI_SRCS:.c=.d)
  197. VLMCSD_SRCS = vlmcsd.c $(SRCS)
  198. VLMCSD_OBJS = $(VLMCSD_SRCS:.c=.o)
  199. VLMCS_SRCS = vlmcs.c $(SRCS)
  200. VLMCS_OBJS = $(VLMCS_SRCS:.c=.o)
  201. MULTI_SRCS = vlmcsd.c vlmcs.c vlmcsdmulti.c $(SRCS)
  202. MULTI_OBJS = $(MULTI_SRCS:.c=.o)
  203. DLL_SRCS = libkms.c $(SRCS)
  204. DLL_OBJS = $(DLL_SRCS:.c=.o)
  205. PDFDOCS = vlmcs.1.pdf vlmcsd.7.pdf vlmcsd.8.pdf vlmcsdmulti.1.pdf vlmcsd.ini.5.pdf
  206. HTMLDOCS = $(PDFDOCS:.pdf=.html)
  207. UNIXDOCS = $(PDFDOCS:.pdf=.unix.txt)
  208. DOSDOCS = $(PDFDOCS:.pdf=.dos.txt)
  209. ifneq ($(NO_DNS),1)
  210. VLMCS_SRCS += dns_srv.c
  211. MULTI_SRCS += dns_srv.c
  212. ifeq ($(DNS_PARSER),internal)
  213. ifneq ($(MINGW),1)
  214. VLMCS_SRCS += ns_parse.c ns_name.c
  215. MULTI_SRCS += ns_parse.c ns_name.c
  216. BASECFLAGS += "-DDNS_PARSER_INTERNAL"
  217. endif
  218. endif
  219. endif
  220. ifeq ($(MSRPC),1)
  221. VLMCSD_SRCS += msrpc-server.c
  222. VLMCS_SRCS += msrpc-client.c
  223. MULTI_SRCS += msrpc-server.c msrpc-client.c
  224. BASECFLAGS += -DUSE_MSRPC -Wno-unknown-pragmas
  225. BASELDFLAGS += -lrpcrt4
  226. else
  227. SRCS += network.c rpc.c
  228. endif
  229. ifeq "$(WIN)" "1"
  230. VLMCSD_SRCS += ntservice.c
  231. MULTI_SRCS += ntservice.c
  232. endif
  233. ifeq ($(CRYPTO), openssl_with_aes)
  234. BASECFLAGS += -D_CRYPTO_OPENSSL -D_USE_AES_FROM_OPENSSL
  235. BASELDFLAGS += -lcrypto
  236. SRCS += crypto_openssl.c
  237. else ifeq ($(CRYPTO), openssl_with_aes_soft)
  238. BASECFLAGS += -D_CRYPTO_OPENSSL -D_USE_AES_FROM_OPENSSL -D_OPENSSL_SOFTWARE
  239. BASELDFLAGS += -lcrypto
  240. SRCS += crypto_openssl.c
  241. else ifeq ($(CRYPTO), openssl)
  242. BASECFLAGS += -D_CRYPTO_OPENSSL
  243. BASELDFLAGS += -lcrypto
  244. SRCS += crypto_openssl.c
  245. else ifeq ($(CRYPTO), polarssl)
  246. BASECFLAGS += -D_CRYPTO_POLARSSL
  247. BASELDFLAGS += -lpolarssl
  248. else ifeq ($(CRYPTO), windows)
  249. BASECFLAGS += -D_CRYPTO_WINDOWS
  250. SRCS += crypto_windows.c
  251. #BASELDFLAGS += -lpolarssl
  252. else
  253. BASECFLAGS += -D_CRYPTO_INTERNAL
  254. SRCS += crypto_internal.c
  255. endif
  256. ifneq ($(STRIP),0)
  257. BASELDFLAGS += $(STRIPFLAGS)
  258. endif
  259. ifeq ($(OPENSSL_HMAC),0)
  260. BASECFLAGS += -D_OPENSSL_NO_HMAC
  261. endif
  262. ifeq ($(DEPENDENCIES),2)
  263. BASECFLAGS += -MMD
  264. endif
  265. ifeq ($(VERBOSE),3)
  266. COMPILER := $(shell printf "%-40s" $(notdir $(CC)))
  267. endif
  268. ifeq ($(CAT),2)
  269. LDCMD := CC/LD
  270. else
  271. LDCMD := LD
  272. endif
  273. -include $(MULTI_SRCS:.c=.d)
  274. %.o: %.c
  275. ifeq ($(VERBOSE),1)
  276. $(CC) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -c $<
  277. ifeq ($(DEPENDENCIES),1)
  278. $(CC) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $<
  279. endif
  280. else
  281. @echo "$(COMPILER) CC $@ <- $<"
  282. @$(CC) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -c $<
  283. ifeq ($(DEPENDENCIES),1)
  284. @echo "$(COMPILER) DEP $*.d <- $<"
  285. @$(CC) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $<
  286. endif
  287. endif
  288. vlmcsd_all.c: $(VLMCSD_SRCS)
  289. ifeq ($(VERBOSE),1)
  290. cat $^ > $@
  291. else
  292. @echo "$(COMPILER) CAT $@ <- $^"
  293. @cat $^ > $@
  294. endif
  295. vlmcs_all.c: $(VLMCS_SRCS)
  296. ifeq ($(VERBOSE),1)
  297. cat $^ > $@
  298. else
  299. @echo "$(COMPILER) CAT $@ <- $^"
  300. @cat $^ > $@
  301. endif
  302. vlmcsdmulti_all.c: $(MULTI_SRCS)
  303. ifeq ($(VERBOSE),1)
  304. cat $^ > $@
  305. else
  306. @echo "$(COMPILER) CAT $@ <- $^"
  307. @cat $^ > $@
  308. endif
  309. ifdef CAT
  310. ifeq ($(CAT),2)
  311. $(PROGRAM_NAME): vlmcsd_all.c
  312. else
  313. $(PROGRAM_NAME): vlmcsd_all.o
  314. endif
  315. else
  316. $(PROGRAM_NAME): $(VLMCSD_OBJS)
  317. endif
  318. ifeq ($(VERBOSE),1)
  319. +$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS)
  320. else
  321. +@echo "$(COMPILER) $(LDCMD) $@ <- $^"
  322. +@$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS)
  323. endif
  324. ifdef CAT
  325. ifeq ($(CAT),2)
  326. $(CLIENT_NAME): vlmcs_all.c
  327. else
  328. $(CLIENT_NAME): vlmcs_all.o
  329. endif
  330. else
  331. $(CLIENT_NAME): $(VLMCS_OBJS)
  332. endif
  333. ifeq ($(VERBOSE),1)
  334. +$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS)
  335. else
  336. +@echo "$(COMPILER) $(LDCMD) $@ <- $^"
  337. +@$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS)
  338. endif
  339. ifdef CAT
  340. ifeq ($(CAT),2)
  341. $(MULTI_NAME): vlmcsdmulti_all.c
  342. else
  343. $(MULTI_NAME): vlmcsdmulti_all.o
  344. endif
  345. else
  346. $(MULTI_NAME): $(MULTI_OBJS)
  347. endif
  348. ifeq ($(VERBOSE),1)
  349. +$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS)
  350. else
  351. +@echo "$(COMPILER) $(LDCMD) $@ <- $^"
  352. +@$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS)
  353. endif
  354. $(DLL_NAME): $(DLL_SRCS)
  355. ifeq ($(VERBOSE),1)
  356. +$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) -shared -DIS_LIBRARY=1 -UNO_SOCKETS -UUSE_MSRPC
  357. else
  358. +@echo "$(COMPILER) $(LDCMD) $@ <- $^"
  359. +@$(CC) -o $@ $^ $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(BASELDFLAGS) $(LDFLAGS) -shared -DIS_LIBRARY=1 -UNO_SOCKETS -UUSE_MSRPC
  360. endif
  361. %.pdf : %
  362. ifeq ($(shell uname), Darwin)
  363. groff -Tps -mandoc -c $< | pstopdf -i -o $@
  364. else
  365. groff -Tpdf -mandoc -c $< > $@
  366. endif
  367. %.html : %
  368. groff -Thtml -mandoc -c $< > $@
  369. %.unix.txt : %
  370. groff -P -c -Tutf8 -mandoc -c $< | col -bx > $@
  371. %.dos.txt : %.unix.txt
  372. # unix2dos -n $< $@
  373. # sed -e 's/$$/\r/' $< > $@
  374. awk 'sub("$$", "\r")' $< > $@
  375. pdfdocs : $(PDFDOCS)
  376. dosdocs : $(DOSDOCS)
  377. unixdocs : $(UNIXDOCS)
  378. htmldocs : $(HTMLDOCS)
  379. alldocs : $(UNIXDOCS) $(HTMLDOCS) $(PDFDOCS) $(DOSDOCS)
  380. clean:
  381. rm -f *.o *.d *_all.c $(PROGRAM_NAME) $(MULTI_NAME) $(DLL_NAME) $(CLIENT_NAME) $(PDFDOCS) $(DOSDOCS) $(UNIXDOCS) $(HTMLDOCS)
  382. help:
  383. @echo "Type:"
  384. @echo " ${MAKE} - to build $(PROGRAM_NAME) and $(CLIENT_NAME)"
  385. @echo " ${MAKE} clean - to remove $(PROGRAM_NAME) and $(CLIENT_NAME)"
  386. @echo " ${MAKE} help - to see this help"
  387. @echo " ${MAKE} pdfdocs - Create PDF versions of the documentation (Requires groff with PDF support)."
  388. @echo " ${MAKE} htmldocs - Create HTML versions of the documentation."
  389. @echo " ${MAKE} unixdocs - Create Unix TXT versions of the documentation."
  390. @echo " ${MAKE} dosdocs - Create DOS/Windows TXT versions of the documentation."
  391. @echo " ${MAKE} alldocs - Create all versions of the documentation."
  392. @echo " ${MAKE} -j <x> - Use <x> parallel tasks (SMP support) when compiling $(PROGRAM_NAME) and $(CLIENT_NAME)"
  393. @echo ""
  394. @echo " ${MAKE} $(PROGRAM_NAME) - to build the server only."
  395. @echo " ${MAKE} $(CLIENT_NAME) - to build the client only."
  396. @echo " ${MAKE} $(MULTI_NAME) - to build $(PROGRAM_NAME) and $(CLIENT_NAME) in a single multi-call binary"
  397. @echo " ${MAKE} $(DLL_NAME) - to build the shared library $(DLL_NAME)"
  398. @echo ""
  399. @echo "Options:"
  400. @echo " CONFIG=<x> Compile <x> as instead of config.h."
  401. @echo " INI=<x> Compile $(PROGRAM_NAME) with default ini file <x>"
  402. @echo " PROGRAM_NAME=<x> Use <x> as output file name for the KMS server. Defaults to vlmcsd."
  403. @echo " CLIENT_NAME=<x> Use <x> as output file name for the KMS client. Defaults to vlmcs."
  404. @echo " MULTI_NAME=<x> Use <x> as output file name for the multi-call binary. Defaults to vlmcsdmulti."
  405. @echo " DEPENDENCIES=1 Create dependency files."
  406. @echo " CRYPTO=openssl Use openssl for SHA256/HMAC calculations."
  407. @echo " CRYPTO=openssl_with_aes EXPERIMENTAL: Use openssl for SHA256/HMAC and AES calculations (hardware, e.g. AES-NI on x86)."
  408. @echo " CRYPTO=openssl_with_aes_soft EXPERIMENTAL: Use openssl for SHA256/HMAC and AES calculations (software)."
  409. @echo " CRYPTO=polarssl Use polarssl instead of internal crypto code for SHA256/HMAC calculations."
  410. @echo " CRYPTO=windows Use Windows CryptoAPI instead of internal crypto code for SHA256/HMAC calculations."
  411. @echo " CC=<x> Use compiler <x>. Supported compilers are gcc, icc, tcc and clang. Others may or may not work."
  412. @echo " TERMINAL_WIDTH=<x> Assume a fixed terminal width of <x> columns. Use in case of problems only."
  413. @echo " VLMCSD_VERSION=<x> Sets <x> as your version identifier. Defaults to \"private build\"."
  414. @echo " CFLAGS=<x> Pass <x> as additional arguments to the compiler."
  415. @echo " LDFLAGS=<x> Pass <x> as additional arguments to the linker."
  416. @echo " PLATFORMFLAGS=<x> Pass <x> as additional arguments to the compiler and the linker."
  417. @echo " BASECFLAGS=<x> Pass only <x> as arguments to the compiler (advanced users only)."
  418. @echo " BASELDFLAGS=<x> Pass only <x> as arguments to the linker (advanced users only)."
  419. @echo " STRIP=0 Don't strip debug information from $(PROGRAM_NAME) and $(CLIENT_NAME) (for developers)."
  420. @echo " VERBOSE=1 Be verbose when making targets."
  421. @echo " VERBOSE=3 Show name of compiler."
  422. @echo " THREADS=1 Use threads instead of fork(). Automatically set for native Windows. Recommended for Cygwin."
  423. @echo " WINDOWS=<x> Use <x> as the default ePID for Windows (when using $(PROGRAM_NAME) with -r 0)."
  424. @echo " OFFICE2010=<x> Use <x> as the default ePID for Office2010 (when using $(PROGRAM_NAME) with -r 0)."
  425. @echo " OFFICE2013=<x> Use <x> as the default ePID for Office2013 (when using $(PROGRAM_NAME) with -r 0)."
  426. @echo " HWID=<x> Use <x> as the default HWID (when it can't be found in an ini file)."
  427. @echo " FEATURES=full Compile $(PROGRAM_NAME) with all features (default)."
  428. @echo " FEATURES=most Compile $(PROGRAM_NAME) without rarely used features."
  429. @echo " FEATURES=embedded Compile $(PROGRAM_NAME) with typical features for embedded systems."
  430. @echo " FEATURES=autostart Removes features typically not needed if you place $(PROGRAM_NAME) in an autostart script."
  431. @echo " FEATURES=inetd Compile $(PROGRAM_NAME) for running through an internet superserver only."
  432. @echo " FEATURES=minimum Compiles only basic features of $(PROGRAM_NAME)."
  433. @echo " FEATURES=fixedepids $(PROGRAM_NAME) only uses bultin internal ePIDs."
  434. @echo ""
  435. @echo "Useful CFLAGS to save memory when running $(PROGRAM_NAME) on very small embedded devices (finer control than FEATURES=):"
  436. @echo " -DNO_EXTENDED_PRODUCT_LIST Don't compile the detailed product list."
  437. @echo " -DNO_BASIC_PRODUCT_LIST Don't compile the basic product list."
  438. @echo " -DNO_VERBOSE_LOG Don't support verbose logging. Removes -v option."
  439. @echo " -DNO_LOG Don't add support for logging. Implies -DNO_VERBOSE_LOG -DNO_EXTENDED_PRODUCT_LIST and -DNO_BASIC_PRODUCT_LIST."
  440. @echo " -DNO_RANDOM_EPID Don't support random ePIDs."
  441. @echo " -DNO_INI_FILE Don't support reading ePIDs/HWIDs from a file."
  442. @echo " -DNO_PID_FILE Don't support writing a PID file. Removes -p option."
  443. @echo " -DNO_USER_SWITCH Don't support changing uid/gid after program start. Removes -u and -g options."
  444. @echo " -DNO_HELP Don't support command line help."
  445. @echo " -DNO_CUSTOM_INTERVALS Don't support custom intervals for retry and refresh activation. Removes -A and -R options."
  446. @echo " -DNO_SOCKETS Don't support standalone operation. Requires an internet superserver to start $(PROGRAM_NAME)."
  447. @echo " -DNO_CL_PIDS Don't support specifying ePIDs and HwId from the command line in $(PROGRAM_NAME)."
  448. @echo " -DNO_LIMIT Don't support limiting concurrent clients in $(PROGRAM_NAME)."
  449. @echo " -DNO_SIGHUP Don't support SIGHUP handling in $(PROGRAM_NAME)."
  450. @echo ""
  451. @echo "Troubleshooting options"
  452. @echo " CAT=1 Combine all sources in a single file."
  453. @echo " CAT=2 Combine all sources in a single file and don't create a *.o file."
  454. @echo " NOPROCFS=1 Don't rely on a properly mounted proc filesystem in /proc."
  455. @echo " AUXV=1 Use /proc/self/auxv (requires Linux with glibc >= 2.16 or musl.)"
  456. @echo " NOLPTHREAD=1 Disable detection if -lpthread is required (for use with Android NDK)."
  457. @echo " NOLRESOLV=1 Disable detection if -lresolv is requires (for use with Android NDK)."
  458. @echo " NOLIBS=1 Do not attempt to autodetect any library dependencies."
  459. @echo " OPENSSL_HMAC=0 Compile for openssl versions that don't have HMAC support (required on some embedded devices)."
  460. @echo " NO_TIMEOUT=1 Do not set timeouts for sockets (for systems that don't support it)."
  461. @echo " CHILD_HANDLER=1 Install a handler for SIGCHLD (for systems that don't support SA_NOCLDWAIT)."
  462. @echo " NO_DNS=1 Compile vlmcs without support for detecting KMS servers via DNS."
  463. @echo " DNS_PARSER=internal Use $(CLIENT_NAME) internal DNS parsing routines. No effect on MingW (native Windows)."
  464. @echo ""
  465. @echo "Other useful CFLAGS:"
  466. @echo " -DSUPPORT_WINE Add code that the Windows version of $(PROGRAM_NAME) runs on Wine if MSRPC=1"
  467. @echo " -D_PEDANTIC Report rare error/warning conditions instead of silently ignoring them."
  468. @echo " -DINCLUDE_BETAS Include SKU / activation IDs for obsolete beta/preview products."
  469. @echo " -DFD_SETSIZE=<x> Allow <x> -L statements in $(PROGRAM_NAME) (default: 64 on Windows, 1024 on most Unixes)."
  470. @echo " -flto Use link time optimization. Not supported by old compilers (gcc < 4.7). Use whenever supported."
  471. @echo " -flto=jobserver Utilize all CPUs during link time optimization. Requires ${MAKE} -j <cpus>"
  472. @echo " -fno-stack-protector No stack checking. Smaller binaries."
  473. @echo " -pipe Use pipes instead of temporary files (faster compilation, extends the life of your SSD)."