1 ########################################################################
3 # Copyright (c) 2009, Secure Endpoints Inc.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
10 # - Redistributions of source code must retain the above copyright
11 # notice, this list of conditions and the following disclaimer.
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
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.
34 !include ../../windows/NTMakefile.w32
37 $(OBJ)\asn1_OCSPBasicOCSPResponse.x \
38 $(OBJ)\asn1_OCSPCertID.x \
39 $(OBJ)\asn1_OCSPCertStatus.x \
40 $(OBJ)\asn1_OCSPInnerRequest.x \
41 $(OBJ)\asn1_OCSPKeyHash.x \
42 $(OBJ)\asn1_OCSPRequest.x \
43 $(OBJ)\asn1_OCSPResponderID.x \
44 $(OBJ)\asn1_OCSPResponse.x \
45 $(OBJ)\asn1_OCSPResponseBytes.x \
46 $(OBJ)\asn1_OCSPResponseData.x \
47 $(OBJ)\asn1_OCSPResponseStatus.x \
48 $(OBJ)\asn1_OCSPSignature.x \
49 $(OBJ)\asn1_OCSPSingleResponse.x \
50 $(OBJ)\asn1_OCSPTBSRequest.x \
51 $(OBJ)\asn1_OCSPVersion.x \
52 $(OBJ)\asn1_id_pkix_ocsp.x \
53 $(OBJ)\asn1_id_pkix_ocsp_basic.x \
54 $(OBJ)\asn1_id_pkix_ocsp_nonce.x
57 $(OBJ)\asn1_CertificationRequestInfo.x \
58 $(OBJ)\asn1_CertificationRequest.x
61 $(OBJ)\asn1_CRMFRDNSequence.x \
62 $(OBJ)\asn1_CertReqMessages.x \
63 $(OBJ)\asn1_CertReqMsg.x \
64 $(OBJ)\asn1_CertRequest.x \
65 $(OBJ)\asn1_CertTemplate.x \
66 $(OBJ)\asn1_Controls.x \
67 $(OBJ)\asn1_PBMParameter.x \
68 $(OBJ)\asn1_PKMACValue.x \
69 $(OBJ)\asn1_POPOPrivKey.x \
70 $(OBJ)\asn1_POPOSigningKey.x \
71 $(OBJ)\asn1_POPOSigningKeyInput.x \
72 $(OBJ)\asn1_ProofOfPossession.x \
73 $(OBJ)\asn1_SubsequentMessage.x
79 $(OBJ)\collector.obj \
84 $(OBJ)\hx509_err.obj \
95 $(OBJ)\ks_keychain.obj \
103 $(gen_files_ocsp:.x=.obj) \
104 $(gen_files_pkcs10:.x=.obj)
108 $(LIBHX509): $(BINDIR)\libhx509.dll
110 $(BINDIR)\libhx509.dll: $(libhx509_la_OBJS) $(LIBHCRYPTO) $(LIBASN1) $(LIBWIND) $(LIBROKEN) $(LIBCOMERR)
111 $(DLLGUILINK) -def:libhx509-exports.def -implib:$(LIBHX509) shell32.lib
116 $(LIBHX509): $(libhx509_la_OBJS)
121 dist_libhx509_la_SOURCES = \
125 $(SRCDIR)\collector.c \
127 $(SRCDIR)\doxygen.c \
132 $(SRCDIR)\hx_locl.h \
135 $(SRCDIR)\sel-gram.y \
136 $(SRCDIR)\sel-lex.l \
139 $(SRCDIR)\ks_file.c \
141 $(SRCDIR)\ks_null.c \
144 $(SRCDIR)\ks_keychain.c \
149 $(SRCDIR)\softp11.c \
150 $(SRCDIR)\ref\pkcs11.h \
154 AUXCFLAGS=$(AUXCFLAGS) -I$(SRCDIR)\ref -I$(OBJ)
156 asn1_compile=$(BINDIR)\asn1_compile.exe
158 $(gen_files_ocsp:.x=.c): $$(@R).x
160 $(gen_files_pkcs10:.x=.c): $$(@R).x
162 $(gen_files_crmf:.x=.c): $$(@R).x
164 $(gen_files_ocsp) $(OBJ)\ocsp_asn1.hx: $(asn1_compile) ocsp.asn1
167 --preserve-binary=OCSPTBSRequest \
168 --preserve-binary=OCSPResponseData \
169 $(SRCDIR)\ocsp.asn1 ocsp_asn1 \
170 || ( $(RM) -f $(gen_files_ocsp) $(OBJ)\ocsp_asn1.h ; exit /b 1 )
173 $(gen_files_pkcs10) $(OBJ)\pkcs10_asn1.hx: $(asn1_compile) pkcs10.asn1
176 --preserve-binary=CertificationRequestInfo \
177 $(SRCDIR)\pkcs10.asn1 pkcs10_asn1 \
178 || ( $(RM) -f $(gen_files_pkcs10) $(OBJ)\pkcs10_asn1.h ; exit /b 1 )
181 $(gen_files_crmf) $(OBJ)\crmf_asn1.hx: $(asn1_compile) crmf.asn1
183 $(asn1_compile) $(SRCDIR)\crmf.asn1 crmf_asn1 \
184 || ( $(RM) -f $(gen_files_crmf) $(OBJ)\crmf_asn1.h ; exit /b 1 )
189 $(INCDIR)\hx509-protos.h \
190 $(INCDIR)\hx509-private.h \
191 $(INCDIR)\hx509_err.h \
192 $(INCDIR)\ocsp_asn1.h \
193 $(INCDIR)\pkcs10_asn1.h \
194 $(INCDIR)\crmf_asn1.h \
195 $(OBJ)\ocsp_asn1-priv.h \
196 $(OBJ)\pkcs10_asn1-priv.h \
197 $(OBJ)\crmf_asn1-priv.h
199 hxtool.c: $(OBJ)\hxtool-commands.h
201 SLC=$(BINDIR)\slc.exe
203 $(OBJ)\hxtool-commands.c $(OBJ)\hxtool-commands.h: hxtool-commands.in $(SLC)
205 $(CP) $(SRCDIR)\hxtool-commands.in $(OBJ)\hxtool-commands.in
206 $(SLC) hxtool-commands.in
209 $(BINDIR)\hxtool.exe: $(OBJ)\hxtool.obj $(OBJ)\hxtool-commands.obj $(LIBHX509)
210 $(EXECONLINK) $(LIBASN1) $(LIBHCRYPTO) $(LIBROKEN) $(LIBSL) $(LIBVERS) $(LIBWIND) $(LIBCOMERR)
211 $(_VC_MANIFEST_EMBED_EXE)
212 $(_VC_MANIFEST_CLEAN)
215 $(OBJ)\hx509-protos.h:
217 $(PERL) $(SRCDIR)\..\..\cf\make-proto.pl -R "^(_|^C)" -E HX509_LIB -q -P remove -o hx509-protos.h $(dist_libhx509_la_SOURCES) || $(RM) -f hx509-protos.h
220 $(OBJ)\hx509-private.h:
222 $(PERL) $(SRCDIR)\..\..\cf\make-proto.pl -q -P remove -p hx509-private.h $(dist_libhx509_la_SOURCES) || $(RM) -f hx509-private.h
225 $(OBJ)\hx509_err.c $(OBJ)\hx509_err.h: hx509_err.et
227 $(BINDIR)\compile_et.exe $(SRCDIR)\hx509_err.et
230 $(OBJ)\sel-gram.obj: $(OBJ)\sel-gram.c
233 $(OBJ)\sel-lex.obj: $(OBJ)\sel-lex.c
234 $(C2OBJ) -I$(SRCDIR) -I$(OBJ)
236 $(OBJ)\sel-gram.c: sel-gram.y
237 $(YACC) -o $@ --defines=$(OBJ)\sel-gram.h sel-gram.y
239 $(OBJ)\sel-lex.c: sel-lex.l
240 $(LEX) -o$@ sel-lex.l
242 all:: $(INCFILES) $(LIBHX509) $(BINDIR)\hxtool.exe
245 -$(RM) $(BINDIR)\hxtool.exe