GSS_S_PROMPTING_NEEDED is a bit
[cyrus-sasl.git] / sample / NTMakefile
1 !INCLUDE ..\win32\common.mak
2
3 ### Also:- client.exe server.exe
4 sample_apps=sample-client.exe sample-server.exe
5 sample_out=sample-client.pdb sample-server.pdb client.pdb server.pdb
6
7 server_SOURCES = server.c common.c common.h
8 client_SOURCES = client.c common.c common.h
9 compat_sources = getaddrinfo.c getnameinfo.c
10 sample_client_SOURCES = sample-client.c
11 sample_server_SOURCES = sample-server.c
12
13 common_objs = common.obj
14 server_objs = server.obj
15 client_objs = client.obj
16 compat_objs = getaddrinfo.obj getnameinfo.obj
17 sample_client_objs = sample-client.obj
18 sample_server_objs = sample-server.obj
19
20 !IF $(TARGET_WIN_SYSTEM) < 51
21 common_objs = $(common_objs) $(compat_objs)
22 !ENDIF 
23
24 all_objs = $(common_objs) $(server_objs) $(client_objs) $(sample_client_objs) $(sample_server_objs)
25 all_out = $(sample_apps) $(sample_out)
26
27 DB_FLAGS = /I $(DB_INCLUDE)
28 CPPFLAGS = /I "..\win32\include" /I "." /I "..\include" $(DB_FLAGS) /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL"
29 CPPFLAGS = $(CPPFLAGS) /DNEED_GETOPT
30
31 !IF $(TARGET_WIN_SYSTEM) >= 51
32 CPPFLAGS = /D TARGET_WIN_SYSTEM=$(TARGET_WIN_SYSTEM) $(CPPFLAGS)
33 !ENDIF 
34
35 SASL_LIB=/libpath:"..\lib" libsasl.lib
36
37 # EXTRA_LIBS is automatically included into LINK32EXE_FLAGS/LINK32DLL_FLAGS
38 EXTRA_LIBS=$(SASL_LIB)
39
40 # Where to install files from this directory
41 bindir = $(prefix)\bin
42
43 all : all-recursive
44
45 #
46 # /I flag to xcopy tells to treat the last parameter as directory and create all missing levels
47 #
48 # In order to force xcopy not to confirm if the second parameter is file or directory,
49 # the first parameter has to contain a wildcard character. For example, we use libsasl.l*,
50 # instead of libsasl.lib. Ugly, but works!
51 #
52 # Note, that we will copy all executabless here, not just $(sample_apps). This is a bug, but it allows
53 # us to copy optionally built executables, which might not be in $(sample_apps). The latter is a feature.
54 #
55 install: $(sample_apps)
56         @xcopy *.exe $(bindir) /I /F /Y
57
58 all-recursive : $(sample_apps)
59
60 server.exe: $(server_objs) $(common_objs)
61         $(LINK32EXE) @<< $(LINK32EXE_FLAGS) /pdb:"server.pdb" /out:"server.exe" $(server_objs) $(common_objs)
62 <<
63
64 client.exe: $(client_objs) $(common_objs)
65         $(LINK32EXE) @<< $(LINK32EXE_FLAGS) /pdb:"client.pdb" /out:"client.exe" $(client_objs) $(common_objs)
66 <<
67
68 sample-server.exe: $(sample_server_objs)
69         $(LINK32EXE) @<< $(LINK32EXE_FLAGS) /pdb:"sample-server.pdb" /out:"sample-server.exe" $(sample_server_objs)
70 <<
71
72 sample-client.exe: $(sample_client_objs)
73         $(LINK32EXE) @<< $(LINK32EXE_FLAGS) /pdb:"sample-client.pdb" /out:"sample-client.exe" $(sample_client_objs)
74 <<
75
76 getaddrinfo.c: ..\lib\getaddrinfo.c
77         copy ..\lib\getaddrinfo.c .
78
79 getnameinfo.c: ..\lib\getnameinfo.c
80         copy ..\lib\getnameinfo.c .
81
82 CLEAN :
83         -@erase $(all_objs)
84         -@erase "*.idb"
85         -@erase "*.pch"
86         -@erase "*.pdb"
87         -@erase $(all_out)
88         -@erase getaddrinfo.c
89
90 .c.obj::
91    $(CPP) @<<
92    $(CPP_PROJ) $< 
93 <<
94
95 .cpp.obj::
96    $(CPP) @<<
97    $(CPP_PROJ) $< 
98 <<
99
100 .cxx.obj::
101    $(CPP) @<<
102    $(CPP_PROJ) $< 
103 <<