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