Windows: Build a single heimdal.dll
[heimdal.git] / lib / hx509 / NTMakefile
blob5eae9186005905586271cc231c5c76ce0e402cc7
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 RELDIR=lib\hx509
34 !include ../../windows/NTMakefile.w32
36 gen_files_ocsp =                        \
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
56 gen_files_pkcs10 =                      \
57         $(OBJ)\asn1_CertificationRequestInfo.x  \
58         $(OBJ)\asn1_CertificationRequest.x
60 gen_files_crmf =                        \
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 
75 libhx509_la_OBJS = \
76         $(OBJ)\ca.obj \
77         $(OBJ)\cert.obj \
78         $(OBJ)\cms.obj \
79         $(OBJ)\collector.obj \
80         $(OBJ)\crypto.obj \
81         $(OBJ)\error.obj \
82         $(OBJ)\env.obj \
83         $(OBJ)\file.obj \
84         $(OBJ)\hx509_err.obj    \
85         $(OBJ)\sel.obj \
86         $(OBJ)\sel-gram.obj     \
87         $(OBJ)\sel-lex.obj      \
88         $(OBJ)\keyset.obj \
89         $(OBJ)\ks_dir.obj \
90         $(OBJ)\ks_file.obj \
91         $(OBJ)\ks_mem.obj \
92         $(OBJ)\ks_null.obj \
93         $(OBJ)\ks_p11.obj \
94         $(OBJ)\ks_p12.obj \
95         $(OBJ)\ks_keychain.obj \
96         $(OBJ)\lock.obj \
97         $(OBJ)\name.obj \
98         $(OBJ)\peer.obj \
99         $(OBJ)\print.obj \
100         $(OBJ)\softp11.obj \
101         $(OBJ)\req.obj \
102         $(OBJ)\revoke.obj       \
103         $(gen_files_ocsp:.x=.obj)       \
104         $(gen_files_pkcs10:.x=.obj)
106 $(LIBHX509): $(libhx509_la_OBJS)
107         $(LIBCON)
109 dist_libhx509_la_SOURCES = \
110         $(SRCDIR)\ca.c \
111         $(SRCDIR)\cert.c \
112         $(SRCDIR)\cms.c \
113         $(SRCDIR)\collector.c \
114         $(SRCDIR)\crypto.c \
115         $(SRCDIR)\doxygen.c \
116         $(SRCDIR)\error.c \
117         $(SRCDIR)\env.c \
118         $(SRCDIR)\file.c \
119         $(SRCDIR)\hx509.h \
120         $(SRCDIR)\hx_locl.h \
121         $(SRCDIR)\sel.c \
122         $(SRCDIR)\sel.h \
123         $(SRCDIR)\sel-gram.y \
124         $(SRCDIR)\sel-lex.l \
125         $(SRCDIR)\keyset.c \
126         $(SRCDIR)\ks_dir.c \
127         $(SRCDIR)\ks_file.c \
128         $(SRCDIR)\ks_mem.c \
129         $(SRCDIR)\ks_null.c \
130         $(SRCDIR)\ks_p11.c \
131         $(SRCDIR)\ks_p12.c \
132         $(SRCDIR)\ks_keychain.c \
133         $(SRCDIR)\lock.c \
134         $(SRCDIR)\name.c \
135         $(SRCDIR)\peer.c \
136         $(SRCDIR)\print.c \
137         $(SRCDIR)\softp11.c \
138         $(SRCDIR)\ref\pkcs11.h \
139         $(SRCDIR)\req.c \
140         $(SRCDIR)\revoke.c
142 AUXCFLAGS=$(AUXCFLAGS) -I$(SRCDIR)\ref -I$(OBJ)
144 asn1_compile=$(BINDIR)\asn1_compile.exe
146 $(gen_files_ocsp:.x=.c): $$(@R).x
148 $(gen_files_pkcs10:.x=.c): $$(@R).x
150 $(gen_files_crmf:.x=.c): $$(@R).x
152 $(gen_files_ocsp) $(OBJ)\ocsp_asn1.hx: $(asn1_compile) ocsp.asn1
153         cd $(OBJ)
154         $(asn1_compile) \
155                 --preserve-binary=OCSPTBSRequest \
156                 --preserve-binary=OCSPResponseData \
157                 $(SRCDIR)\ocsp.asn1 ocsp_asn1 \
158         || ( $(RM) -f $(gen_files_ocsp) $(OBJ)\ocsp_asn1.h ; exit /b 1 )
159         cd $(SRCDIR)
161 $(gen_files_pkcs10) $(OBJ)\pkcs10_asn1.hx: $(asn1_compile) pkcs10.asn1
162         cd $(OBJ)
163         $(asn1_compile) \
164                 --preserve-binary=CertificationRequestInfo \
165                 $(SRCDIR)\pkcs10.asn1 pkcs10_asn1 \
166         || ( $(RM) -f $(gen_files_pkcs10) $(OBJ)\pkcs10_asn1.h ; exit /b 1 )
167         cd $(SRCDIR)
169 $(gen_files_crmf) $(OBJ)\crmf_asn1.hx: $(asn1_compile) crmf.asn1
170         cd $(OBJ)
171         $(asn1_compile) $(SRCDIR)\crmf.asn1 crmf_asn1 \
172         || ( $(RM) -f $(gen_files_crmf) $(OBJ)\crmf_asn1.h ; exit /b 1 )
173         cd $(SRCDIR)
175 INCFILES=                           \
176         $(INCDIR)\hx509.h           \
177         $(INCDIR)\hx509-protos.h    \
178         $(INCDIR)\hx509-private.h   \
179         $(INCDIR)\hx509_err.h       \
180         $(INCDIR)\ocsp_asn1.h       \
181         $(INCDIR)\pkcs10_asn1.h     \
182         $(INCDIR)\crmf_asn1.h       \
183         $(OBJ)\ocsp_asn1-priv.h     \
184         $(OBJ)\pkcs10_asn1-priv.h   \
185         $(OBJ)\crmf_asn1-priv.h
187 hxtool.c: $(OBJ)\hxtool-commands.h
189 SLC=$(BINDIR)\slc.exe
191 $(OBJ)\hxtool-commands.c $(OBJ)\hxtool-commands.h: hxtool-commands.in $(SLC)
192         cd $(OBJ)
193         $(CP) $(SRCDIR)\hxtool-commands.in $(OBJ)\hxtool-commands.in
194         $(SLC) hxtool-commands.in
195         cd $(SRCDIR)
197 $(BINDIR)\hxtool.exe: $(OBJ)\hxtool.obj $(OBJ)\hxtool-commands.obj $(LIBHEIMDAL)
198         $(EXECONLINK) $(LIBHEIMDAL) $(LIBROKEN) $(LIBSL) $(LIBVERS) $(LIBCOMERR)
199         $(EXEPREP)
201 $(OBJ)\hx509-protos.h:
202         cd $(OBJ)
203         $(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
204         cd $(SRCDIR)
206 $(OBJ)\hx509-private.h:
207         cd $(OBJ)
208         $(PERL) $(SRCDIR)\..\..\cf\make-proto.pl -q -P remove -p hx509-private.h $(dist_libhx509_la_SOURCES) || $(RM) -f hx509-private.h
209         cd $(SRCDIR)
211 $(OBJ)\hx509_err.c $(OBJ)\hx509_err.h: hx509_err.et
212         cd $(OBJ)
213         $(BINDIR)\compile_et.exe $(SRCDIR)\hx509_err.et
214         cd $(SRCDIR)
216 $(OBJ)\sel-gram.obj: $(OBJ)\sel-gram.c
217         $(C2OBJ) -I$(SRCDIR)
219 $(OBJ)\sel-lex.obj: $(OBJ)\sel-lex.c
220         $(C2OBJ) -I$(SRCDIR) -I$(OBJ)
222 $(OBJ)\sel-gram.c: sel-gram.y
223         $(YACC) -o $@ --defines=$(OBJ)\sel-gram.h sel-gram.y
225 $(OBJ)\sel-lex.c: sel-lex.l
226         $(LEX) -o$@ sel-lex.l
228 all:: $(INCFILES) $(LIBHX509)
230 all-tools:: $(BINDIR)\hxtool.exe
232 clean::
233         -$(RM) $(BINDIR)\hxtool.exe