OSDN Git Service

Change various Makefile.in to use standard autoconf variables.
[pf3gnuchains/sourceware.git] / tcl / win / Makefile.in
1 # Copyright (c) 1995-1996 Sun Microsystems, Inc.
2
3 # This file is CYGNUS LOCAL.  It is a copy of makefile.vc from the
4 # standard tcl distribution, modified to work with cygwin and an
5 # autoconf configure script.  I have chosen to minimize the number of
6 # changes, so the comments continue to refer to Visual C++ and the
7 # like.  This should make it easier to merge in a new version if that
8 # is necessary.
9
10 prefix = @prefix@
11 exec_prefix = @exec_prefix@
12 VPATH = @srcdir@:@srcdir@/../generic:@srcdir@/../compat
13 srcdir = @srcdir@
14 libdir = @libdir@
15 bindir = @bindir@
16 includedir = @includedir@
17 datadir = @datadir@
18
19 INSTALL = @INSTALL@
20 INSTALL_PROGRAM = @INSTALL_PROGRAM@
21 INSTALL_DATA = @INSTALL_DATA@
22
23 CC = @CC@
24 CFLAGS = @CFLAGS@
25 NM = @NM@
26 AS = @AS@
27 LD = @LD@
28 DLLTOOL = @DLLTOOL@
29 WINDRES = @WINDRES@
30
31 DLL_LDFLAGS = @DLL_LDFLAGS@
32 DLL_LDLIBS = @DLL_LDLIBS@
33 TCL_ALLOC_OBJ = @TCL_ALLOC_OBJ@
34
35 OBJEXT=@OBJEXT@
36
37 # Current Tcl version;  used in various names.
38
39 DIRVERSION = @TCL_VERSION@
40
41 # The following definition can be set to non-null for special systems
42 # like AFS with replication.  It allows the pathnames used for installation
43 # to be different than those used for actually reference files at
44 # run-time.  INSTALL_ROOT is prepended to $prefix and $exec_prefix
45 # when installing files.
46 INSTALL_ROOT =
47
48 # Directory from which applications will reference the library of Tcl
49 # scripts (note: you can set the TCL_LIBRARY environment variable at
50 # run-time to override this value):
51 TCL_LIBRARY =   $(datadir)/tcl$(DIRVERSION)
52
53 # Path name to use when installing library scripts:
54 SCRIPT_INSTALL_DIR =    $(INSTALL_ROOT)$(TCL_LIBRARY)
55
56 # Directory in which to install libtcl.so or libtcl.a:
57 LIB_INSTALL_DIR =       $(INSTALL_ROOT)$(libdir)
58
59 # Directory in which to install the program tclsh:
60 BIN_INSTALL_DIR =       $(INSTALL_ROOT)$(bindir)
61
62 # Directory in which to install the include file tcl.h:
63 INCLUDE_INSTALL_DIR =   $(INSTALL_ROOT)$(includedir)
64
65 #
66 # Visual C++ 2.x and 4.0 makefile
67 #
68 # Does not depend on the presence of any environment variables in
69 # order to compile tcl; all needed information is derived from 
70 # location of the compiler directories.
71
72 #
73 # Project directories
74 #
75 # ROOT    = top of source tree
76 #
77 # TMPDIR  = location where .obj files should be stored during build
78 #
79 # TOOLS32 = location of VC++ 32-bit development tools. Note that the
80 #           VC++ 2.0 header files are broken, so you need to use the
81 #           ones that come with the developer network CD's, or later
82 #           versions of VC++.
83 #
84 # TOOLS16 = location of VC++ 1.5 16-bit tools, needed to build thunking
85 #           library.  This information is optional; if the 16-bit compiler
86 #           is not available, then the 16-bit code will not be built.  
87 #           Tcl will still run without the 16-bit code, but...
88 #               A. Under Windows 3.X you will any calls to the exec command
89 #                  will return an error.
90 #               B. A 16-bit program to test the behavior of the exec
91 #                  command under NT and 95 will not be built.
92 #
93
94 ROOT            = $(srcdir)/..
95 TMPDIR          = .
96 TOOLS32         = c:\msdev
97 TOOLS16         = c:\msvc
98
99 # Set this to the appropriate value of /MACHINE: for your platform
100 MACHINE = IX86
101
102 # Comment the following line to compile with symbols
103 NODEBUG=1
104
105 # uncomment one of the following lines to compile with TCL_MEM_DEBUG, 
106 # TCL_MEM_DEBUG, or TCL_COMPILE_DEBUG
107 #DEBUGDEFINES   = -DTCL_MEM_DEBUG
108 #DEBUGDEFINES   = -DTCL_MEM_DEBUG -DTCL_COMPILE_DEBUG
109 #DEBUGDEFINES   = -DTCL_MEM_DEBUG -DTCL_COMPILE_STATS
110 #DEBUGDEFINES   = -DTCL_MEM_DEBUG -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS
111
112 ######################################################################
113 # Do not modify below this line
114 ######################################################################
115
116 VERSION = 80
117
118 TCLLIB          = libtcl$(VERSION).a
119 TCLDLL          = cygtcl$(VERSION).dll
120 TCLPLUGINLIB    = libtcl$(VERSION)p.a
121 TCLPLUGINDLL    = cygtcl$(VERSION)p.dll
122 TCL16DLL        = # tcl16$(VERSION).dll
123 TCLSH           = cygtclsh$(VERSION).exe
124 TCLSHP          = cygtclshp$(VERSION).exe
125 TCLTEST         = tcltest.exe
126 DUMPEXTS        = # $(TMPDIR)\dumpexts.exe
127 TCLPIPEDLL      = cygtclpip$(VERSION).dll
128 TCLREGDLL       = cygtclreg$(VERSION).dll
129 CAT16           = # cat16.exe
130 CAT32           = cat32.exe
131
132 ifeq ($(OBJEXT),obj)
133
134 TCL_ALLOC_OBJ=$(TMPDIR)/tclAlloc.$(OBJEXT)
135
136 endif
137
138 TCLSHOBJS = \
139         $(TMPDIR)/tclAppInit.$(OBJEXT)
140
141 TCLTESTOBJS = \
142         $(TMPDIR)/tclTest.$(OBJEXT) \
143         $(TMPDIR)/tclTestObj.$(OBJEXT) \
144         $(TMPDIR)/tclTestProcBodyObj.$(OBJEXT) \
145         $(TMPDIR)/tclWinTest.$(OBJEXT) \
146         $(TMPDIR)/testMain.$(OBJEXT)
147
148 TCLOBJS = \
149         $(TMPDIR)/panic.$(OBJEXT) \
150         $(TMPDIR)/regexp.$(OBJEXT) \
151         $(TMPDIR)/strftime.$(OBJEXT) \
152         $(TCL_ALLOC_OBJ) \
153         $(TMPDIR)/tclAsync.o \
154         $(TMPDIR)/tclBasic.o \
155         $(TMPDIR)/tclBinary.o \
156         $(TMPDIR)/tclCkalloc.o \
157         $(TMPDIR)/tclClock.o \
158         $(TMPDIR)/tclCmdAH.o \
159         $(TMPDIR)/tclCmdIL.o \
160         $(TMPDIR)/tclCmdMZ.o \
161         $(TMPDIR)/tclCompExpr.o \
162         $(TMPDIR)/tclCompile.o \
163         $(TMPDIR)/tclDate.o \
164         $(TMPDIR)/tclEnv.o \
165         $(TMPDIR)/tclEvent.o \
166         $(TMPDIR)/tclExecute.o \
167         $(TMPDIR)/tclFCmd.o \
168         $(TMPDIR)/tclFileName.o \
169         $(TMPDIR)/tclGet.o \
170         $(TMPDIR)/tclHash.o \
171         $(TMPDIR)/tclHistory.o \
172         $(TMPDIR)/tclIndexObj.o \
173         $(TMPDIR)/tclInterp.o \
174         $(TMPDIR)/tclIO.o \
175         $(TMPDIR)/tclIOCmd.o \
176         $(TMPDIR)/tclIOSock.o \
177         $(TMPDIR)/tclIOUtil.o \
178         $(TMPDIR)/tclLink.o \
179         $(TMPDIR)/tclListObj.o \
180         $(TMPDIR)/tclLoad.o \
181         $(TMPDIR)/tclMain.o \
182         $(TMPDIR)/tclNamesp.o \
183         $(TMPDIR)/tclNotify.o \
184         $(TMPDIR)/tclObj.o \
185         $(TMPDIR)/tclParse.o \
186         $(TMPDIR)/tclPipe.o \
187         $(TMPDIR)/tclPkg.o \
188         $(TMPDIR)/tclPosixStr.o \
189         $(TMPDIR)/tclPreserve.o \
190         $(TMPDIR)/tclProc.o \
191         $(TMPDIR)/tclResolve.o \
192         $(TMPDIR)/tclStringObj.o \
193         $(TMPDIR)/tclTimer.o \
194         $(TMPDIR)/tclUtil.o \
195         $(TMPDIR)/tclVar.o \
196         $(TMPDIR)/tclWin32Dll.o \
197         $(TMPDIR)/tclWinChan.o \
198         $(TMPDIR)/tclWinError.o \
199         $(TMPDIR)/tclWinFCmd.o \
200         $(TMPDIR)/tclWinFile.o \
201         $(TMPDIR)/tclWinInit.o \
202         $(TMPDIR)/tclWinLoad.o \
203         $(TMPDIR)/tclWinMtherr.o \
204         $(TMPDIR)/tclWinNotify.o \
205         $(TMPDIR)/tclWinPipe.o \
206         $(TMPDIR)/tclWinSock.o \
207         $(TMPDIR)/tclWinTime.o 
208
209 cc32            = $(TOOLS32)\bin\cl.exe
210 link32          = $(TOOLS32)\bin\link.exe
211 rc32            = $(TOOLS32)\bin\rc.exe
212 include32       = -I$(TOOLS32)\include
213
214 cc16            = $(TOOLS16)\bin\cl.exe
215 link16          = $(TOOLS16)\bin\link.exe
216 rc16            = $(TOOLS16)\bin\rc.exe
217 include16       = -I$(TOOLS16)\include
218
219 WINDIR          = $(ROOT)/win
220 GENERICDIR      = $(ROOT)/generic
221
222 TCL_INCLUDES    = -I$(WINDIR) -I$(GENERICDIR)
223 TCL_DEFINES     = -D__WIN32__ $(DEBUGDEFINES)
224
225 TCL_CFLAGS      = $(cdebug) $(cflags) $(cvarsdll) \
226                         $(TCL_INCLUDES) $(TCL_DEFINES) $(CFLAGS)
227 CON_CFLAGS      = $(cdebug) $(cflags) $(cvars) -DCONSOLE
228 DOS_CFLAGS      = $(cdebug) $(cflags) $(include16) -AL 
229 DLL16_CFLAGS    = $(cdebug) $(cflags) $(include16) -ALw
230
231 linkdebug =
232 conlflags = -Wl,--subsystem,console -mwindows
233 conlibsdll =
234
235 ######################################################################
236 # Link flags
237 ######################################################################
238
239 #!IFDEF NODEBUG
240 #ldebug = /RELEASE
241 #!ELSE
242 #ldebug = -debug:full -debugtype:cv
243 #!ENDIF
244
245 # declarations common to all linker options
246 lcommon = /NODEFAULTLIB /RELEASE /NOLOGO
247
248 # declarations for use on Intel i386, i486, and Pentium systems
249 #!IF "$(MACHINE)" == "IX86"
250 #DLLENTRY = @12
251 #lflags   = $(lcommon) -align:0x1000 /MACHINE:$(MACHINE)
252 #!ELSE
253 #lflags   = $(lcommon) /MACHINE:$(MACHINE)
254 #!ENDIF
255
256 conlflags = -Wl,--subsystem,console -mwindows
257 guilflags = -mwindows
258 dlllflags =
259
260 #!IF "$(MACHINE)" == "PPC"
261 #libc = libc.lib
262 #libcdll = crtdll.lib
263 #!ELSE
264 #libc = libc.lib oldnames.lib
265 #libcdll = msvcrt.lib oldnames.lib
266 #!ENDIF
267
268 ifeq ($(OBJEXT),o)
269
270 baselibs   = -lkernel32 $(optlibs) -ladvapi32 -luser32
271 winlibs    = $(baselibs) -lgdi32 -lcomdlg32 -lwinspool
272
273 else
274
275 baselibs   = kernel32.lib $(optlibs) advapi32.lib user32.lib
276 winlibs    = $(baselibs) gdi32.lib comdlg32.lib winspool.lib
277 libcdll    = msvcrt.lib oldnames.lib
278
279 endif
280
281 guilibs    = $(libc) $(winlibs)
282 conlibs    = $(libc) $(baselibs)
283 guilibsdll = $(libcdll) $(winlibs)
284 conlibsdll = $(libcdll) $(baselibs)
285
286 ######################################################################
287 # Compile flags
288 ######################################################################
289
290 #!IFDEF NODEBUG
291 #cdebug = -Ox
292 #!ELSE
293 #cdebug = -Z7 -Od -WX
294 #!ENDIF
295
296 # declarations common to all compiler options
297 ccommon = -c -W3 -nologo -YX -Dtry=__try -Dexcept=__except
298
299 #!IF "$(MACHINE)" == "IX86"
300 #cflags = $(ccommon) -D_X86_=1
301 #!ELSE
302 #!IF "$(MACHINE)" == "MIPS"
303 #cflags = $(ccommon) -D_MIPS_=1
304 #!ELSE
305 #!IF "$(MACHINE)" == "PPC"
306 #cflags = $(ccommon) -D_PPC_=1
307 #!ELSE
308 #!IF "$(MACHINE)" == "ALPHA"
309 #cflags = $(ccommon) -D_ALPHA_=1
310 #!ENDIF
311 #!ENDIF
312 #!ENDIF
313 #!ENDIF
314
315 cvars      = -DWIN32 -D_WIN32
316 cvarsmt    = $(cvars) -D_MT
317 cvarsdll   = $(cvarsmt) -D_DLL
318
319 ######################################################################
320 # Project specific targets
321 ######################################################################
322
323 release:    $(TCLSH) dlls $(TCLLIB)
324 dlls:       $(TCLDLL) $(TCLPIPEDLL) $(TCLREGDLL)
325 all:        $(TCLSH) dlls $(CAT16) $(CAT32) $(TCLLIB)
326 tcltest:    $(TCLTEST) dlls $(CAT16) $(CAT32)
327 plugin:     $(TCLPLUGINDLL) $(TCLSHP)
328 test:       $(TCLTEST) dlls $(CAT16) $(CAT32) 
329         ( echo cd $(ROOT)/tests\; source all ) | $(TCLTEST)
330
331 install: install-binaries install-libraries
332
333 install-binaries: $(TCLDLL) $(TCLLIB) $(TCLSH) $(TCLPIPEDLL)
334         @for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
335             do \
336             if [ ! -d $$i ] ; then \
337                 echo "Making directory $$i"; \
338                 mkdir $$i; \
339                 chmod 755 $$i; \
340                 else true; \
341                 fi; \
342             done;
343         @echo "Installing $(TCLLIB)"
344         @$(INSTALL_DATA) $(TCLLIB) $(LIB_INSTALL_DIR)/$(TCLLIB)
345         @chmod 555 $(LIB_INSTALL_DIR)/$(TCLLIB)
346         @echo "Installing tclsh"
347         @$(INSTALL_PROGRAM) $(TCLSH) $(BIN_INSTALL_DIR)/$(TCLSH)
348         @echo "Installing tclConfig.sh"
349         @$(INSTALL_DATA) ../unix/tclConfig.sh $(LIB_INSTALL_DIR)/tclConfig.sh
350
351 install-libraries:
352         @echo "Installing DLL"
353         @$(INSTALL_DATA) $(TCLDLL) $(BIN_INSTALL_DIR)/$(TCLDLL)
354         @$(INSTALL_DATA) $(TCLPIPEDLL) $(BIN_INSTALL_DIR)/$(TCLPIPEDLL)
355         @$(INSTALL_DATA) $(TCLREGDLL) $(BIN_INSTALL_DIR)/$(TCLREGDLL)
356         @for i in $(INSTALL_ROOT)@datadir@ $(INCLUDE_INSTALL_DIR) \
357                 $(SCRIPT_INSTALL_DIR) ; \
358             do \
359             if [ ! -d $$i ] ; then \
360                 echo "Making directory $$i"; \
361                 mkdir $$i; \
362                 chmod 755 $$i; \
363                 else true; \
364                 fi; \
365             done;
366         @for i in http2.0 http1.0 opt0.1 ; \
367             do \
368             if [ ! -d $(SCRIPT_INSTALL_DIR)/$$i ] ; then \
369                 echo "Making directory $(SCRIPT_INSTALL_DIR)/$$i"; \
370                 mkdir $(SCRIPT_INSTALL_DIR)/$$i; \
371                 chmod 755 $(SCRIPT_INSTALL_DIR)/$$i; \
372                 else true; \
373                 fi; \
374             done;
375         @echo "Installing tcl.h"
376         @$(INSTALL_DATA) $(GENERICDIR)/tcl.h $(INCLUDE_INSTALL_DIR)/tcl.h
377         @for i in $(ROOT)/library/*.tcl $(ROOT)/library/tclIndex $(WINDIR)/tclAppInit.c; \
378             do \
379             echo "Installing $$i"; \
380             $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \
381             done;
382         @for i in http2.0 http1.0 opt0.1 ; \
383             do \
384             for j in $(ROOT)/library/$$i/*.tcl ; \
385                 do \
386                 echo "Installing $$j"; \
387                 $(INSTALL_DATA) $$j $(SCRIPT_INSTALL_DIR)/$$i; \
388                 done; \
389             done;
390
391 install-minimal:
392         @echo "Installing DLL"
393         @$(INSTALL_DATA) $(TCLDLL) $(BIN_INSTALL_DIR)/$(TCLDLL)
394         @$(INSTALL_DATA) $(TCLPIPEDLL) $(BIN_INSTALL_DIR)/$(TCLPIPEDLL)
395         @$(INSTALL_DATA) $(TCLREGDLL) $(BIN_INSTALL_DIR)/$(TCLREGDLL)
396         @for i in $(INSTALL_ROOT)@datadir@ $(SCRIPT_INSTALL_DIR) ; \
397             do \
398             if [ ! -d $$i ] ; then \
399                 echo "Making directory $$i"; \
400                 mkdir $$i; \
401                 chmod 755 $$i; \
402                 else true; \
403                 fi; \
404             done;
405         @for i in http2.0 http1.0 opt0.1 ; \
406             do \
407             if [ ! -d $(SCRIPT_INSTALL_DIR)/$$i ] ; then \
408                 echo "Making directory $(SCRIPT_INSTALL_DIR)/$$i"; \
409                 mkdir $(SCRIPT_INSTALL_DIR)/$$i; \
410                 chmod 755 $(SCRIPT_INSTALL_DIR)/$$i; \
411                 else true; \
412                 fi; \
413             done;
414         @for i in $(ROOT)/library/*.tcl $(ROOT)/library/tclIndex; \
415             do \
416             echo "Installing $$i"; \
417             $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \
418             done;
419         @for i in http2.0 http1.0 opt0.1 ; \
420             do \
421             for j in $(ROOT)/library/$$i/*.tcl ; \
422                 do \
423                 echo "Installing $$j"; \
424                 $(INSTALL_DATA) $$j $(SCRIPT_INSTALL_DIR)/$$i; \
425                 done; \
426             done;
427
428 # $(DUMPEXTS): $(WINDIR)/winDumpExts.c
429 #       $(CC) -c $(CON_CFLAGS) $?
430 #       $(CC) $(linkdebug) $(conlflags) -o $@ $(TMPDIR)/winDumpExts.$(OBJEXT)bj $(guilibs)
431
432
433 ifeq ($(OBJEXT),o)
434
435 $(TCLDLL): $(TCLOBJS) tclres.$(OBJEXT) $(TMPDIR)/tclcyg.def
436         $(CC) -s $(DLL_LDFLAGS) -Wl,--base-file,tcl.base -o $(TCLDLL) $(TCLOBJS) tclres.$(OBJEXT) $(DLL_LDLIBS) -mwindows -Wl,-e,_DllMain@12 -Wl,--image-base,0x66000000
437         $(DLLTOOL) --as=$(AS) --dllname $(TCLDLL) --def $(TMPDIR)/tclcyg.def --base-file tcl.base --output-exp tcl.exp
438         $(CC) -s $(DLL_LDFLAGS) -Wl,--base-file,tcl.base,tcl.exp -o $(TCLDLL) $(TCLOBJS) tclres.$(OBJEXT) $(DLL_LDLIBS) -mwindows -Wl,-e,_DllMain@12 -Wl,--image-base,0x66000000
439         $(DLLTOOL) --as=$(AS) --dllname $(TCLDLL) --def $(TMPDIR)/tclcyg.def --base-file tcl.base --output-exp tcl.exp
440         $(CC) $(DLL_LDFLAGS) -Wl,tcl.exp -o $(TCLDLL) $(TCLOBJS) tclres.$(OBJEXT) $(DLL_LDLIBS) -mwindows -Wl,-e,_DllMain@12 -Wl,--image-base,0x66000000
441
442 else
443
444 $(TCLDLL): $(TCLOBJS) $(TMPDIR)/tclcyg.def tclres.$(OBJEXT)
445         link.exe $(ldebug) $(dlllflags) -dll -def:$(TMPDIR)/tclcyg.def -NODEFAULTLIB \
446                 -out:$(TCLDLL) tclres.$(OBJEXT) $(guilibsdll) $(TCLOBJS) \
447                 -entry:_DllMainCRTStartup@12
448         mv cygtcl80.lib $(TCLLIB)
449 endif
450
451
452 ifeq ($(OBJEXT),o)
453
454 $(TCLLIB): $(TMPDIR)/tclcyg.def 
455         $(DLLTOOL) --as=$(AS) --dllname $(TCLDLL) --def $(TMPDIR)/tclcyg.def --output-lib $(TCLLIB)
456
457 else
458
459 $(TCLLIB): $(TCLDLL)
460
461 endif
462
463 $(TCLPLUGINLIB): $(TMPDIR)/plugin.def
464         $(DLLTOOL) --as=$(AS) --dllname $(TCLPLUGINDLL) --def $(TMPDIR)/plugin.def --output-lib $(TCLPLUGINLIB)
465
466 $(TCLPLUGINDLL): $(TCLOBJS) $(TMPDIR)/plugin.def tclres.$(OBJEXT)
467         $(CC) -s $(DLL_LDFLAGS) -Wl,--base-file,tclplugin.base -o $(TCLPLUGINDLL) $(TCLOBJS) tclres.$(OBJEXT) $(DLL_LDLIBS) -mwindows -Wl,-e,_DllMain@12 -Wl,--image-base,0x66600000
468         $(DLLTOOL) --as=$(AS) --dllname $(TCLPLUGINDLL) --def $(TMPDIR)/plugin.def --base-file tclplugin.base --output-exp tcl.exp
469         $(CC) -s $(DLL_LDFLAGS) -Wl,--base-file,tclplugin.base -Wl,tcl.exp -o $(TCLPLUGINDLL) $(TCLOBJS) tclres.$(OBJEXT) $(DLL_LDLIBS) -mwindows -Wl,-e,_DllMain@12 -Wl,--image-base,0x66600000
470         $(DLLTOOL) --as=$(AS) --dllname $(TCLPLUGINDLL) --def $(TMPDIR)/plugin.def --base-file tclplugin.base --output-exp tcl.exp
471         $(CC) $(DLL_LDFLAGS) -Wl,tcl.exp -o $(TCLPLUGINDLL) $(TCLOBJS) tclres.$(OBJEXT) $(DLL_LDLIBS) -mwindows -Wl,-e,_DllMain@12 -Wl,--image-base,0x66600000
472
473 ifeq ($(OBJEXT),o)
474
475 $(TCLSH): $(TCLSHOBJS) tclshres.$(OBJEXT) $(TCLLIB)
476         $(CC) $(linkdebug) $(conlflags) -Wl,--stack=0x2300000 \
477                 -o $@ $(conlibsdll) $(TCLSHOBJS) tclshres.$(OBJEXT) $(TCLLIB)
478
479 else
480
481 $(TCLSH): $(TCLSHOBJS) tclshres.$(OBJEXT) $(TCLLIB)
482         link $(linkdebug) $(conlflags) $(tclsh_flags) -NODEFAULTLIB -subsystem:console -entry:mainCRTStartup \
483                 -out:$@ $(conlibsdll) $(TCLSHOBJS) tclshres.$(OBJEXT) $(TCLLIB)
484
485 endif
486
487 $(TCLSHP): $(TCLSHOBJS) $(TCLPLUGINLIB) tclshres.$(OBJEXT)
488         $(CC) $(linkdebug) $(conlflags) -Wl,--stack=0x2300000 \
489                 -o $@ $(conlibsdll) $(TCLSHOBJS) tclshres.$(OBJEXT) $(TCLPLUGINLIB)
490
491 $(TCLTEST): $(TCLTESTOBJS) tclshres.$(OBJEXT) $(TCLLIB)
492         $(CC) $(linkdebug) $(conlflags) -Wl,--stack=0x2300000 \
493                  -o $@ $(conlibsdll) $(TCLTESTOBJS) tclshres.$(OBJEXT) $(TCLLIB)
494
495 # $(TCL16DLL):  $(WINDIR)\tcl16.rc $(WINDIR)\tclWin16.c
496 #       if exist $(cc16) $(cc16) @<<
497 # $(DLL16_CFLAGS) -Fo$(TMPDIR)\ $(WINDIR)\tclWin16.c
498 # <<                         
499 #       @copy << $(TMPDIR)\tclWin16.def > nul
500 # LIBRARY $(@B);dll
501 # EXETYPE WINDOWS
502 # CODE PRELOAD MOVEABLE DISCARDABLE
503 # DATA PRELOAD MOVEABLE SINGLE
504 # HEAPSIZE 1024 
505 # EXPORTS
506 #       WEP @1 RESIDENTNAME
507 #       UTPROC @2 
508 # << 
509 #       if exist $(cc16) $(link16) /NOLOGO /ONERROR:NOEXE /NOE @<<
510 # $(TMPDIR)\tclWin16.obj
511 # $@
512 # nul
513 # $(TOOLS16)\lib\ ldllcew oldnames libw toolhelp
514 # $(TMPDIR)\tclWin16.def
515 # <<
516 #       if exist $(cc16) $(rc16) -i $(GENERICDIR) $(TCL_DEFINES) $(WINDIR)\tcl16.rc $@
517
518 ifeq ($(OBJEXT),o)
519
520 $(TCLPIPEDLL): $(WINDIR)/stub16.c
521         $(CC) -c $(CON_CFLAGS) $(WINDIR)/stub16.c
522         $(CC) $(linkdebug) $(conlflags) -o $@ $(TMPDIR)/stub16.$(OBJEXT) $(guilibs)
523 else
524
525 $(TCLPIPEDLL): $(WINDIR)/stub16.c
526         $(CC) -c $(CON_CFLAGS) -Fo$(TMPDIR)/ $(WINDIR)/stub16.c
527         link $(ldebug) $(conlflags) -out:$@ $(TMPDIR)/stub16.obj $(guilibsdll)
528 endif
529
530 ifeq ($(OBJEXT),o)
531
532 $(TCLREGDLL): $(TMPDIR)/tclWinReg.$(OBJEXT) $(TCLLIB)
533         echo EXPORTS > $(TMPDIR)/tclreg.def
534         echo Registry_Init >> $(TMPDIR)/tclreg.def
535         $(CC) -s $(DLL_LDFLAGS) -Wl,--base-file,tclreg.base -o $(TCLREGDLL) $(TMPDIR)/tclWinReg.$(OBJEXT) $(TCLLIB) $(DLL_LDLIBS) -ladvapi32 -mwindows -Wl,-e,_DllEntryPoint@12 -Wl,--image-base,0x66200000
536         $(DLLTOOL) --as=$(AS) --dllname $(TCLREGDLL) --def $(TMPDIR)/tclreg.def --base-file tclreg.base --output-exp tclreg.exp
537         $(CC) -s $(DLL_LDFLAGS) -Wl,--base-file,tclreg.base -Wl,tclreg.exp -o $(TCLREGDLL) $(TMPDIR)/tclWinReg.$(OBJEXT) $(TCLLIB) $(DLL_LDLIBS) -ladvapi32 -mwindows -Wl,-e,_DllEntryPoint@12 -Wl,--image-base,0x66200000
538         $(DLLTOOL) --as=$(AS) --dllname $(TCLREGDLL) --def $(TMPDIR)/tclreg.def --base-file tclreg.base --output-exp tclreg.exp
539         $(CC) $(DLL_LDFLAGS) -Wl,tclreg.exp -o $(TCLREGDLL) $(TMPDIR)/tclWinReg.$(OBJEXT) $(TCLLIB) $(DLL_LDLIBS) -ladvapi32 -mwindows -Wl,-e,_DllEntryPoint@12 -Wl,--image-base,0x66200000
540         rm -f $(TMPDIR)/tclreg.def
541 else
542 $(TCLREGDLL): $(TMPDIR)/tclWinReg.obj
543         link $(ldebug) $(dlllflags) -out:$@ $(TMPDIR)/tclWinReg.obj \
544                 $(conlibsdll) $(TCLLIB) -entry:_DllMainCRTStartup@12
545 endif
546
547 ifeq ($(OBJEXT),o)
548
549 $(CAT32): $(WINDIR)/cat.c
550         $(CC) -c $(CON_CFLAGS) $?
551         $(CC) -o $@ -Wl,-stack,16384 $(TMPDIR)/cat.$(OBJEXT) $(conlibs)
552
553 else
554
555 $(CAT32): $(WINDIR)/cat.c
556         $(CC) $(CON_CFLAGS) -Fo$(TMPDIR)/ $(WINDIR)/cat.c
557         link -subsystem:console -entry:mainCRTStartup -out:$@ -stack:16384 $(TMPDIR)/cat.obj $(conlibs)
558 endif
559
560 # $(CAT16): $(WINDIR)\cat.c
561 #       if exist $(cc16) $(cc16) $(DOS_CFLAGS) -Fo$(TMPDIR)\ $?
562 #       set LIB=$(TOOLS16)\lib
563 #       if exist $(cc16) $(link16) /NOLOGO /ONERROR:NOEXE /NOI /STACK:16384 \
564 #               $(TMPDIR)\cat.obj,$@,nul,llibce.lib,nul
565
566 $(TMPDIR)/tclcyg.def: $(DUMPEXTS) $(TCLOBJS)
567         echo 'EXPORTS' > tmp.def
568         -for o in $(TCLOBJS); do \
569           $(NM) --extern-only --defined-only $$o | sed -e 's/[^ ]* [^ ]* //' -e 's/^_//' | fgrep -v DllEntryPoint | fgrep -v DllMain | fgrep -v impure_ptr >> tmp.def; \
570         done
571         mv tmp.def $(TMPDIR)/tclcyg.def
572
573 $(TMPDIR)/plugin.def: $(DUMPEXTS) $(TCLOBJS)
574         echo 'EXPORTS' > tmp.def
575         -for o in $(TCLOBJS); do \
576           $(NM) --extern-only --defined-only $$o | sed -e 's/[^ ]* [^ ]* //' -e 's/^_//' | fgrep -v DllEntryPoint | fgrep -v DllMain | fgrep -v impure_ptr >> tmp.def; \
577         done
578         mv tmp.def $(TMPDIR)/plugin.def
579
580 #
581 # Special case object file targets
582 #
583
584 $(TMPDIR)/testMain.$(OBJEXT): $(WINDIR)/tclAppInit.c
585         $(CC) -c -o $(TMPDIR)/testMain.$(OBJEXT) $(TCL_CFLAGS) -DTCL_TEST $?
586
587 #
588 # Implicit rules
589 #
590
591 .SUFFIXES: .S .c .o .obj .s
592 ifeq ($(OBJEXT),o)
593 .c.$(OBJEXT):
594         $(CC) -c $(TCL_CFLAGS) $<
595 else
596 .c.$(OBJEXT):
597         $(CC) -c $(TCL_CFLAGS) -Dtry=__try -Dexcept=__except $<
598 endif
599
600 ifeq ($(OBJEXT),o)
601
602 tclres.$(OBJEXT): $(srcdir)/tcl.rc
603         $(WINDRES) --include $(GENERICDIR) --include $(WINDIR) --define __WIN32__ --define VS_VERSION_INFO=1 $(srcdir)/tcl.rc tclres.$(OBJEXT)
604
605 tclshres.$(OBJEXT): $(srcdir)/tclsh.rc
606         $(WINDRES) --include $(GENERICDIR) --include $(WINDIR) --define __WIN32__ --define VS_VERSION_INFO=1 $(srcdir)/tclsh.rc tclshres.$(OBJEXT)
607
608 else
609
610 tclres.$(OBJEXT): $(srcdir)/tcl.rc
611         rc -i$(GENERICDIR) -i$(WINDIR) -d__WIN32__ -dVS_VERSION_INFO=1 -fotclres.$(OBJEXT) $(srcdir)/tcl.rc 
612
613 tclshres.$(OBJEXT): $(srcdir)/tclsh.rc
614         rc -i$(GENERICDIR) -i$(WINDIR) -d__WIN32__ -dVS_VERSION_INFO=1 -fotclshres.$(OBJEXT) $(srcdir)/tclsh.rc 
615
616 endif
617
618 #{$(WINDIR)}.rc{$(TMPDIR)}.res:
619 #       $(rc32) -fo $@ -r -i $(GENERICDIR) -i $(WINDIR) -D__WIN32__ \
620 #               $(TCL_DEFINES) $<
621
622 clean:
623         rm -f *.exp *.a *.dll *.exe $(TMPDIR)/*.$(OBJEXT) *.res *.def
624         rm -f tcl.base tclreg.base tclplugin.base
625
626 Makefile: $(WINDIR)/Makefile.in config.status
627         $(SHELL) config.status
628
629 config.status: $(WINDIR)/configure
630         ./config.status --recheck