pull up r24469, r24530, r24533, r24534, r24535, r24537 from trunk
[krb5.git] / src / ccapi / lib / win / Makefile.in
1 # makefile: Constructs the Kerberos for Windows CCAPI DLL.
2 #
3 OBJS    = $(OUTPRE)ccapi_ccache.obj \
4           $(OUTPRE)ccapi_ccache_iterator.obj \
5           $(OUTPRE)ccapi_context.obj \
6           $(OUTPRE)ccapi_context_change_time.obj \
7           $(OUTPRE)ccapi_credentials.obj \
8           $(OUTPRE)ccapi_credentials_iterator.obj \
9           $(OUTPRE)ccapi_ipc.obj \
10           $(OUTPRE)ccapi_err.obj \
11           $(OUTPRE)ccapi_os_ipc.obj \
12           $(OUTPRE)ccapi_string.obj \
13           $(OUTPRE)ccapi_v2.obj \
14           $(OUTPRE)cci_array_internal.obj \
15           $(OUTPRE)cci_cred_union.obj \
16           $(OUTPRE)cci_debugging.obj \
17           $(OUTPRE)cci_identifier.obj \
18           $(OUTPRE)cci_message.obj \
19           $(OUTPRE)cci_os_debugging.obj \
20           $(OUTPRE)cci_os_identifier.obj \
21           $(OUTPRE)ccs_reply_proc.obj \
22           $(OUTPRE)ccs_reply_s.obj \
23           $(OUTPRE)ccs_request_c.obj \
24           $(OUTPRE)ccutils.obj \
25           $(OUTPRE)client.obj \
26           $(OUTPRE)dllmain.obj \
27           $(OUTPRE)init.obj \
28           $(OUTPRE)rpc.obj \
29           $(OUTPRE)secure.obj \
30           $(OUTPRE)tls.obj \
31           $(OUTPRE)util.obj \
32           $(OUTPRE)win-utils.obj
33
34 ##### Options
35 # Set NODEBUG if building release instead of debug
36
37 #BUILDTOP is krb5/src and is relative to krb5/src/ccapi/lib/win, for making Makefile.
38 BUILDTOP= ..\..\..
39 CCAPI   = $(BUILDTOP)\CCAPI
40 CO      = $(CCAPI)\common
41 COWIN   = $(CCAPI)\common\win
42 CCUTIL  = $(CCAPI)\common\win\OldCC
43 LIBDIR  = $(CCAPI)\lib
44 LIBWIN  = $(LIBDIR)\win
45 POSIX   = $(BUILDTOP)\lib\krb5\posix
46 OLDCC   = $(LIBWIN)\OldCC
47 SRCTMP  = $(LIBWIN)\srctmp
48
49 !if defined(KRB5_KFW_COMPILE)
50 KFWINC= /I$(BUILDTOP)\..\..\krbcc\include
51 !endif
52
53 # Because all the sources are pulled together into the temp directory SRCTMP,
54 #  the only includes we need are to directories outside of ccapi.
55 LOCALINCLUDES = /I..\$(BUILDTOP) /I..\$(BUILDTOP)\include /I..\$(BUILDTOP)\include\krb5 $(KFWINC) \
56     -I..\$(BUILDTOP)\util\et
57 MIDLINCLUDES  = /I..\$(BUILDTOP)\include
58
59 CPPFLAGS = $(CPPFLAGS) /EHsc -D_CRTAPI1=_cdecl -D_CRTAPI2=_cdecl -DWINVER=0x0501 \
60 -D_WIN32_WINNT=0x0501 -D_CRT_SECURE_NO_WARNINGS $(cvarsdll)
61
62
63 ##### Linker
64 LINK    = link
65 LIBS    = ..\$(CLIB) ..\$(SLIB) kernel32.lib ws2_32.lib user32.lib advapi32.lib
66 LFLAGS  = /nologo $(LOPTS)
67
68 all:: Makefile copysrc midl $(OUTPRE)ccapi.dll finish
69
70 ccs_request.h ccs_request_c.c ccs_request_s.c : ccs_request.idl ccs_request.acf
71     midl $(MIDL_OPTIMIZATION) $(MIDLI) -oldnames -cpp_cmd $(CC) -cpp_opt "-E" \
72     ccs_request.idl
73
74 ccs_reply.h   ccs_reply_c.c   ccs_reply_s.c   : ccs_reply.idl   ccs_reply.acf
75     midl $(MIDL_OPTIMIZATION) $(MIDLI) -oldnames -cpp_cmd $(CC) -cpp_opt "-E" \
76     ccs_reply.idl
77
78 copysrc :
79     echo "Copying all sources needed to build ccapi.dll to $(SRCTMP)"
80     if NOT exist $(SRCTMP)\nul mkdir $(SRCTMP)
81     xcopy /D/Y   $(CO)\*.*     $(SRCTMP)
82     xcopy /D/Y   $(COWIN)\*.*  $(SRCTMP)
83     xcopy /D/Y   $(CCUTIL)\*.* $(SRCTMP)
84     xcopy /D/Y   $(LIBDIR)\*.* $(SRCTMP)
85     xcopy /D/Y   $(LIBWIN)\*.* $(SRCTMP)
86     xcopy /D/Y   $(OLDCC)\*.*  $(SRCTMP)
87     cd $(SRCTMP)
88     if NOT exist $(OUTPRE)\nul mkdir $(OUTPRE)
89
90 midl : ccs_request.h ccs_reply.h
91
92 # Main program:
93 $(OUTPRE)ccapi.dll: $(OBJS) ccapi.def
94         $(LINK) $(LFLAGS) -entry:_DllMainCRTStartup@12 -dll /map:$*.map /out:$@ /DEF:ccapi.def $(OBJS) \
95             /implib:ccapi.lib $(dllflags) $(LIBS) $(KFWLIB) $(SCLIB) rpcrt4.lib $(conlibsdll) $(conflags)
96
97 ccapi.def:
98     echo ;ccapi.def is generated by a Makefile rule. > ccapi.def
99     echo HEAPSIZE       8192  >> ccapi.def
100     echo EXPORTS          >> ccapi.def
101     type ccapi.exports    >> ccapi.def
102     type ccapi_v2.exports >> ccapi.def
103     type debug.exports    >> ccapi.def
104
105 finish:
106     echo "Finished in ccapi/lib/win."
107     cd ..
108
109 install::
110     echo "Doing nothing for make install"
111
112 clean::
113         if exist $(OUTPRE)*.exe del $(OUTPRE)*.exe
114         if exist $(OUTPRE)*.obj del $(OUTPRE)*.obj
115         if exist $(OUTPRE)*.res del $(OUTPRE)*.res
116         if exist $(OUTPRE)*.map del $(OUTPRE)*.map
117         if exist $(OUTPRE)*.pdb del $(OUTPRE)*.pdb
118         if exist *.err del *.err
119     if exist $(SRCTMP) rmdir /s /q $(SRCTMP)