rules.vc 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711
  1. #------------------------------------------------------------------------------
  2. # rules.vc --
  3. #
  4. # Microsoft Visual C++ makefile include for decoding the commandline
  5. # macros. This file does not need editing to build Tcl.
  6. #
  7. # See the file "license.terms" for information on usage and redistribution
  8. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  9. #
  10. # Copyright (c) 2001-2003 David Gravereaux.
  11. # Copyright (c) 2003-2008 Patrick Thoyts
  12. #------------------------------------------------------------------------------
  13. !ifndef _RULES_VC
  14. _RULES_VC = 1
  15. cc32 = $(CC) # built-in default.
  16. link32 = link
  17. lib32 = lib
  18. rc32 = $(RC) # built-in default.
  19. !ifndef INSTALLDIR
  20. ### Assume the normal default.
  21. _INSTALLDIR = C:\Program Files\Tcl
  22. !else
  23. ### Fix the path separators.
  24. _INSTALLDIR = $(INSTALLDIR:/=\)
  25. !endif
  26. #----------------------------------------------------------
  27. # Set the proper copy method to avoid overwrite questions
  28. # to the user when copying files and selecting the right
  29. # "delete all" method.
  30. #----------------------------------------------------------
  31. !if "$(OS)" == "Windows_NT"
  32. RMDIR = rmdir /S /Q
  33. ERRNULL = 2>NUL
  34. !if ![ver | find "4.0" > nul]
  35. CPY = echo y | xcopy /i >NUL
  36. COPY = copy >NUL
  37. !else
  38. CPY = xcopy /i /y >NUL
  39. COPY = copy /y >NUL
  40. !endif
  41. !else # "$(OS)" != "Windows_NT"
  42. CPY = xcopy /i >_JUNK.OUT # On Win98 NUL does not work here.
  43. COPY = copy >_JUNK.OUT # On Win98 NUL does not work here.
  44. RMDIR = deltree /Y
  45. NULL = \NUL # Used in testing directory existence
  46. ERRNULL = >NUL # Win9x shell cannot redirect stderr
  47. !endif
  48. MKDIR = mkdir
  49. #------------------------------------------------------------------------------
  50. # Determine the host and target architectures and compiler version.
  51. #------------------------------------------------------------------------------
  52. _HASH=^#
  53. _VC_MANIFEST_EMBED_EXE=
  54. _VC_MANIFEST_EMBED_DLL=
  55. VCVER=0
  56. !if ![echo VCVERSION=_MSC_VER > vercl.x] \
  57. && ![echo $(_HASH)if defined(_M_IX86) >> vercl.x] \
  58. && ![echo ARCH=IX86 >> vercl.x] \
  59. && ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \
  60. && ![echo ARCH=AMD64 >> vercl.x] \
  61. && ![echo $(_HASH)endif >> vercl.x] \
  62. && ![cl -nologo -TC -P vercl.x $(ERRNULL)]
  63. !include vercl.i
  64. !if ![echo VCVER= ^\> vercl.vc] \
  65. && ![set /a $(VCVERSION) / 100 - 6 >> vercl.vc]
  66. !include vercl.vc
  67. !endif
  68. !endif
  69. !if ![del $(ERRNUL) /q/f vercl.x vercl.i vercl.vc]
  70. !endif
  71. !if ![reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | findstr /i x86]
  72. NATIVE_ARCH=IX86
  73. !else
  74. NATIVE_ARCH=AMD64
  75. !endif
  76. # Since MSVC8 we must deal with manifest resources.
  77. !if $(VCVERSION) >= 1400
  78. _VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1
  79. _VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
  80. !endif
  81. !ifndef MACHINE
  82. MACHINE=$(ARCH)
  83. !endif
  84. !ifndef CFG_ENCODING
  85. CFG_ENCODING = \"cp1252\"
  86. !endif
  87. !message ===============================================================================
  88. #----------------------------------------------------------
  89. # build the helper app we need to overcome nmake's limiting
  90. # environment.
  91. #----------------------------------------------------------
  92. !if !exist(nmakehlp.exe)
  93. !if [$(cc32) -nologo nmakehlp.c -link -subsystem:console > nul]
  94. !endif
  95. !endif
  96. #----------------------------------------------------------
  97. # Test for compiler features
  98. #----------------------------------------------------------
  99. ### test for optimizations
  100. !if [nmakehlp -c -Ot]
  101. !message *** Compiler has 'Optimizations'
  102. OPTIMIZING = 1
  103. !else
  104. !message *** Compiler does not have 'Optimizations'
  105. OPTIMIZING = 0
  106. !endif
  107. OPTIMIZATIONS =
  108. !if [nmakehlp -c -Ot]
  109. OPTIMIZATIONS = $(OPTIMIZATIONS) -Ot
  110. !endif
  111. !if [nmakehlp -c -Oi]
  112. OPTIMIZATIONS = $(OPTIMIZATIONS) -Oi
  113. !endif
  114. !if [nmakehlp -c -Op]
  115. OPTIMIZATIONS = $(OPTIMIZATIONS) -Op
  116. !endif
  117. !if [nmakehlp -c -fp:strict]
  118. OPTIMIZATIONS = $(OPTIMIZATIONS) -fp:strict
  119. !endif
  120. !if [nmakehlp -c -Gs]
  121. OPTIMIZATIONS = $(OPTIMIZATIONS) -Gs
  122. !endif
  123. !if [nmakehlp -c -GS]
  124. OPTIMIZATIONS = $(OPTIMIZATIONS) -GS
  125. !endif
  126. !if [nmakehlp -c -GL]
  127. OPTIMIZATIONS = $(OPTIMIZATIONS) -GL
  128. !endif
  129. DEBUGFLAGS =
  130. !if [nmakehlp -c -RTC1]
  131. DEBUGFLAGS = $(DEBUGFLAGS) -RTC1
  132. !elseif [nmakehlp -c -GZ]
  133. DEBUGFLAGS = $(DEBUGFLAGS) -GZ
  134. !endif
  135. COMPILERFLAGS =-W3 -DUNICODE -D_UNICODE
  136. # In v13 -GL and -YX are incompatible.
  137. !if [nmakehlp -c -YX]
  138. !if ![nmakehlp -c -GL]
  139. OPTIMIZATIONS = $(OPTIMIZATIONS) -YX
  140. !endif
  141. !endif
  142. !if "$(MACHINE)" == "IX86"
  143. ### test for pentium errata
  144. !if [nmakehlp -c -QI0f]
  145. !message *** Compiler has 'Pentium 0x0f fix'
  146. COMPILERFLAGS = $(COMPILERFLAGS) -QI0f
  147. !else
  148. !message *** Compiler does not have 'Pentium 0x0f fix'
  149. !endif
  150. !endif
  151. !if "$(MACHINE)" == "IA64"
  152. ### test for Itanium errata
  153. !if [nmakehlp -c -QIA64_Bx]
  154. !message *** Compiler has 'B-stepping errata workarounds'
  155. COMPILERFLAGS = $(COMPILERFLAGS) -QIA64_Bx
  156. !else
  157. !message *** Compiler does not have 'B-stepping errata workarounds'
  158. !endif
  159. !endif
  160. !if "$(MACHINE)" == "IX86"
  161. ### test for -align:4096, when align:512 will do.
  162. !if [nmakehlp -l -opt:nowin98]
  163. !message *** Linker has 'Win98 alignment problem'
  164. ALIGN98_HACK = 1
  165. !else
  166. !message *** Linker does not have 'Win98 alignment problem'
  167. ALIGN98_HACK = 0
  168. !endif
  169. !else
  170. ALIGN98_HACK = 0
  171. !endif
  172. LINKERFLAGS =
  173. !if [nmakehlp -l -ltcg]
  174. LINKERFLAGS =-ltcg
  175. !endif
  176. #----------------------------------------------------------
  177. # Decode the options requested.
  178. #----------------------------------------------------------
  179. !if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"]
  180. STATIC_BUILD = 0
  181. TCL_THREADS = 1
  182. DEBUG = 0
  183. SYMBOLS = 0
  184. PROFILE = 0
  185. PGO = 0
  186. MSVCRT = 0
  187. LOIMPACT = 0
  188. TCL_USE_STATIC_PACKAGES = 0
  189. USE_THREAD_ALLOC = 1
  190. UNCHECKED = 0
  191. !else
  192. !if [nmakehlp -f $(OPTS) "static"]
  193. !message *** Doing static
  194. STATIC_BUILD = 1
  195. !else
  196. STATIC_BUILD = 0
  197. !endif
  198. !if [nmakehlp -f $(OPTS) "msvcrt"]
  199. !message *** Doing msvcrt
  200. MSVCRT = 1
  201. !else
  202. MSVCRT = 0
  203. !endif
  204. !if [nmakehlp -f $(OPTS) "staticpkg"]
  205. !message *** Doing staticpkg
  206. TCL_USE_STATIC_PACKAGES = 1
  207. !else
  208. TCL_USE_STATIC_PACKAGES = 0
  209. !endif
  210. !if [nmakehlp -f $(OPTS) "nothreads"]
  211. !message *** Compile explicitly for non-threaded tcl
  212. TCL_THREADS = 0
  213. !else
  214. TCL_THREADS = 1
  215. USE_THREAD_ALLOC= 1
  216. !endif
  217. !if [nmakehlp -f $(OPTS) "symbols"]
  218. !message *** Doing symbols
  219. DEBUG = 1
  220. !else
  221. DEBUG = 0
  222. !endif
  223. !if [nmakehlp -f $(OPTS) "pdbs"]
  224. !message *** Doing pdbs
  225. SYMBOLS = 1
  226. !else
  227. SYMBOLS = 0
  228. !endif
  229. !if [nmakehlp -f $(OPTS) "profile"]
  230. !message *** Doing profile
  231. PROFILE = 1
  232. !else
  233. PROFILE = 0
  234. !endif
  235. !if [nmakehlp -f $(OPTS) "pgi"]
  236. !message *** Doing profile guided optimization instrumentation
  237. PGO = 1
  238. !elseif [nmakehlp -f $(OPTS) "pgo"]
  239. !message *** Doing profile guided optimization
  240. PGO = 2
  241. !else
  242. PGO = 0
  243. !endif
  244. !if [nmakehlp -f $(OPTS) "loimpact"]
  245. !message *** Doing loimpact
  246. LOIMPACT = 1
  247. !else
  248. LOIMPACT = 0
  249. !endif
  250. !if [nmakehlp -f $(OPTS) "thrdalloc"]
  251. !message *** Doing thrdalloc
  252. USE_THREAD_ALLOC = 1
  253. !endif
  254. !if [nmakehlp -f $(OPTS) "tclalloc"]
  255. !message *** Doing tclalloc
  256. USE_THREAD_ALLOC = 0
  257. !endif
  258. !if [nmakehlp -f $(OPTS) "unchecked"]
  259. !message *** Doing unchecked
  260. UNCHECKED = 1
  261. !else
  262. UNCHECKED = 0
  263. !endif
  264. !endif
  265. !if !$(STATIC_BUILD)
  266. # Make sure we don't build overly fat DLLs.
  267. MSVCRT = 1
  268. # We shouldn't statically put the extensions inside the shell when dynamic.
  269. TCL_USE_STATIC_PACKAGES = 0
  270. !endif
  271. #----------------------------------------------------------
  272. # Figure-out how to name our intermediate and output directories.
  273. # We wouldn't want different builds to use the same .obj files
  274. # by accident.
  275. #----------------------------------------------------------
  276. #----------------------------------------
  277. # Naming convention:
  278. # t = full thread support.
  279. # s = static library (as opposed to an
  280. # import library)
  281. # g = linked to the debug enabled C
  282. # run-time.
  283. # x = special static build when it
  284. # links to the dynamic C run-time.
  285. #----------------------------------------
  286. SUFX = tsgx
  287. !if $(DEBUG)
  288. BUILDDIRTOP = Debug
  289. !else
  290. BUILDDIRTOP = Release
  291. !endif
  292. !if "$(MACHINE)" != "IX86"
  293. BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE)
  294. !endif
  295. !if $(VCVER) > 6
  296. BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER)
  297. !endif
  298. !if !$(DEBUG) || $(DEBUG) && $(UNCHECKED)
  299. SUFX = $(SUFX:g=)
  300. !endif
  301. TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX
  302. !if !$(STATIC_BUILD)
  303. TMP_DIRFULL = $(TMP_DIRFULL:Static=)
  304. SUFX = $(SUFX:s=)
  305. EXT = dll
  306. !if $(MSVCRT)
  307. TMP_DIRFULL = $(TMP_DIRFULL:X=)
  308. SUFX = $(SUFX:x=)
  309. !endif
  310. !else
  311. TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=)
  312. EXT = lib
  313. !if !$(MSVCRT)
  314. TMP_DIRFULL = $(TMP_DIRFULL:X=)
  315. SUFX = $(SUFX:x=)
  316. !endif
  317. !endif
  318. !if !$(TCL_THREADS)
  319. TMP_DIRFULL = $(TMP_DIRFULL:Threaded=)
  320. SUFX = $(SUFX:t=)
  321. !endif
  322. !ifndef TMP_DIR
  323. TMP_DIR = $(TMP_DIRFULL)
  324. !ifndef OUT_DIR
  325. OUT_DIR = .\$(BUILDDIRTOP)
  326. !endif
  327. !else
  328. !ifndef OUT_DIR
  329. OUT_DIR = $(TMP_DIR)
  330. !endif
  331. !endif
  332. #----------------------------------------------------------
  333. # Decode the statistics requested.
  334. #----------------------------------------------------------
  335. !if "$(STATS)" == "" || [nmakehlp -f "$(STATS)" "none"]
  336. TCL_MEM_DEBUG = 0
  337. TCL_COMPILE_DEBUG = 0
  338. !else
  339. !if [nmakehlp -f $(STATS) "memdbg"]
  340. !message *** Doing memdbg
  341. TCL_MEM_DEBUG = 1
  342. !else
  343. TCL_MEM_DEBUG = 0
  344. !endif
  345. !if [nmakehlp -f $(STATS) "compdbg"]
  346. !message *** Doing compdbg
  347. TCL_COMPILE_DEBUG = 1
  348. !else
  349. TCL_COMPILE_DEBUG = 0
  350. !endif
  351. !endif
  352. #----------------------------------------------------------
  353. # Decode the checks requested.
  354. #----------------------------------------------------------
  355. !if "$(CHECKS)" == "" || [nmakehlp -f "$(CHECKS)" "none"]
  356. TCL_NO_DEPRECATED = 0
  357. WARNINGS = -W3
  358. !else
  359. !if [nmakehlp -f $(CHECKS) "nodep"]
  360. !message *** Doing nodep check
  361. TCL_NO_DEPRECATED = 1
  362. !else
  363. TCL_NO_DEPRECATED = 0
  364. !endif
  365. !if [nmakehlp -f $(CHECKS) "fullwarn"]
  366. !message *** Doing full warnings check
  367. WARNINGS = -W4
  368. !if [nmakehlp -l -warn:3]
  369. LINKERFLAGS = $(LINKERFLAGS) -warn:3
  370. !endif
  371. !else
  372. WARNINGS = -W3
  373. !endif
  374. !if [nmakehlp -f $(CHECKS) "64bit"] && [nmakehlp -c -Wp64]
  375. !message *** Doing 64bit portability warnings
  376. WARNINGS = $(WARNINGS) -Wp64
  377. !endif
  378. !endif
  379. !if $(PGO) > 1
  380. !if [nmakehlp -l -ltcg:pgoptimize]
  381. LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pgoptimize
  382. !else
  383. MSG=^
  384. This compiler does not support profile guided optimization.
  385. !error $(MSG)
  386. !endif
  387. !elseif $(PGO) > 0
  388. !if [nmakehlp -l -ltcg:pginstrument]
  389. LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pginstrument
  390. !else
  391. MSG=^
  392. This compiler does not support profile guided optimization.
  393. !error $(MSG)
  394. !endif
  395. !endif
  396. #----------------------------------------------------------
  397. # Set our defines now armed with our options.
  398. #----------------------------------------------------------
  399. OPTDEFINES = -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) -DSTDC_HEADERS
  400. !if $(TCL_MEM_DEBUG)
  401. OPTDEFINES = $(OPTDEFINES) -DTCL_MEM_DEBUG
  402. !endif
  403. !if $(TCL_COMPILE_DEBUG)
  404. OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS
  405. !endif
  406. !if $(TCL_THREADS)
  407. OPTDEFINES = $(OPTDEFINES) -DTCL_THREADS=1
  408. !if $(USE_THREAD_ALLOC)
  409. OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=1
  410. !endif
  411. !endif
  412. !if $(STATIC_BUILD)
  413. OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD
  414. !endif
  415. !if $(TCL_NO_DEPRECATED)
  416. OPTDEFINES = $(OPTDEFINES) -DTCL_NO_DEPRECATED
  417. !endif
  418. !if !$(DEBUG)
  419. OPTDEFINES = $(OPTDEFINES) -DNDEBUG
  420. !if $(OPTIMIZING)
  421. OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED
  422. !endif
  423. !endif
  424. !if $(PROFILE)
  425. OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED
  426. !endif
  427. !if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
  428. OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT
  429. !endif
  430. !if $(VCVERSION) < 1300
  431. OPTDEFINES = $(OPTDEFINES) -DNO_STRTOI64
  432. !endif
  433. #----------------------------------------------------------
  434. # Locate the Tcl headers to build against
  435. #----------------------------------------------------------
  436. !if "$(PROJECT)" == "tcl"
  437. _TCL_H = ..\generic\tcl.h
  438. !else
  439. # If INSTALLDIR set to tcl root dir then reset to the lib dir.
  440. !if exist("$(_INSTALLDIR)\include\tcl.h")
  441. _INSTALLDIR=$(_INSTALLDIR)\lib
  442. !endif
  443. !if !defined(TCLDIR)
  444. !if exist("$(_INSTALLDIR)\..\include\tcl.h")
  445. TCLINSTALL = 1
  446. _TCLDIR = $(_INSTALLDIR)\..
  447. _TCL_H = $(_INSTALLDIR)\..\include\tcl.h
  448. TCLDIR = $(_INSTALLDIR)\..
  449. !else
  450. MSG=^
  451. Failed to find tcl.h. Set the TCLDIR macro.
  452. !error $(MSG)
  453. !endif
  454. !else
  455. _TCLDIR = $(TCLDIR:/=\)
  456. !if exist("$(_TCLDIR)\include\tcl.h")
  457. TCLINSTALL = 1
  458. _TCL_H = $(_TCLDIR)\include\tcl.h
  459. !elseif exist("$(_TCLDIR)\generic\tcl.h")
  460. TCLINSTALL = 0
  461. _TCL_H = $(_TCLDIR)\generic\tcl.h
  462. !else
  463. MSG =^
  464. Failed to find tcl.h. The TCLDIR macro does not appear correct.
  465. !error $(MSG)
  466. !endif
  467. !endif
  468. !endif
  469. #--------------------------------------------------------------
  470. # Extract various version numbers from tcl headers
  471. # The generated file is then included in the makefile.
  472. #--------------------------------------------------------------
  473. !if [echo REM = This file is generated from rules.vc > versions.vc]
  474. !endif
  475. !if [echo TCL_MAJOR_VERSION = \>> versions.vc] \
  476. && [nmakehlp -V "$(_TCL_H)" TCL_MAJOR_VERSION >> versions.vc]
  477. !endif
  478. !if [echo TCL_MINOR_VERSION = \>> versions.vc] \
  479. && [nmakehlp -V "$(_TCL_H)" TCL_MINOR_VERSION >> versions.vc]
  480. !endif
  481. !if [echo TCL_PATCH_LEVEL = \>> versions.vc] \
  482. && [nmakehlp -V "$(_TCL_H)" TCL_PATCH_LEVEL >> versions.vc]
  483. !endif
  484. # If building the tcl core then we need additional package versions
  485. !if "$(PROJECT)" == "tcl"
  486. !if [echo PKG_HTTP_VER = \>> versions.vc] \
  487. && [nmakehlp -V ..\library\http\pkgIndex.tcl http >> versions.vc]
  488. !endif
  489. !if [echo PKG_TCLTEST_VER = \>> versions.vc] \
  490. && [nmakehlp -V ..\library\tcltest\pkgIndex.tcl tcltest >> versions.vc]
  491. !endif
  492. !if [echo PKG_MSGCAT_VER = \>> versions.vc] \
  493. && [nmakehlp -V ..\library\msgcat\pkgIndex.tcl msgcat >> versions.vc]
  494. !endif
  495. !if [echo PKG_PLATFORM_VER = \>> versions.vc] \
  496. && [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform " >> versions.vc]
  497. !endif
  498. !if [echo PKG_SHELL_VER = \>> versions.vc] \
  499. && [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform::shell" >> versions.vc]
  500. !endif
  501. !if [echo PKG_DDE_VER = \>> versions.vc] \
  502. && [nmakehlp -V ..\library\dde\pkgIndex.tcl "dde " >> versions.vc]
  503. !endif
  504. !if [echo PKG_REG_VER =\>> versions.vc] \
  505. && [nmakehlp -V ..\library\reg\pkgIndex.tcl registry >> versions.vc]
  506. !endif
  507. !endif
  508. !include versions.vc
  509. #--------------------------------------------------------------
  510. # Setup tcl version dependent stuff headers
  511. #--------------------------------------------------------------
  512. !if "$(PROJECT)" != "tcl"
  513. TCL_VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION)
  514. !if $(TCL_VERSION) < 81
  515. TCL_DOES_STUBS = 0
  516. !else
  517. TCL_DOES_STUBS = 1
  518. !endif
  519. !if $(TCLINSTALL)
  520. TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe"
  521. !if !exist($(TCLSH)) && $(TCL_THREADS)
  522. TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX).exe"
  523. !endif
  524. TCLSTUBLIB = "$(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib"
  525. TCLIMPLIB = "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib"
  526. TCL_LIBRARY = $(_TCLDIR)\lib
  527. TCLREGLIB = "$(_TCLDIR)\lib\tclreg13$(SUFX:t=).lib"
  528. TCLDDELIB = "$(_TCLDIR)\lib\tcldde14$(SUFX:t=).lib"
  529. COFFBASE = \must\have\tcl\sources\to\build\this\target
  530. TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target
  531. TCL_INCLUDES = -I"$(_TCLDIR)\include"
  532. !else
  533. TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe"
  534. !if !exist($(TCLSH)) && $(TCL_THREADS)
  535. TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX).exe"
  536. !endif
  537. TCLSTUBLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib"
  538. TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib"
  539. TCL_LIBRARY = $(_TCLDIR)\library
  540. TCLREGLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg13$(SUFX:t=).lib"
  541. TCLDDELIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde14$(SUFX:t=).lib"
  542. COFFBASE = "$(_TCLDIR)\win\coffbase.txt"
  543. TCLTOOLSDIR = $(_TCLDIR)\tools
  544. TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win"
  545. !endif
  546. !endif
  547. #-------------------------------------------------------------------------
  548. # Locate the Tk headers to build against
  549. #-------------------------------------------------------------------------
  550. !if "$(PROJECT)" == "tk"
  551. _TK_H = ..\generic\tk.h
  552. _INSTALLDIR = $(_INSTALLDIR)\..
  553. !endif
  554. !ifdef PROJECT_REQUIRES_TK
  555. !if !defined(TKDIR)
  556. !if exist("$(_INSTALLDIR)\..\include\tk.h")
  557. TKINSTALL = 1
  558. _TKDIR = $(_INSTALLDIR)\..
  559. _TK_H = $(_TKDIR)\include\tk.h
  560. TKDIR = $(_TKDIR)
  561. !elseif exist("$(_TCLDIR)\include\tk.h")
  562. TKINSTALL = 1
  563. _TKDIR = $(_TCLDIR)
  564. _TK_H = $(_TKDIR)\include\tk.h
  565. TKDIR = $(_TKDIR)
  566. !endif
  567. !else
  568. _TKDIR = $(TKDIR:/=\)
  569. !if exist("$(_TKDIR)\include\tk.h")
  570. TKINSTALL = 1
  571. _TK_H = $(_TKDIR)\include\tk.h
  572. !elseif exist("$(_TKDIR)\generic\tk.h")
  573. TKINSTALL = 0
  574. _TK_H = $(_TKDIR)\generic\tk.h
  575. !else
  576. MSG =^
  577. Failed to find tk.h. The TKDIR macro does not appear correct.
  578. !error $(MSG)
  579. !endif
  580. !endif
  581. !endif
  582. #-------------------------------------------------------------------------
  583. # Extract Tk version numbers
  584. #-------------------------------------------------------------------------
  585. !if defined(PROJECT_REQUIRES_TK) || "$(PROJECT)" == "tk"
  586. !if [echo TK_MAJOR_VERSION = \>> versions.vc] \
  587. && [nmakehlp -V $(_TK_H) TK_MAJOR_VERSION >> versions.vc]
  588. !endif
  589. !if [echo TK_MINOR_VERSION = \>> versions.vc] \
  590. && [nmakehlp -V $(_TK_H) TK_MINOR_VERSION >> versions.vc]
  591. !endif
  592. !if [echo TK_PATCH_LEVEL = \>> versions.vc] \
  593. && [nmakehlp -V $(_TK_H) TK_PATCH_LEVEL >> versions.vc]
  594. !endif
  595. !include versions.vc
  596. TK_DOTVERSION = $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION)
  597. TK_VERSION = $(TK_MAJOR_VERSION)$(TK_MINOR_VERSION)
  598. !if "$(PROJECT)" != "tk"
  599. !if $(TKINSTALL)
  600. WISH = "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX).exe"
  601. TKSTUBLIB = "$(_TKDIR)\lib\tkstub$(TK_VERSION).lib"
  602. TKIMPLIB = "$(_TKDIR)\lib\tk$(TK_VERSION)$(SUFX).lib"
  603. TK_INCLUDES = -I"$(_TKDIR)\include"
  604. !else
  605. WISH = "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX).exe"
  606. TKSTUBLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tkstub$(TCL_VERSION).lib"
  607. TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX).lib"
  608. TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib"
  609. !endif
  610. !endif
  611. !endif
  612. #----------------------------------------------------------
  613. # Display stats being used.
  614. #----------------------------------------------------------
  615. !message *** Intermediate directory will be '$(TMP_DIR)'
  616. !message *** Output directory will be '$(OUT_DIR)'
  617. !message *** Suffix for binaries will be '$(SUFX)'
  618. !message *** Optional defines are '$(OPTDEFINES)'
  619. !message *** Compiler version $(VCVER). Target machine is $(MACHINE)
  620. !message *** Host architecture is $(NATIVE_ARCH)
  621. !message *** Compiler options '$(COMPILERFLAGS) $(OPTIMIZATIONS) $(DEBUGFLAGS) $(WARNINGS)'
  622. !message *** Link options '$(LINKERFLAGS)'
  623. !endif