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.
33 intcflags=-I$(SRCDIR)\ref -I$(OBJ)
34 localcflags=-DASN1_LIB
36 !include ../../windows/NTMakefile.w32
38 gen_files_ocsp = $(OBJ)\asn1_ocsp_asn1.x
40 gen_files_pkcs10 = $(OBJ)\asn1_pkcs10_asn1.x
42 gen_files_crmf = $(OBJ)\asn1_crmf_asn1.x
48 $(OBJ)\collector.obj \
53 $(OBJ)\hx509_err.obj \
64 $(OBJ)\ks_keychain.obj \
72 $(gen_files_ocsp:.x=.obj) \
73 $(gen_files_pkcs10:.x=.obj)
75 $(LIBHX509): $(libhx509_la_OBJS)
78 dist_libhx509_la_SOURCES = \
82 $(SRCDIR)\collector.c \
92 $(SRCDIR)\sel-gram.y \
101 $(SRCDIR)\ks_keychain.c \
106 $(SRCDIR)\softp11.c \
107 $(SRCDIR)\ref\pkcs11.h \
111 asn1_compile=$(BINDIR)\asn1_compile.exe
113 $(gen_files_ocsp:.x=.c): $$(@R).x
115 $(gen_files_pkcs10:.x=.c): $$(@R).x
117 $(gen_files_crmf:.x=.c): $$(@R).x
119 $(gen_files_ocsp) $(OBJ)\ocsp_asn1.hx: $(asn1_compile) ocsp.asn1
121 $(asn1_compile) --one-code-file \
122 --preserve-binary=OCSPTBSRequest \
123 --preserve-binary=OCSPResponseData \
124 $(SRCDIR)\ocsp.asn1 ocsp_asn1 \
125 || ( $(RM) -f $(gen_files_ocsp) $(OBJ)\ocsp_asn1.h ; exit /b 1 )
128 $(gen_files_pkcs10) $(OBJ)\pkcs10_asn1.hx: $(asn1_compile) pkcs10.asn1
130 $(asn1_compile) --one-code-file \
131 --preserve-binary=CertificationRequestInfo \
132 $(SRCDIR)\pkcs10.asn1 pkcs10_asn1 \
133 || ( $(RM) -f $(gen_files_pkcs10) $(OBJ)\pkcs10_asn1.h ; exit /b 1 )
136 $(gen_files_crmf) $(OBJ)\crmf_asn1.hx: $(asn1_compile) crmf.asn1
138 $(asn1_compile) --one-code-file $(SRCDIR)\crmf.asn1 crmf_asn1 \
139 || ( $(RM) -f $(gen_files_crmf) $(OBJ)\crmf_asn1.h ; exit /b 1 )
144 $(INCDIR)\hx509-protos.h \
145 $(INCDIR)\hx509-private.h \
146 $(INCDIR)\hx509_err.h \
147 $(INCDIR)\ocsp_asn1.h \
148 $(INCDIR)\pkcs10_asn1.h \
149 $(INCDIR)\crmf_asn1.h \
150 $(OBJ)\ocsp_asn1-priv.h \
151 $(OBJ)\pkcs10_asn1-priv.h \
152 $(OBJ)\crmf_asn1-priv.h
154 hxtool.c: $(OBJ)\hxtool-commands.h
156 SLC=$(BINDIR)\slc.exe
158 $(OBJ)\hxtool-commands.c $(OBJ)\hxtool-commands.h: hxtool-commands.in $(SLC)
160 $(CP) $(SRCDIR)\hxtool-commands.in $(OBJ)\hxtool-commands.in
161 $(SLC) hxtool-commands.in
164 $(BINDIR)\hxtool.exe: $(OBJ)\tool\hxtool.obj $(OBJ)\tool\hxtool-commands.obj $(LIBHEIMDAL) $(OBJ)\hxtool-version.res
165 $(EXECONLINK) $(LIBHEIMDAL) $(LIBROKEN) $(LIBSL) $(LIBVERS) $(LIBCOMERR)
168 $(OBJ)\hx509-protos.h:
170 $(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
173 $(OBJ)\hx509-private.h:
175 $(PERL) $(SRCDIR)\..\..\cf\make-proto.pl -q -P remove -p hx509-private.h $(dist_libhx509_la_SOURCES) || $(RM) -f hx509-private.h
178 $(OBJ)\hx509_err.c $(OBJ)\hx509_err.h: hx509_err.et
180 $(BINDIR)\compile_et.exe $(SRCDIR)\hx509_err.et
183 $(OBJ)\sel-gram.obj: $(OBJ)\sel-gram.c
186 $(OBJ)\sel-lex.obj: $(OBJ)\sel-lex.c
187 $(C2OBJ) -I$(SRCDIR) -I$(OBJ) -DYY_NO_UNISTD_H
189 $(OBJ)\sel-gram.c: sel-gram.y
190 $(YACC) -o $@ --defines=$(OBJ)\sel-gram.h sel-gram.y
192 $(OBJ)\sel-lex.c: sel-lex.l
193 $(LEX) -o$@ sel-lex.l
195 all:: $(INCFILES) $(LIBHX509)
200 ! if !exist($(OBJ)\tool)
204 all-tools:: $(BINDIR)\hxtool.exe
207 -$(RM) $(BINDIR)\hxtool.*
208 -$(RM) $(OBJ)\tool\*.*
210 {}.c{$(OBJ)\tool}.obj::
211 $(C2OBJ_C) /Fd$(OBJ)\tool\ /Fo$(OBJ)\tool\ $(MPOPT) /UASN1_LIB $<
213 {$(OBJ)}.c{$(OBJ)\tool}.obj::
214 $(C2OBJ_C) /Fd$(OBJ)\tool\ /Fo$(OBJ)\tool\ $(MPOPT) /UASN1_LIB $<