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