OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/base.git] / util / src / TclTk / tcl8.6.12 / pkgs / tdbcpostgres1.1.3 / win / rules-ext.vc
1 # This file should only be included in makefiles for Tcl extensions,\r
2 # NOT in the makefile for Tcl itself.\r
3 \r
4 !ifndef _RULES_EXT_VC\r
5 \r
6 # We need to run from the directory the parent makefile is located in.\r
7 # nmake does not tell us what makefile was used to invoke it so parent\r
8 # makefile has to set the MAKEFILEVC macro or we just make a guess and\r
9 # warn if we think that is not the case.\r
10 !if "$(MAKEFILEVC)" == ""\r
11 \r
12 !if exist("$(PROJECT).vc")\r
13 MAKEFILEVC = $(PROJECT).vc\r
14 !elseif exist("makefile.vc")\r
15 MAKEFILEVC = makefile.vc\r
16 !endif\r
17 !endif # "$(MAKEFILEVC)" == ""\r
18 \r
19 !if !exist("$(MAKEFILEVC)")\r
20 MSG = ^\r
21 You must run nmake from the directory containing the project makefile.^\r
22 If you are doing that and getting this message, set the MAKEFILEVC^\r
23 macro to the name of the project makefile.\r
24 !message WARNING: $(MSG)\r
25 !endif\r
26 \r
27 !if "$(PROJECT)" == "tcl"\r
28 !error The rules-ext.vc file is not intended for Tcl itself.\r
29 !endif\r
30 \r
31 # We extract version numbers using the nmakehlp program. For now use\r
32 # the local copy of nmakehlp. Once we locate Tcl, we will use that\r
33 # one if it is newer.\r
34 !if [$(CC) -nologo -DNDEBUG "nmakehlp.c" -link -subsystem:console > nul]\r
35 !endif\r
36 \r
37 # First locate the Tcl directory that we are working with.\r
38 !if "$(TCLDIR)" != ""\r
39 \r
40 _RULESDIR = $(TCLDIR:/=\)\r
41 \r
42 !else\r
43 \r
44 # If an installation path is specified, that is also the Tcl directory.\r
45 # Also Tk never builds against an installed Tcl, it needs Tcl sources\r
46 !if defined(INSTALLDIR) && "$(PROJECT)" != "tk"\r
47 _RULESDIR=$(INSTALLDIR:/=\)\r
48 !else\r
49 # Locate Tcl sources\r
50 !if [echo _RULESDIR = \> nmakehlp.out] \\r
51    || [nmakehlp -L generic\tcl.h >> nmakehlp.out]\r
52 _RULESDIR = ..\..\tcl\r
53 !else\r
54 !include nmakehlp.out\r
55 !endif\r
56 \r
57 !endif # defined(INSTALLDIR)....\r
58 \r
59 !endif # ifndef TCLDIR\r
60 \r
61 # Now look for the targets.vc file under the Tcl root. Note we check this\r
62 # file and not rules.vc because the latter also exists on older systems.\r
63 !if exist("$(_RULESDIR)\lib\nmake\targets.vc") # Building against installed Tcl\r
64 _RULESDIR = $(_RULESDIR)\lib\nmake\r
65 !elseif exist("$(_RULESDIR)\win\targets.vc")   # Building against Tcl sources\r
66 _RULESDIR = $(_RULESDIR)\win\r
67 !else\r
68 # If we have not located Tcl's targets file, most likely we are compiling\r
69 # against an older version of Tcl and so must use our own support files.\r
70 _RULESDIR = .\r
71 !endif\r
72 \r
73 !if "$(_RULESDIR)" != "."\r
74 # Potentially using Tcl's support files. If this extension has its own\r
75 # nmake support files, need to compare the versions and pick newer.\r
76 \r
77 !if exist("rules.vc") # The extension has its own copy\r
78 \r
79 !if [echo TCL_RULES_MAJOR = \> versions.vc] \\r
80    && [nmakehlp -V "$(_RULESDIR)\rules.vc" RULES_VERSION_MAJOR >> versions.vc]\r
81 !endif\r
82 !if [echo TCL_RULES_MINOR = \>> versions.vc] \\r
83    && [nmakehlp -V "$(_RULESDIR)\rules.vc" RULES_VERSION_MINOR >> versions.vc]\r
84 !endif\r
85 \r
86 !if [echo OUR_RULES_MAJOR = \>> versions.vc] \\r
87    && [nmakehlp -V "rules.vc" RULES_VERSION_MAJOR >> versions.vc]\r
88 !endif\r
89 !if [echo OUR_RULES_MINOR = \>> versions.vc] \\r
90    && [nmakehlp -V "rules.vc" RULES_VERSION_MINOR >> versions.vc]\r
91 !endif\r
92 !include versions.vc\r
93 # We have a newer version of the support files, use them\r
94 !if ($(TCL_RULES_MAJOR) != $(OUR_RULES_MAJOR)) || ($(TCL_RULES_MINOR) < $(OUR_RULES_MINOR))\r
95 _RULESDIR = .\r
96 !endif\r
97 \r
98 !endif # if exist("rules.vc")\r
99 \r
100 !endif # if $(_RULESDIR) != "."\r
101 \r
102 # Let rules.vc know what copy of nmakehlp.c to use.\r
103 NMAKEHLPC = $(_RULESDIR)\nmakehlp.c\r
104 \r
105 # Get rid of our internal defines before calling rules.vc\r
106 !undef TCL_RULES_MAJOR\r
107 !undef TCL_RULES_MINOR\r
108 !undef OUR_RULES_MAJOR\r
109 !undef OUR_RULES_MINOR\r
110 \r
111 !if exist("$(_RULESDIR)\rules.vc")\r
112 !message *** Using $(_RULESDIR)\rules.vc\r
113 !include "$(_RULESDIR)\rules.vc"\r
114 !else\r
115 !error *** Could not locate rules.vc in $(_RULESDIR)\r
116 !endif\r
117 \r
118 !endif # _RULES_EXT_VC