NTMakefile revision 1.1 1 1.1 elric ########################################################################
2 1.1 elric #
3 1.1 elric # Copyright (c) 2009, Secure Endpoints Inc.
4 1.1 elric # All rights reserved.
5 1.1 elric #
6 1.1 elric # Redistribution and use in source and binary forms, with or without
7 1.1 elric # modification, are permitted provided that the following conditions
8 1.1 elric # are met:
9 1.1 elric #
10 1.1 elric # - Redistributions of source code must retain the above copyright
11 1.1 elric # notice, this list of conditions and the following disclaimer.
12 1.1 elric #
13 1.1 elric # - Redistributions in binary form must reproduce the above copyright
14 1.1 elric # notice, this list of conditions and the following disclaimer in
15 1.1 elric # the documentation and/or other materials provided with the
16 1.1 elric # distribution.
17 1.1 elric #
18 1.1 elric # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 1.1 elric # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 1.1 elric # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 1.1 elric # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 1.1 elric # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 1.1 elric # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24 1.1 elric # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 1.1 elric # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 1.1 elric # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 1.1 elric # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28 1.1 elric # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.1 elric # POSSIBILITY OF SUCH DAMAGE.
30 1.1 elric #
31 1.1 elric
32 1.1 elric SUBDIRS=libtommath
33 1.1 elric
34 1.1 elric RELDIR=lib\hcrypto
35 1.1 elric
36 1.1 elric intcflags=-DKRB5 -DASN1_LIB -I$(HCRYPTOINCLUDEDIR) -DUSE_HCRYPTO_LTM=1
37 1.1 elric
38 1.1 elric !include ../../windows/NTMakefile.w32
39 1.1 elric
40 1.1 elric # Do dependencies first
41 1.1 elric
42 1.1 elric all:: subdirs
43 1.1 elric
44 1.1 elric clean:: clean-subdirs
45 1.1 elric
46 1.1 elric test:: test-subdirs
47 1.1 elric
48 1.1 elric # Include files
49 1.1 elric
50 1.1 elric HCRYPTOINCLUDEDIR=$(INCDIR)\hcrypto
51 1.1 elric
52 1.1 elric INCFILES= \
53 1.1 elric $(HCRYPTOINCLUDEDIR)\aes.h \
54 1.1 elric $(HCRYPTOINCLUDEDIR)\bn.h \
55 1.1 elric $(HCRYPTOINCLUDEDIR)\des.h \
56 1.1 elric $(HCRYPTOINCLUDEDIR)\dh.h \
57 1.1 elric $(HCRYPTOINCLUDEDIR)\dsa.h \
58 1.1 elric $(HCRYPTOINCLUDEDIR)\ec.h \
59 1.1 elric $(HCRYPTOINCLUDEDIR)\ecdh.h \
60 1.1 elric $(HCRYPTOINCLUDEDIR)\ecdsa.h \
61 1.1 elric $(HCRYPTOINCLUDEDIR)\engine.h \
62 1.1 elric $(HCRYPTOINCLUDEDIR)\evp.h \
63 1.1 elric $(HCRYPTOINCLUDEDIR)\evp-hcrypto.h \
64 1.1 elric $(HCRYPTOINCLUDEDIR)\evp-cc.h \
65 1.1 elric $(HCRYPTOINCLUDEDIR)\hmac.h \
66 1.1 elric $(HCRYPTOINCLUDEDIR)\md2.h \
67 1.1 elric $(HCRYPTOINCLUDEDIR)\md4.h \
68 1.1 elric $(HCRYPTOINCLUDEDIR)\md5.h \
69 1.1 elric $(HCRYPTOINCLUDEDIR)\pkcs12.h \
70 1.1 elric $(HCRYPTOINCLUDEDIR)\rand.h \
71 1.1 elric $(HCRYPTOINCLUDEDIR)\randi.h \
72 1.1 elric $(HCRYPTOINCLUDEDIR)\rc2.h \
73 1.1 elric $(HCRYPTOINCLUDEDIR)\rc4.h \
74 1.1 elric $(HCRYPTOINCLUDEDIR)\rsa.h \
75 1.1 elric $(HCRYPTOINCLUDEDIR)\sha.h \
76 1.1 elric $(HCRYPTOINCLUDEDIR)\ui.h
77 1.1 elric
78 1.1 elric mkincdir:
79 1.1 elric !if !exist($(HCRYPTOINCLUDEDIR))
80 1.1 elric $(MKDIR) $(HCRYPTOINCLUDEDIR)
81 1.1 elric !endif
82 1.1 elric
83 1.1 elric {}.h{$(HCRYPTOINCLUDEDIR)}.h:
84 1.1 elric $(CP) $** $@
85 1.1 elric
86 1.1 elric all:: mkincdir
87 1.1 elric
88 1.1 elric all:: $(INCFILES)
89 1.1 elric
90 1.1 elric # libhcrypto
91 1.1 elric
92 1.1 elric libhcrypto_OBJs = \
93 1.1 elric $(OBJ)\aes.obj \
94 1.1 elric $(OBJ)\bn.obj \
95 1.1 elric $(OBJ)\camellia.obj \
96 1.1 elric $(OBJ)\camellia-ntt.obj \
97 1.1 elric $(OBJ)\common.obj \
98 1.1 elric $(OBJ)\des.obj \
99 1.1 elric $(OBJ)\dh.obj \
100 1.1 elric $(OBJ)\dh-ltm.obj \
101 1.1 elric $(OBJ)\dh-tfm.obj \
102 1.1 elric $(OBJ)\dsa.obj \
103 1.1 elric $(OBJ)\evp.obj \
104 1.1 elric $(OBJ)\evp-hcrypto.obj \
105 1.1 elric $(OBJ)\evp-cc.obj \
106 1.1 elric $(OBJ)\engine.obj \
107 1.1 elric $(OBJ)\hmac.obj \
108 1.1 elric $(OBJ)\md2.obj \
109 1.1 elric $(OBJ)\md4.obj \
110 1.1 elric $(OBJ)\md5.obj \
111 1.1 elric $(OBJ)\pkcs5.obj \
112 1.1 elric $(OBJ)\pkcs12.obj \
113 1.1 elric $(OBJ)\rand-w32.obj \
114 1.1 elric $(OBJ)\rand.obj \
115 1.1 elric $(OBJ)\rc2.obj \
116 1.1 elric $(OBJ)\rc4.obj \
117 1.1 elric $(OBJ)\rijndael-alg-fst.obj \
118 1.1 elric $(OBJ)\rnd_keys.obj \
119 1.1 elric $(OBJ)\rsa.obj \
120 1.1 elric $(OBJ)\rsa-gmp.obj \
121 1.1 elric $(OBJ)\rsa-ltm.obj \
122 1.1 elric $(OBJ)\rsa-tfm.obj \
123 1.1 elric $(OBJ)\sha.obj \
124 1.1 elric $(OBJ)\sha256.obj \
125 1.1 elric $(OBJ)\sha512.obj \
126 1.1 elric $(OBJ)\ui.obj \
127 1.1 elric $(OBJ)\validate.obj
128 1.1 elric
129 1.1 elric $(LIBHCRYPTO): $(libhcrypto_OBJs)
130 1.1 elric $(LIBCON)
131 1.1 elric
132 1.1 elric all:: $(LIBHCRYPTO)
133 1.1 elric
134 1.1 elric clean::
135 1.1 elric -$(RM) $(LIBHCRYPTO)
136 1.1 elric
137 1.1 elric # Tests
138 1.1 elric
139 1.1 elric TESTLIB=$(OBJ)\libhctest.lib
140 1.1 elric
141 1.1 elric $(TESTLIB): \
142 1.1 elric $(OBJ)\des.obj \
143 1.1 elric $(OBJ)\ui.obj
144 1.1 elric $(LIBCON)
145 1.1 elric
146 1.1 elric test-binaries: \
147 1.1 elric $(OBJ)\destest.exe \
148 1.1 elric $(OBJ)\example_evp_cipher.exe \
149 1.1 elric $(OBJ)\mdtest.exe \
150 1.1 elric $(OBJ)\rc2test.exe \
151 1.1 elric $(OBJ)\rctest.exe \
152 1.1 elric $(OBJ)\test_bn.exe \
153 1.1 elric $(OBJ)\test_cipher.exe \
154 1.1 elric $(OBJ)\test_engine_dso.exe \
155 1.1 elric $(OBJ)\test_hmac.exe \
156 1.1 elric $(OBJ)\test_pkcs5.exe \
157 1.1 elric $(OBJ)\test_pkcs12.exe \
158 1.1 elric $(OBJ)\test_rsa.exe \
159 1.1 elric $(OBJ)\test_dh.exe \
160 1.1 elric $(OBJ)\test_rand.exe \
161 1.1 elric $(OBJ)\test_crypto.sh
162 1.1 elric
163 1.1 elric $(OBJ)\destest.exe: $(OBJ)\destest.obj $(TESTLIB) $(LIBROKEN)
164 1.1 elric $(EXECONLINK)
165 1.1 elric $(EXEPREP_NODIST)
166 1.1 elric
167 1.1 elric $(OBJ)\example_evp_cipher.exe: $(OBJ)\example_evp_cipher.obj $(TESTLIB) $(LIBHEIMDAL) $(LIBROKEN)
168 1.1 elric $(EXECONLINK)
169 1.1 elric $(EXEPREP_NODIST)
170 1.1 elric
171 1.1 elric $(OBJ)\mdtest.exe: $(OBJ)\mdtest.obj $(LIBHEIMDAL) $(LIBROKEN) $(OBJ)\sha512.obj
172 1.1 elric $(EXECONLINK)
173 1.1 elric $(EXEPREP_NODIST)
174 1.1 elric
175 1.1 elric $(OBJ)\rc2test.exe: $(OBJ)\rc2test.obj $(LIBHEIMDAL) $(LIBROKEN)
176 1.1 elric $(EXECONLINK)
177 1.1 elric $(EXEPREP_NODIST)
178 1.1 elric
179 1.1 elric $(OBJ)\rctest.exe: $(OBJ)\rctest.obj $(LIBHEIMDAL) $(LIBROKEN)
180 1.1 elric $(EXECONLINK)
181 1.1 elric $(EXEPREP_NODIST)
182 1.1 elric
183 1.1 elric $(OBJ)\test_bn.exe: $(OBJ)\test_bn.obj $(LIBHEIMDAL) $(LIBROKEN)
184 1.1 elric $(EXECONLINK)
185 1.1 elric $(EXEPREP_NODIST)
186 1.1 elric
187 1.1 elric $(OBJ)\test_cipher.exe: $(OBJ)\test_cipher.obj $(TESTLIB) $(LIBHEIMDAL) $(LIBROKEN) $(LIBVERS)
188 1.1 elric $(EXECONLINK)
189 1.1 elric $(EXEPREP_NODIST)
190 1.1 elric
191 1.1 elric $(OBJ)\test_engine_dso.exe: $(OBJ)\test_engine_dso.obj $(LIBHEIMDAL) $(LIBROKEN) $(LIBVERS)
192 1.1 elric $(EXECONLINK)
193 1.1 elric $(EXEPREP_NODIST)
194 1.1 elric
195 1.1 elric $(OBJ)\test_hmac.exe: $(OBJ)\test_hmac.obj $(LIBHEIMDAL) $(LIBROKEN)
196 1.1 elric $(EXECONLINK)
197 1.1 elric $(EXEPREP_NODIST)
198 1.1 elric
199 1.1 elric $(OBJ)\test_pkcs5.exe: $(OBJ)\test_pkcs5.obj $(LIBHEIMDAL) $(LIBROKEN)
200 1.1 elric $(EXECONLINK)
201 1.1 elric $(EXEPREP_NODIST)
202 1.1 elric
203 1.1 elric $(OBJ)\test_pkcs12.exe: $(OBJ)\test_pkcs12.obj $(LIBHEIMDAL) $(LIBROKEN)
204 1.1 elric $(EXECONLINK)
205 1.1 elric $(EXEPREP_NODIST)
206 1.1 elric
207 1.1 elric $(OBJ)\test_rsa.exe: $(OBJ)\test_rsa.obj $(LIBHEIMDAL) $(LIBROKEN) $(LIBVERS)
208 1.1 elric $(EXECONLINK)
209 1.1 elric $(EXEPREP_NODIST)
210 1.1 elric
211 1.1 elric $(OBJ)\test_dh.exe: $(OBJ)\test_dh.obj $(LIBHEIMDAL) $(LIBROKEN) $(LIBVERS)
212 1.1 elric $(EXECONLINK)
213 1.1 elric $(EXEPREP_NODIST)
214 1.1 elric
215 1.1 elric $(OBJ)\test_rand.exe: $(OBJ)\test_rand.obj $(LIBHEIMDAL) $(LIBROKEN) $(LIBVERS)
216 1.1 elric $(EXECONLINK)
217 1.1 elric $(EXEPREP_NODIST)
218 1.1 elric
219 1.1 elric SRCDIR2=$(SRCDIR:\=\\\\)
220 1.1 elric
221 1.1 elric $(OBJ)\test_crypto.sh: test_crypto.in NTMakefile
222 1.1 elric $(SED) -e "s,[@]srcdir[@],$(SRCDIR2),g" -e "s,[@]exeext[@],.exe,g" -e "s,\r,," < test_crypto.in > $@ || $(RM) $@
223 1.1 elric
224 1.1 elric test-run:
225 1.1 elric cd $(OBJ)
226 1.1 elric !ifdef SH
227 1.1 elric $(SH) test_crypto.sh
228 1.1 elric !endif
229 1.1 elric destest.exe
230 1.1 elric mdtest.exe
231 1.1 elric rc2test.exe
232 1.1 elric rctest.exe
233 1.1 elric test_bn.exe
234 1.1 elric test_cipher.exe
235 1.1 elric test_engine_dso.exe
236 1.1 elric test_hmac.exe
237 1.1 elric test_pkcs5.exe
238 1.1 elric test_pkcs12.exe
239 1.1 elric test_rsa.exe
240 1.1 elric test_dh.exe
241 1.1 elric cd $(SRCDIR)
242 1.1 elric
243 1.1 elric test:: $(TESTLIB) test-binaries test-run
244 1.1 elric
245 1.1 elric test-exports:
246 1.1 elric $(PERL) ..\..\cf\w32-check-exported-symbols.pl --vs version-script.map --def libhcrypto-exports.def
247 1.1 elric
248 1.1 elric test:: test-exports
249