Imported Upstream version 1.17
[platform/upstream/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)secure.obj \
29           $(OUTPRE)tls.obj \
30           $(OUTPRE)util.obj \
31           $(OUTPRE)win-utils.obj
32
33 ##### Options
34 # Set NODEBUG if building release instead of debug
35
36 #BUILDTOP is krb5/src and is relative to krb5/src/ccapi/lib/win, for making Makefile.
37 BUILDTOP= ..\..\..
38 CCAPI   = $(BUILDTOP)\CCAPI
39 CO      = $(CCAPI)\common
40 COWIN   = $(CCAPI)\common\win
41 CCUTIL  = $(CCAPI)\common\win\OldCC
42 LIBDIR  = $(CCAPI)\lib
43 LIBWIN  = $(LIBDIR)\win
44 POSIX   = $(BUILDTOP)\lib\krb5\posix
45 OLDCC   = $(LIBWIN)\OldCC
46 SRCTMP  = $(LIBWIN)\srctmp
47
48 !if defined(KRB5_KFW_COMPILE)
49 KFWINC= /I$(BUILDTOP)\..\..\krbcc\include
50 !endif
51
52 # Because all the sources are pulled together into the temp directory SRCTMP,
53 #  the only includes we need are to directories outside of ccapi.
54 LOCALINCLUDES = /I..\$(BUILDTOP) /I..\$(BUILDTOP)\include /I..\$(BUILDTOP)\include\krb5 $(KFWINC) \
55     -I..\$(BUILDTOP)\util\et
56 MIDLINCLUDES  = /I..\$(BUILDTOP)\include
57
58 CPPFLAGS = $(CPPFLAGS) /EHsc -D_CRTAPI1=_cdecl -D_CRTAPI2=_cdecl -DWINVER=0x0501 \
59 -D_WIN32_WINNT=0x0501 -D_CRT_SECURE_NO_WARNINGS $(cvarsdll)
60
61
62 ##### Linker
63 LINK    = link
64 LIBS    = ..\$(CLIB) ..\$(SLIB) kernel32.lib ws2_32.lib user32.lib advapi32.lib
65 LFLAGS  = /nologo $(LOPTS)
66
67 all: Makefile copysrc midl $(OUTPRE)$(CCLIB).dll finish
68
69 ccs_request.h ccs_request_c.c ccs_request_s.c : ccs_request.idl ccs_request.acf
70     midl $(MIDL_OPTIMIZATION) $(MIDLI) -oldnames -cpp_cmd $(CC) -cpp_opt "-E" \
71     ccs_request.idl
72
73 ccs_reply.h   ccs_reply_c.c   ccs_reply_s.c   : ccs_reply.idl   ccs_reply.acf
74     midl $(MIDL_OPTIMIZATION) $(MIDLI) -oldnames -cpp_cmd $(CC) -cpp_opt "-E" \
75     ccs_reply.idl
76
77 copysrc :
78     echo "Copying all sources needed to build $(CCLIB).dll to $(SRCTMP)"
79     if NOT exist $(SRCTMP)\nul mkdir $(SRCTMP)
80     xcopy /D/Y   $(CO)\*.*     $(SRCTMP)
81     xcopy /D/Y   $(COWIN)\*.*  $(SRCTMP)
82     xcopy /D/Y   $(CCUTIL)\*.* $(SRCTMP)
83     xcopy /D/Y   $(LIBDIR)\*.* $(SRCTMP)
84     xcopy /D/Y   $(LIBWIN)\*.* $(SRCTMP)
85     xcopy /D/Y   $(OLDCC)\*.*  $(SRCTMP)
86     cd $(SRCTMP)
87     if NOT exist $(OUTPRE)\nul mkdir $(OUTPRE)
88
89 midl : ccs_request.h ccs_reply.h
90
91 VERSIONRC = $(BUILDTOP)\..\windows\version.rc
92 CCLIBRES = $(OUTPRE)$(CCLIB).res
93 # Main program:
94 $(CCLIBRES): $(VERSIONRC)
95         $(RC) $(RCFLAGS) -DCCAPI_LIB -fo $@ -r $**
96
97 $(OUTPRE)$(CCLIB).dll: $(OBJS) $(CCLIB).def $(CCLIBRES)
98         $(LINK) $(LFLAGS) -entry:$(ENTRYPOINT) -dll /map:$*.map /out:$@ /DEF:$(CCLIB).def $(OBJS) \
99             /implib:$(CCLIB).lib $(dllflags) $(LIBS) $(KFWLIB) $(CCLIBRES) rpcrt4.lib $(conlibsdll) $(conflags)
100
101 $(CCLIB).def:
102     echo ;$(CCLIB).def is generated by a Makefile rule. > $(CCLIB).def
103     echo HEAPSIZE       8192  >> $(CCLIB).def
104     echo EXPORTS          >> $(CCLIB).def
105     type ccapi.exports    >> $(CCLIB).def
106     type ccapi_v2.exports >> $(CCLIB).def
107     type debug.exports    >> $(CCLIB).def
108
109 finish:
110     echo "Finished in ccapi/lib/win."
111     cd ..
112
113 install:
114     echo "Doing nothing for make install"
115
116 clean:
117         if exist $(OUTPRE)*.exe del $(OUTPRE)*.exe
118         if exist $(OUTPRE)*.obj del $(OUTPRE)*.obj
119         if exist $(OUTPRE)*.res del $(OUTPRE)*.res
120         if exist $(OUTPRE)*.map del $(OUTPRE)*.map
121         if exist $(OUTPRE)*.pdb del $(OUTPRE)*.pdb
122         if exist *.err del *.err
123     if exist $(SRCTMP) rmdir /s /q $(SRCTMP)