Rename windows.in to win-pre.in
[krb5.git] / src / config / win-pre.in
1 WHAT=windows
2
3 all:: outpre-dir
4
5 all:: all-$(WHAT)
6 clean:: clean-$(WHAT)
7 install:: install-$(WHAT)
8 check:: check-$(WHAT)
9
10 all-windows::
11 clean-windows::
12 install-windows::
13 check-windows::
14
15 all-windows:: Makefile
16 clean-windows:: Makefile
17
18 #
19 # Figure out the CPU
20 #
21 !if !defined(CPU) || "$(CPU)" == ""
22 CPU=$(PROCESSOR_ARCHITECTURE)
23 !endif # CPU
24
25 !if "$(CPU)" == ""
26 CPU=i386
27 !endif
28
29 # Change x86 or X86 to i386
30 !if ( "$(CPU)" == "X86" ) || ( "$(CPU)" == "x86" )
31 CPU=i386
32 !endif # CPU == X86
33
34 !if ( "$(CPU)" != "i386" ) && ( "$(CPU)" != "ALPHA" )
35 !error Must specify CPU environment variable ( CPU=i386, CPU=ALPHA)
36 !endif
37 #
38 # End of figuring out CPU
39 #
40
41
42 # NOTE: ^ is an escape char for NMAKE.
43 !ifdef NODEBUG
44 OUTPRE_DBG=rel
45 !else
46 OUTPRE_DBG=dbg
47 !endif
48 OUTPRE1=obj
49 OUTPRE2=$(OUTPRE1)\$(CPU)
50 OUTPRE3=$(OUTPRE2)\$(OUTPRE_DBG)
51 OUTPRE=$(OUTPRE3)^\
52
53 $(OUTPRE):
54         -@if not exist $(OUTPRE1)\nul mkdir $(OUTPRE1)
55         -@if not exist $(OUTPRE2)\nul mkdir $(OUTPRE2)
56         -@if not exist $(OUTPRE3)\nul mkdir $(OUTPRE3)
57         -@if exist $(OUTPRE3)\nul echo Output will go to $(OUTPRE3).
58         -@if not exist $(OUTPRE3)\nul echo Could not create $(OUTPRE3).
59
60 clean-windows-dir::
61         -@if exist $(OUTPRE3)\nul rmdir $(OUTPRE3)
62         -@if exist $(OUTPRE2)\nul rmdir $(OUTPRE2)
63         -@if exist $(OUTPRE1)\nul rmdir $(OUTPRE1)
64
65 # Directory syntax:
66 #
67 # begin absolute path
68 ABS=^\
69 # begin relative path
70 REL=
71 # up-directory
72 U=..
73 # path separator
74 S=^\
75 # this is magic... should only be used for preceding a program invocation
76 C=.^\
77
78 srcdir = .
79 SRCTOP = $(srcdir)\$(BUILDTOP)
80
81 #
82 # The name of the C compiler for the target
83 #
84 CC=cl /nologo
85 CL=
86
87 PDB_OPTS=-Fd$(OUTPRE)\ -FD
88
89 # /ZI gives better debug info in each object file (MSVC 6.0 or higher).
90 # /Zi gives debug info in each object file.
91 # /Gs Avoid stack probes (they don't seem to work anyway)
92 # /Os optimize for space.  FIXME:  Do not use /Ox; it miscompiles the DES lib!
93 # /Od disable optimization (for debugging)
94 # /MD (Win32) thread safe, ML would be single threaded, don't build with ML
95
96 #
97 # CCOPTS  is for DLL compiles
98 # CCOPTS2 is for non-DLL compiles (EXEs, for example)
99 #
100 !ifdef NODEBUG
101 CCOPTS =/Os /W3 /MD $(PDB_OPTS) $(XTRA) $(DLL_FILE_DEF)
102 CCOPTS2=/Os /W3 $(PDB_OPTS) $(XTRA)
103 LOPTS=
104 !else
105 CCOPTS =/Od /ZI /W3 /MD $(PDB_OPTS) $(XTRA) $(DLL_FILE_DEF)
106 CCOPTS2=/Od /ZI /W3 $(PDB_OPTS) $(XTRA)
107 LOPTS=-debug
108 !endif
109
110 # XXX - NOTE: We should probably use DllMainCRTStartup
111 LINKOPTS=-incremental:no $(LOPTS) -nologo -dll -entry:DllMain
112 LINKOPTS2=-incremental:no $(LOPTS) -nologo
113
114 CPPFLAGS =  -I$(SRCTOP)\include -I$(SRCTOP)\include\krb5 
115 DEFS = $(CPPFLAGS)
116 CFLAGS2 = $(CCOPTS2) $(DEFS)
117
118 RM=$(BUILDTOP)\config\rm.bat
119 LIBECHO=$(BUILDTOP)\util\windows\$(OUTPRE)libecho
120 CP=copy
121 MV=ren
122 LN=copy
123 LIBCMD=lib
124 AWK=rem
125 RC = rc
126 CVTRES = cvtres
127
128 CLIB=$(BUILDTOP)\lib\$(OUTPRE)comerr32.lib
129 PLIB=$(BUILDTOP)\lib\$(OUTPRE)xpprof32.lib
130 KLIB=$(BUILDTOP)\lib\$(OUTPRE)krb5_32.lib
131 K4LIB=$(BUILDTOP)\lib\$(OUTPRE)krb4_32.lib
132
133 GLIB=$(BUILDTOP)\lib\$(OUTPRE)gssapi32.lib
134 WLIB=
135
136 ARADD=rem
137 RANLIB=rem
138 ARCHIVE=rem
139
140 LIBEXT=lib
141 OBJEXT=obj
142 EXEEXT=.exe
143
144 MFLAGS=$(MAKEFLAGS)
145
146 {}.rc{$(OUTPRE)}.res:
147         $(RC) $(RCFLAGS) -fo $@ -r $<
148
149 {}.c{$(OUTPRE)}.obj:
150         $(CC) $(CFLAGS) -Fo$(OUTPRE)\ -c $<
151
152 {}.cxx{$(OUTPRE)}.obj:
153         $(CC) $(CFLAGS) -Fo$(OUTPRE)\ -c $<
154
155 {}.cpp{$(OUTPRE)}.obj:
156         $(CC) $(CFLAGS) -Fo$(OUTPRE)\ -c $<
157
158 #
159 # End of Win32 pre-config lines (config/win-pre.in)
160 #
161