Windows: Platform specific MIDL output
[openafs.git] / src / WINNT / afsd / NTMakefile
1 # Copyright 2000, International Business Machines Corporation and others.
2 # All Rights Reserved.
3 #
4 # This software has been released under the terms of the IBM Public
5 # License.  For details, see the LICENSE file in the top-level source
6 # directory or online at http://www.openafs.org/dl/license10.html
7
8 AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) /D"_AFXDLL" /DSMB_UNICODE \
9         -I$(DESTDIR)\include\afs -I$(DESTDIR)\include\rx \
10         -I..\afsrdr\common -I..\afsrdr\user -I$(HEIMINC)
11
12 AFSDEV_NETGUI = 1
13 RELDIR=WINNT\afsd
14 !INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
15 !INCLUDE ..\..\config\NTMakefile.version
16
17 EXEDIR = $(DESTDIR)\root.client\usr\vice\etc
18
19 ############################################################################
20 # Definitions for installing header files
21
22 INCFILEDIR = $(DESTDIR)\include\afs  # header file install directory
23
24 # afsdicon and below added for WINNT\extra support
25
26 INCFILES =\
27         $(INCFILEDIR)\afsd.h \
28         $(INCFILEDIR)\cm.h \
29         $(INCFILEDIR)\cm_buf.h \
30         $(INCFILEDIR)\cm_cell.h \
31         $(INCFILEDIR)\cm_config.h \
32         $(INCFILEDIR)\cm_conn.h \
33         $(INCFILEDIR)\cm_error.h \
34         $(INCFILEDIR)\cm_ioctl.h \
35         $(INCFILEDIR)\cm_getaddrs.h \
36         $(INCFILEDIR)\cm_scache.h \
37         $(INCFILEDIR)\cm_server.h \
38         $(INCFILEDIR)\cm_user.h \
39         $(INCFILEDIR)\cm_dns.h \
40         $(INCFILEDIR)\cm_utils.h \
41         $(INCFILEDIR)\fs_acl.h \
42         $(INCFILEDIR)\fs_utils.h \
43         $(INCFILEDIR)\krb.h \
44         $(INCFILEDIR)\krb_prot.h \
45         $(INCFILEDIR)\cm_dir.h \
46         $(INCFILEDIR)\smb.h \
47         $(INCFILEDIR)\smb3.h \
48         $(INCFILEDIR)\smb_iocons.h \
49         $(INCFILEDIR)\smb_ioctl.h \
50         $(INCFILEDIR)\smb_rpc.h \
51         $(INCFILEDIR)\afsrpc.h \
52 !IFDEF OSICRASH
53         $(INCFILEDIR)\afsdcrash.h \
54 !ENDIF
55         $(INCFILEDIR)\cm_dns_private.h \
56         $(INCFILEDIR)\lanahelper.h \
57         $(INCFILEDIR)\afsdicon.h \
58         $(INCFILEDIR)\cm_callback.h \
59         $(INCFILEDIR)\cm_aclent.h \
60         $(INCFILEDIR)\cm_volume.h \
61         $(INCFILEDIR)\cm_volstat.h \
62         $(INCFILEDIR)\cm_dcache.h \
63         $(INCFILEDIR)\cm_access.h \
64         $(INCFILEDIR)\cm_eacces.h \
65         $(INCFILEDIR)\cm_vnodeops.h \
66         $(INCFILEDIR)\cm_dir.h \
67         $(INCFILEDIR)\cm_utils.h \
68         $(INCFILEDIR)\cm_daemon.h \
69         $(INCFILEDIR)\cm_ioctl.h \
70         $(INCFILEDIR)\cm_dnlc.h \
71         $(INCFILEDIR)\cm_buf.h \
72         $(INCFILEDIR)\cm_freelance.h \
73         $(INCFILEDIR)\cm_memmap.h \
74         $(INCFILEDIR)\cm_performance.h \
75         $(INCFILEDIR)\cm_nls.h \
76         $(INCFILEDIR)\afsd_eventlog.h \
77         $(INCFILEDIR)\afsd_eventmessages.h \
78         $(INCFILEDIR)\afskfw.h \
79         $(INCFILEDIR)\afsicf.h \
80 #       $(INCFILEDIR)\krbcompat_delayload.h
81
82
83 $(INCFILEDIR)\krbcompat_delayload.h: $(HEIMINC)\krbcompat_delayload.h
84         $(COPY) $< $@
85
86 IDLFILES =\
87         afsrpc.h $(OUT)\afsrpc_$(CPU)_c.obj
88
89 CONFOBJS=$(OUT)\cm_config.obj \
90          $(OUT)\cm_dns.obj \
91          $(OUT)\cm_nls.obj
92
93 $(CONFOBJS):
94
95 RXOBJS = $(OUT)\xdr_int32.obj $(OUT)\xdr_int64.obj
96
97 $(RXOBJS):
98
99 RX= ..\..\rx
100
101 $(RXOBJS): $(RX)\$$(@B).c
102         $(C2OBJ) -I$(RX) $**
103
104 $(IDLFILES):afsrpc.idl
105         midl $(MIDL_FLAGS) $(AFSDEV_AUXMIDLFLAGS) /app_config /cstub afsrpc_$(CPU)_c.c /sstub afsrpc_$(CPU)_s.c $?
106
107 ms-srvsvc.h ms-srvsvc_$(CPU)_s.c: ms-srvsvc.idl
108         midl $(MIDL_FLAGS) $(AFSDEV_AUXMIDLFLAGS) /Os /cstub ms-srvsvc_$(CPU)_c.c /sstub ms-srvsvc_$(CPU)_s.c ms-srvsvc.idl
109
110 ms-wkssvc.h ms-wkssvc_$(CPU)_s.c: ms-wkssvc.idl
111         midl $(MIDL_FLAGS) $(AFSDEV_AUXMIDLFLAGS) /Os /cstub ms-wkssvc_$(CPU)_c.c /sstub ms-wkssvc_$(CPU)_s.c ms-wkssvc.idl
112
113 $(OUT)\ms-srvsvc_$(CPU)_s.obj: ms-srvsvc_$(CPU)_s.c
114         $(C2OBJ) /FImsrpc.h /Fo$@ $**
115
116 $(OUT)\ms-wkssvc_$(CPU)_s.obj: ms-wkssvc_$(CPU)_s.c
117         $(C2OBJ) /FImsrpc.h /Fo$@ $**
118
119 AFSDOBJS=\
120         $(OUT)\rawops.obj \
121         $(OUT)\afsd_init.obj \
122         $(OUT)\cm_btree.obj \
123         $(OUT)\cm_cell.obj \
124         $(OUT)\cm_server.obj \
125         $(OUT)\cm_volume.obj \
126         $(OUT)\cm_volstat.obj \
127         $(OUT)\cm_config.obj \
128         $(OUT)\cm_conn.obj \
129         $(OUT)\cm_user.obj \
130         $(OUT)\cm_buf.obj \
131         $(OUT)\cm_scache.obj \
132         $(OUT)\cm_dcache.obj \
133         $(OUT)\cm_direct.obj \
134         $(OUT)\cm_access.obj \
135         $(OUT)\cm_eacces.obj \
136         $(OUT)\cm_getaddrs.obj \
137         $(OUT)\cm_callback.obj \
138         $(OUT)\cm_vnodeops.obj \
139         $(OUT)\cm_dir.obj \
140         $(OUT)\cm_utils.obj \
141         $(OUT)\largeintdotnet.obj \
142         $(OUT)\smb.obj \
143         $(OUT)\smb3.obj \
144         $(OUT)\smb_ioctl.obj \
145         $(OUT)\smb_rpc.obj \
146         $(OUT)\msrpc.obj \
147         $(OUT)\cm_ioctl.obj \
148         $(OUT)\cm_daemon.obj \
149         $(OUT)\cm_aclent.obj \
150         $(OUT)\cm_dnlc.obj \
151         $(OUT)\cm_rpc.obj \
152         $(OUT)\cm_memmap.obj \
153         $(OUT)\cm_performance.obj \
154         $(OUT)\cm_nls.obj \
155         $(OUT)\afsrpc_$(CPU)_s.obj \
156 !IFDEF OSICRASH
157         $(OUT)\afsdcrash.obj \
158 !ENDIF
159         $(OUT)\cm_freelance.obj \
160         $(OUT)\afsd_eventlog.obj \
161         $(OUT)\afsd_flushvol.obj \
162         $(OUT)\afsicf.obj \
163         $(OUT)\ms-srvsvc_$(CPU)_s.obj \
164         $(OUT)\ms-wkssvc_$(CPU)_s.obj \
165         $(OUT)\rpc_wkssvc.obj \
166         $(OUT)\rpc_srvsvc.obj \
167         $(OUT)\AFS_component_version_number.obj \
168         $(OUT)\RDRInit.obj \
169         $(OUT)\RDRFunction.obj \
170         $(OUT)\RDRIoctl.obj \
171         $(OUT)\RDRPipe.obj
172
173 $(AFSDOBJS):
174
175 $(OUT)\RDRInit.obj: ..\afsrdr\user\RDRInit.cpp ..\afsrdr\user\RDRPrototypes.h ..\afsrdr\user\RDRIoctl.h
176         $(CPP2OBJ) ..\afsrdr\user\RDRInit.cpp
177
178 $(OUT)\RDRFunction.obj: ..\afsrdr\user\RDRFunction.c ..\afsrdr\user\RDRPrototypes.h ..\afsrdr\user\RDRIoctl.h
179         $(C2OBJ)  ..\afsrdr\user\RDRFunction.c
180
181 $(OUT)\RDRIoctl.obj: ..\afsrdr\user\RDRIoctl.c ..\afsrdr\user\RDRIoctl.h
182         $(C2OBJ)  ..\afsrdr\user\RDRIoctl.c
183
184 $(OUT)\RDRPipe.obj: ..\afsrdr\user\RDRPipe.c ..\afsrdr\user\RDRPipe.h
185         $(C2OBJ)  ..\afsrdr\user\RDRPipe.c
186
187 $(OUT)\cm_conn.obj: cm_conn.c
188         $(C2OBJ) -DAFS_PTHREAD_ENV /Fo$@ $**
189
190 FSOBJS=$(OUT)\fs.obj \
191        $(OUT)\fs_acl.obj \
192        $(OUT)\fs_utils.obj \
193        $(OUT)\cm_nls.obj \
194        $(OUT)\parsemode.obj
195
196 CMDBGOBJS=$(OUT)\cmdebug.obj
197
198 $(CMDBGOBJS): $(AFSROOT)\src\venus\cmdebug.c
199         $(C2OBJ) -DAFS_PTHREAD_ENV /Fo$@ $**
200
201 AFSIOOBJS=$(OUT)\afsio.obj
202
203 $(AFSIOOBJS): $(AFSROOT)\src\venus\afsio.c
204         $(C2OBJ) -DAFS_PTHREAD_ENV /Fo$@ $**
205
206 SLOBJS= $(OUT)\symlink.obj \
207         $(OUT)\fs_utils.obj \
208         $(OUT)\cm_nls.obj
209
210 ILIBDIR = $(DESTDIR)\lib
211
212 #
213 # Rules for message compiler info for logging events
214 #
215 $(INCFILEDIR)\afsd_eventmessages.h:  afsd_eventmessages.mc
216         mc afsd_eventmessages.mc
217
218 ############################################################################
219 #
220 # Flags for linking LOGON DLL'S
221 #
222
223 LOGONLINKFLAGS = -entry:DllEntryPoint
224
225
226 ############################################################################
227 #
228 # IDL COMPILATION
229 #
230
231 MIDL_FLAGS=/app_config \
232            /Zp4 \
233            /cpp_cmd $(cc) \
234            /cpp_opt "-E" \
235            /nologo
236
237 .SUFFIXES: .h .idl
238
239 .idl.h:
240         midl $(MIDL_FLAGS) $(AFSDEV_AUXMIDLFLAGS) $<
241
242
243 AFSD_SDKLIBS =\
244         netapi32.lib \
245         dnsapi.lib \
246         mpr.lib \
247         rpcrt4.lib \
248         user32.lib \
249         Dbghelp.lib \
250         strsafe.lib \
251         mpr.lib \
252         secur32.lib \
253         ole32.lib \
254         oleaut32.lib \
255         iphlpapi.lib \
256         shell32.lib \
257         shlwapi.lib
258
259 ############################################################################
260 # krbcompat_delayload.obj
261
262 KCOMPAT_OBJ = $(DESTDIR)\lib\krbcompat_delayload.obj
263
264 $(KCOMPAT_OBJ): $(OUT)\krbcompat_delayload.obj
265         copy /y $** $@
266
267 ############################################################################
268 # libafsconf.dll
269
270 CONF_DLLFILE = $(DESTDIR)\lib\libafsconf.dll
271
272 CONF_DLLLIBS = \
273     $(DESTDIR)\lib\afs\afsutil.lib \
274     $(DESTDIR)\lib\afs\afsreg.lib \
275     $(DESTDIR)\lib\afsroken.lib
276
277 $(CONF_DLLFILE): $(CONFOBJS) $(OUT)\libafsconf.res $(CONF_DLLLIBS)
278         $(DLLGUILINK) -def:libafsconf.def  $(AFSD_SDKLIBS)
279         $(_VC_MANIFEST_EMBED_DLL)
280         $(DLLPREP)
281         $(CODESIGN_USERLAND)
282         $(SYMSTORE_IMPORT)
283         $(MAKECYGLIB) --input-def libafsconf.def
284         $(DEL) $*.exp
285
286 ############################################################################
287 # lanahelper.lib
288
289 LANAHELPERLIB = $(DESTDIR)\lib\lanahelper.lib
290
291 LANAHELPERLIB_OBJS =\
292       $(OUT)\lanahelper.obj
293
294 $(LANAHELPERLIB_OBJS):
295
296 $(LANAHELPERLIB): $(LANAHELPERLIB_OBJS)
297       $(LIBARCH) netapi32.lib
298
299 ############################################################################
300 # afskfw.lib
301
302 AFSKFWLIB = $(DESTDIR)\lib\afskfw.lib
303
304 PTERROBJS=$(OUT)\pterror.obj
305
306 $(PTERROBJS): $(AFSROOT)\src\ptserver\pterror.c
307         $(C2OBJ) /Fo$@ $**
308
309 KTCERROBJS=$(OUT)\ktc_errors.obj
310
311 $(KTCERROBJS): $(AFSROOT)\src\auth\ktc_errors.c
312         $(C2OBJ) /Fo$@ $**
313
314 AFSKFWLIB_OBJS = $(OUT)\afskfw.obj
315
316 $(AFSKFWLIB_OBJS):
317
318 $(AFSKFWLIB): $(AFSKFWLIB_OBJS) $(PTERROBJS) $(KTCERROBJS)
319       $(LIBARCH)
320
321 ############################################################################
322 # afslogon.dll
323
324 LOGON_DLLFILE = $(DESTDIR)\root.client\usr\vice\etc\afslogon.dll
325
326 LOGON_DLLOBJS =\
327     $(OUT)\afslogon.obj \
328     $(OUT)\logon_ad.obj \
329     $(OUT)\afslogon.res \
330     $(OUT)\cm_nls.obj   \
331     $(KRBCOMPATRES)
332
333 LOGON_DLLLIBS =\
334     $(DESTDIR)\lib\afsauthent.lib \
335     $(DESTDIR)\lib\libafsconf.lib \
336     $(DESTDIR)\lib\afs\afscom_err.lib \
337     $(DESTDIR)\lib\afs\afsutil.lib \
338     $(DESTDIR)\lib\opr.lib \
339     $(DESTDIR)\lib\afsroken.lib \
340     $(DESTDIR)\lib\afsrpc.lib \
341     $(LANAHELPERLIB) \
342     $(AFSKFWLIB)
343
344 LOGON_DLLSDKLIBS =\
345         dnsapi.lib \
346         netapi32.lib \
347         mpr.lib \
348         advapi32.lib \
349         secur32.lib \
350         strsafe.lib \
351         oleaut32.lib \
352         ole32.lib \
353         adsiid.lib \
354         activeds.lib \
355         rpcrt4.lib \
356         user32.lib \
357         userenv.lib \
358         shell32.lib \
359         delayimp.lib
360
361 $(LOGON_DLLFILE): $(LOGON_DLLOBJS) $(LOGON_DLLLIBS) $(HEIMDEPS)
362         $(DLLGUILINK) $(LOGONLINKFLAGS) -def:afslogon.def $(LOGON_DLLSDKLIBS) $(HEIMLINKOPTS)
363         $(_VC_MANIFEST_EMBED_DLL)
364         $(DLLPREP)
365         $(CODESIGN_USERLAND)
366         $(SYMSTORE_IMPORT)
367         $(COPY) $*.lib $(DESTDIR)\lib
368         $(DEL) $*.lib $*.exp
369
370 ############################################################################
371 # Install target; primary makefile target
372
373 install_objs: $(CONF_DLLFILE) $(LANAHELPERLIB) $(OUT)\afsicf.obj $(OUT)\krbcompat_delayload.obj
374      $(COPY) $(OUT)\afsicf.obj $(DESTDIR)\lib
375      $(COPY) $(OUT)\krbcompat_delayload.obj $(DESTDIR)\lib
376
377 install_headers: $(IDLFILES) $(INCFILES) ms-wkssvc.h ms-srvsvc.h
378
379 install: install_headers install_objs $(CONF_DLLFILE) \
380         $(EXEDIR)\klog.exe \
381         $(EXEDIR)\tokens.exe \
382         $(EXEDIR)\unlog.exe \
383         $(EXEDIR)\afsd_service.exe \
384         $(EXEDIR)\fs.exe \
385         $(EXEDIR)\symlink.exe \
386         $(EXEDIR)\afsdacl.exe \
387         $(LOGON_DLLFILE) \
388         $(EXEDIR)\afsshare.exe \
389         $(DESTDIR)\bin\kpasswd.exe \
390         $(EXEDIR)\cmdebug.exe \
391         $(EXEDIR)\afscpcc.exe \
392         $(EXEDIR)\afsio.exe
393
394 install_libutils: install_headers $(CONF_DLLFILE) \
395         $(EXEDIR)\klog.exe \
396         $(EXEDIR)\tokens.exe \
397         $(EXEDIR)\unlog.exe \
398         $(EXEDIR)\fs.exe $(EXEDIR)\symlink.exe \
399         $(EXEDIR)\afsshare.exe \
400         $(DESTDIR)\bin\kpasswd.exe $(EXEDIR)\cmdebug.exe
401
402 ############################################################################
403 # Local clean target; augments predefined clean target
404
405 ############################################################################
406 # assorted exe's
407
408 EXELIBS = \
409         $(DESTDIR)\lib\afs\afsauth.lib \
410         $(DESTDIR)\lib\afs\afskauth.lib \
411         $(DESTDIR)\lib\afs\afsprot.lib \
412         $(DESTDIR)\lib\afs\afspioctl.lib \
413         $(DESTDIR)\lib\afs\afsaudit.lib \
414         $(DESTDIR)\lib\afs\afsutil.lib \
415         $(DESTDIR)\lib\afs\afscom_err.lib \
416         $(DESTDIR)\lib\afs\afsreg.lib \
417         $(DESTDIR)\lib\afs\afscmd.lib \
418         $(DESTDIR)\lib\afs\afsvldb.lib \
419         $(DESTDIR)\lib\afsubik.lib \
420         $(DESTDIR)\lib\afsrxkad.lib \
421         $(DESTDIR)\lib\afsrx.lib \
422         $(DESTDIR)\lib\afslwp.lib \
423         $(DESTDIR)\lib\libosi.lib \
424         $(DESTDIR)\lib\libafsconf.lib \
425         $(DESTDIR)\lib\opr.lib \
426         $(DESTDIR)\lib\afshcrypto.lib \
427         $(DESTDIR)\lib\afsroken.lib \
428         $(DESTDIR)\lib\afsrfc3961.lib
429
430 EXELIBS2 = \
431         $(DESTDIR)\lib\afsrpc.lib \
432         $(DESTDIR)\lib\afsauthent.lib \
433         $(DESTDIR)\lib\afs\mtafsint.lib \
434         $(DESTDIR)\lib\afs\afsprot.lib \
435         $(DESTDIR)\lib\afs\afspioctl.lib \
436         $(DESTDIR)\lib\afs\afscom_err.lib \
437         $(DESTDIR)\lib\afs\afscmd.lib \
438         $(DESTDIR)\lib\afs\mtafsutil.lib \
439         $(DESTDIR)\lib\afslwp.lib \
440         $(DESTDIR)\lib\libosi.lib \
441         $(DESTDIR)\lib\libafsconf.lib \
442         $(DESTDIR)\lib\opr.lib \
443         $(DESTDIR)\lib\afshcrypto.lib \
444         $(DESTDIR)\lib\afsroken.lib
445
446 LIBCMD = $(DESTDIR)\lib\afs\afscmd.lib
447
448 # klog.exe
449 $(EXEDIR)\klog.exe: $(OUT)\cklog.obj $(OUT)\klog.res $(DESTDIR)\lib\krbcompat_delayload.obj $(EXELIBS) $(HEIMDEPS)
450         $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib $(HEIMLINKOPTS)
451         $(_VC_MANIFEST_EMBED_EXE)
452         $(EXEPREP)
453         $(CODESIGN_USERLAND)
454         $(SYMSTORE_IMPORT)
455
456 # tokens.exe
457 $(EXEDIR)\tokens.exe: $(OUT)\ctokens.obj $(OUT)\tokens.res $(DESTDIR)\lib\krbcompat_delayload.obj $(EXELIBS) $(HEIMDEPS)
458         $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib $(HEIMLINKOPTS)
459         $(_VC_MANIFEST_EMBED_EXE)
460         $(EXEPREP)
461         $(CODESIGN_USERLAND)
462         $(SYMSTORE_IMPORT)
463
464 # unlog.exe
465 $(EXEDIR)\unlog.exe: $(OUT)\cunlog.obj $(OUT)\unlog.res $(DESTDIR)\lib\krbcompat_delayload.obj $(EXELIBS) $(HEIMDEPS)
466         $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib $(HEIMLINKOPTS)
467         $(_VC_MANIFEST_EMBED_EXE)
468         $(EXEPREP)
469         $(CODESIGN_USERLAND)
470         $(SYMSTORE_IMPORT)
471
472 # afscpcc.exe
473 $(EXEDIR)\afscpcc.exe: $(OUT)\afscpcc.obj $(OUT)\afscpcc.res $(DESTDIR)\lib\krbcompat_delayload.obj $(LOGON_DLLLIBS) $(HEIMDEPS)
474         $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib userenv.lib $(HEIMLINKOPTS)
475         $(_VC_MANIFEST_EMBED_EXE)
476         $(EXEPREP)
477         $(CODESIGN_USERLAND)
478         $(SYMSTORE_IMPORT)
479
480
481 # afsd.exe
482 AFSD_EXEFILE = $(EXEDIR)\afsd.exe
483
484 AFSD_EXELIBS =\
485         $(DESTDIR)\lib\libosi.lib \
486         $(DESTDIR)\lib\afsrpc.lib \
487         $(DESTDIR)\lib\afsauthent.lib \
488         $(DESTDIR)\lib\afs\mtafsvldb.lib \
489         $(DESTDIR)\lib\afs\mtafsint.lib \
490         $(DESTDIR)\lib\afs\mtafsutil.lib \
491         $(DESTDIR)\lib\libafsconf.lib \
492         $(DESTDIR)\lib\afs\afsreg.lib \
493         $(DESTDIR)\lib\afspthread.lib \
494         $(DESTDIR)\lib\opr.lib \
495         $(DESTDIR)\lib\afsroken.lib \
496         $(DESTDIR)\lib\afshcrypto.lib \
497         $(LANAHELPERLIB)
498
499 $(AFSD_EXEFILE): $(OUT)\afsd.obj $(AFSDOBJS) $(OUT)\afsd.res  $(RXOBJS) $(AFSD_EXELIBS)
500         $(EXEGUILINK) $(AFSD_SDKLIBS)
501         $(_VC_MANIFEST_EMBED_EXE)
502         $(EXEPREP)
503         $(CODESIGN_USERLAND)
504         $(SYMSTORE_IMPORT)
505
506 # afsd_service.exe
507 $(EXEDIR)\afsd_service.exe: $(OUT)\afsd_service.obj $(AFSDOBJS) $(OUT)\afsd_service.res  $(RXOBJS) $(AFSD_EXELIBS)
508         $(EXECONLINK) $(AFSD_SDKLIBS) /MAP /LARGEADDRESSAWARE
509         $(_VC_MANIFEST_EMBED_EXE)
510         $(EXEPREP)
511         $(CODESIGN_USERLAND)
512         $(SYMSTORE_IMPORT)
513
514 # fs.exe
515 $(EXEDIR)\fs.exe: $(FSOBJS) $(OUT)\fs.res $(EXELIBS) $(HEIMDEPS)
516         $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib $(HEIMLINKOPTS)
517         $(_VC_MANIFEST_EMBED_EXE)
518         $(EXEPREP)
519         $(CODESIGN_USERLAND)
520         $(SYMSTORE_IMPORT)
521
522 # cmdebug.exe
523 $(EXEDIR)\cmdebug.exe: $(CMDBGOBJS) $(OUT)\cmdebug.res
524         $(EXECONLINK) $(EXELIBS2) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib rpcrt4.lib
525         $(_VC_MANIFEST_EMBED_EXE)
526         $(EXEPREP)
527         $(CODESIGN_USERLAND)
528         $(SYMSTORE_IMPORT)
529
530 # afsio.exe
531 AFSCPLIB = \
532         $(DESTDIR)\lib\afs\afscp.lib
533
534 !IF "$(CPU)" == "IA64" || "$(CPU)" == "AMD64" || "$(CPU)" == "ALPHA64"
535 KFWLIBS = \
536     ..\kfw\lib\$(CPU)\krb5_64.lib \
537     ..\kfw\lib\$(CPU)\comerr64.lib \
538     dnsapi.lib mpr.lib delayimp.lib
539 LINKOPTS = /DELAYLOAD:krb5_64.dll /DELAYLOAD:comerr64.dll
540 !else
541 KFWLIBS = \
542     ..\kfw\lib\$(CPU)\krb5_32.lib \
543     ..\kfw\lib\$(CPU)\comerr32.lib \
544     dnsapi.lib mpr.lib delayimp.lib
545 LINKOPTS = /DELAYLOAD:krbv4w32.dll /DELAYLOAD:krb5_32.dll /DELAYLOAD:comerr32.dll
546 !endif
547
548 $(EXEDIR)\afsio.exe: $(AFSIOOBJS) $(OUT)\afsio.res $(RXOBJS) $(AFSD_EXELIBS) $(LIBCMD) $(AFSCPLIB)
549         $(EXECONLINK) $(KFWLIBS) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib rpcrt4.lib
550         $(_VC_MANIFEST_EMBED_EXE)
551         $(EXEPREP)
552         $(CODESIGN_USERLAND)
553         $(SYMSTORE_IMPORT)
554
555 # symlink.exe
556 $(EXEDIR)\symlink.exe: $(SLOBJS) $(OUT)\symlink.res  $(EXELIBS) $(HEIMDEPS)
557         $(EXECONLINK) dnsapi.lib mpr.lib iphlpapi.lib shell32.lib $(HEIMLINKOPTS)
558         $(_VC_MANIFEST_EMBED_EXE)
559         $(EXEPREP)
560         $(CODESIGN_USERLAND)
561         $(SYMSTORE_IMPORT)
562
563 # afsshare.exe
564 $(EXEDIR)\afsshare.exe: $(OUT)\afsshare.obj $(OUT)\afsshare.res $(EXELIBS)
565         $(EXECONLINK)
566         $(_VC_MANIFEST_EMBED_EXE)
567         $(EXEPREP)
568         $(CODESIGN_USERLAND)
569         $(SYMSTORE_IMPORT)
570
571 # afsdacl.exe
572 $(EXEDIR)\afsdacl.exe: $(OUT)\afsdacl.obj $(OUT)\afsdacl.res
573         $(EXECONLINK)
574         $(_VC_MANIFEST_EMBED_EXE)
575         $(EXEPREP)
576         $(CODESIGN_USERLAND)
577         $(SYMSTORE_IMPORT)
578
579 # kpasswd.exe - built in kauth, but rebuild here to make pthread-based,
580 #    which is required for Windows 95.  At some point it would be nice
581 #    for all commands to be pthread based, in which case they should
582 #    be built in a separate directory (perhaps tbin ala tviced) or
583 #    libafsauthent should be built earlier so that each command can
584 #    be built in its native directory.
585
586 KAUTH = ..\..\kauth
587
588 KPASSWD_OBJS =\
589         $(OUT)\kpasswd.obj \
590         $(OUT)\kkids.obj \
591         $(OUT)\kautils.obj \
592         $(OUT)\$(KAUTH)\kpasswd.res
593
594 KPASSWD_LIBS =\
595         $(DESTDIR)\lib\afsauthent.lib \
596         $(DESTDIR)\lib\afsrpc.lib \
597         $(DESTDIR)\lib\afs\afscmd.lib \
598         $(DESTDIR)\lib\afs\mtafsutil.lib \
599         $(DESTDIR)\lib\opr.lib \
600         $(DESTDIR)\lib\afshcrypto.lib \
601         $(DESTDIR)\lib\afsroken.lib
602
603 $(OUT)\kpasswd.obj: $(KAUTH)/kpasswd.c
604         $(C2OBJ) -DAFS_PTHREAD_ENV /Fo$@ $**
605
606 $(OUT)\kkids.obj: $(KAUTH)/kkids.c
607         $(C2OBJ) -DAFS_PTHREAD_ENV /Fo$@ $**
608
609 $(OUT)\kautils.obj: $(KAUTH)/kautils.c
610         $(C2OBJ) -DAFS_PTHREAD_ENV /Fo$@ $**
611
612 $(OUT)\kpasswd.res: $(KAUTH)\kpasswd.rc
613     $(RC) /Fo$@ $**
614
615 $(DESTDIR)\bin\kpasswd.exe: $(KPASSWD_OBJS) $(KPASSWD_LIBS)
616         $(DEL) $(DESTDIR)\bin\kpasswd.exe
617         $(EXECONLINK)
618         $(_VC_MANIFEST_EMBED_EXE)
619         $(EXEPREP)
620         $(CODESIGN_USERLAND)
621         $(SYMSTORE_IMPORT)
622
623 {$(HEIMDALSDKDIR)\src\}.c{$(OUT)}.obj:
624         $(C2OBJ) /Fo$@ $**
625
626 {$(HEIMDALSDKDIR)\inc\}.h{$(INCFILEDIR)}.h:
627         copy /y $< $@
628
629 ############################################################################
630 # generate versioninfo resources
631
632 $(OUT)\afsshare.res: afsshare.rc AFS_component_version_number.h
633
634 $(OUT)\fs.res: fs.rc AFS_component_version_number.h
635
636 $(OUT)\symlink.res: symlink.rc AFS_component_version_number.h
637
638 $(OUT)\klog.res: klog.rc AFS_component_version_number.h
639
640 $(OUT)\tokens.res: tokens.rc AFS_component_version_number.h
641
642 $(OUT)\unlog.res: unlog.rc AFS_component_version_number.h
643
644 $(OUT)\afscpcc.res: afscpcc.rc AFS_component_version_number.h
645
646 afsd_eventmessages.rc: $(INCFILEDIR)\afsd_eventmessages.h
647
648 $(OUT)\afsd_service.res: afsd_service.rc afsd_eventmessages.rc AFS_component_version_number.h
649
650 $(OUT)\afslogon.res: afslogon.rc AFS_component_version_number.h
651
652 $(OUT)\libafsconf.res: libafsconf.rc AFS_component_version_number.h
653
654 ############################################################################
655 clean::
656         $(DEL) $(OUT)\*.res
657         $(DEL) afsrpc.h
658         $(DEL) afsrpc_$(CPU)_?.*
659         $(DEL) ms-srvsvc.h
660         $(DEL) ms-srvsvc_$(CPU)_?.*
661         $(DEL) ms-wkssvc.h
662         $(DEL) ms-wkssvc_$(CPU)_?.*
663         $(DEL) afsd_eventmessages.h
664         $(DEL) afsd_eventmessages.rc
665         $(DEL) MSG?????.bin
666         $(DEL) $(CONF_DLLFILE)
667         $(DEL) $(LOGON_DLLFILE)
668
669 mkdir:
670
671 ############################################################################
672 # Tests
673
674 {test}.c{$(OUT)\}.obj:
675         $(C2OBJ) $<
676
677 test::
678
679 test:: btreetest
680
681 btreetest: "$(OUT)\btreetest.exe"
682         "$(OUT)\btreetest.exe"
683
684 $(OUT)\btreetest.exe: \
685                 $(OUT)\btreetest.obj \
686                 $(OUT)\cm_btree.obj \
687                 $(OUT)\cm_nls.obj \
688                 $(OUT)\cm_utils.obj \
689                 $(DESTDIR)\lib\libosi.lib
690         $(EXECONLINK)
691         $(_VC_MANIFEST_EMBED_EXE)
692         $(EXEPREP)