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 RELDIR=lib\asn1 33 1.1 elric 34 1.1.1.2 christos intcflags=-I$(SRCDIR) -I$(OBJ) -DROKEN_RENAME 35 1.1 elric 36 1.1 elric !include ../../windows/NTMakefile.w32 37 1.1 elric 38 1.1 elric gen_files_krb5 = $(OBJ)\asn1_krb5_asn1.x 39 1.1 elric 40 1.1 elric gen_files_cms = $(OBJ)\asn1_cms_asn1.x 41 1.1 elric 42 1.1 elric gen_files_rfc2459 = $(OBJ)\asn1_rfc2459_asn1.x 43 1.1 elric 44 1.1 elric gen_files_pkinit = $(OBJ)\asn1_pkinit_asn1.x 45 1.1 elric 46 1.1 elric gen_files_pkcs12 = $(OBJ)\asn1_pkcs12_asn1.x 47 1.1 elric 48 1.1 elric gen_files_pkcs8 = $(OBJ)\asn1_pkcs8_asn1.x 49 1.1 elric 50 1.1 elric gen_files_pkcs9 = $(OBJ)\asn1_pkcs9_asn1.x 51 1.1 elric 52 1.1 elric gen_files_test = $(OBJ)\asn1_test_asn1.x 53 1.1 elric 54 1.1 elric gen_files_digest = $(OBJ)\asn1_digest_asn1.x 55 1.1 elric 56 1.1 elric gen_files_kx509 = $(OBJ)\asn1_kx509_asn1.x 57 1.1 elric 58 1.1 elric ASN1_BINARIES = \ 59 1.1 elric $(LIBEXECDIR)\asn1_compile.exe 60 1.1 elric 61 1.1 elric $(BINDIR)\asn1_compile.exe: \ 62 1.1 elric $(OBJ)\asn1parse.obj \ 63 1.1 elric $(OBJ)\gen.obj \ 64 1.1 elric $(OBJ)\gen_copy.obj \ 65 1.1 elric $(OBJ)\gen_decode.obj \ 66 1.1 elric $(OBJ)\gen_encode.obj \ 67 1.1 elric $(OBJ)\gen_free.obj \ 68 1.1 elric $(OBJ)\gen_glue.obj \ 69 1.1 elric $(OBJ)\gen_length.obj \ 70 1.1 elric $(OBJ)\gen_seq.obj \ 71 1.1 elric $(OBJ)\gen_template.obj \ 72 1.1 elric $(OBJ)\hash.obj \ 73 1.1 elric $(OBJ)\lex.obj \ 74 1.1 elric $(OBJ)\main.obj \ 75 1.1 elric $(OBJ)\symbol.obj \ 76 1.1 elric $(OBJ)\asn1_compile-version.res 77 1.1 elric $(EXECONLINK) $(LIBROKEN) $(LIBVERS) 78 1.1 elric $(EXEPREP_NOHEIM) 79 1.1 elric 80 1.1 elric $(OBJ)\lex.c: lex.l $(OBJ)\asn1parse.h 81 1.1 elric $(LEX) -o$@ lex.l 82 1.1 elric 83 1.1 elric $(OBJ)\lex.obj: $(OBJ)\lex.c 84 1.1 elric $(C2OBJ) -DYY_NO_UNISTD_H 85 1.1 elric 86 1.1 elric $(OBJ)\asn1parse.c $(OBJ)\asn1parse.h: asn1parse.y 87 1.1 elric $(YACC) -o $(OBJ)\asn1parse.c --defines=$(OBJ)\asn1parse.h $** 88 1.1 elric 89 1.1 elric $(OBJ)\asn1_err.c $(OBJ)\asn1_err.h: asn1_err.et 90 1.1 elric cd $(OBJ) 91 1.1 elric $(BINDIR)\compile_et.exe $(SRCDIR)\asn1_err.et 92 1.1 elric cd $(SRCDIR) 93 1.1 elric 94 1.1 elric $(BINDIR)\asn1_print.exe: $(OBJ)\asn1_print.obj $(LIBHEIMDAL) 95 1.1 elric $(EXECONLINK) $(LIBVERS) $(LIBROKEN) $(LIBCOMERR) 96 1.1 elric $(EXEPREP) 97 1.1 elric 98 1.1 elric $(BINDIR)\asn1_gen.exe: $(OBJ)\asn1_gen.obj $(LIBHEIMDAL) 99 1.1 elric $(EXECONLINK) $(LIBVERS) $(LIBROKEN) 100 1.1 elric $(EXEPREP) 101 1.1 elric 102 1.1 elric LIBASN1_OBJS= \ 103 1.1 elric $(OBJ)\der.obj \ 104 1.1 elric $(OBJ)\der_get.obj \ 105 1.1 elric $(OBJ)\der_put.obj \ 106 1.1 elric $(OBJ)\der_free.obj \ 107 1.1 elric $(OBJ)\der_length.obj \ 108 1.1 elric $(OBJ)\der_copy.obj \ 109 1.1 elric $(OBJ)\der_cmp.obj \ 110 1.1 elric $(OBJ)\der_format.obj \ 111 1.1 elric $(OBJ)\extra.obj \ 112 1.1 elric $(OBJ)\timegm.obj \ 113 1.1 elric $(gen_files_rfc2459:.x=.obj) \ 114 1.1 elric $(gen_files_cms:.x=.obj) \ 115 1.1 elric $(gen_files_krb5:.x=.obj) \ 116 1.1 elric $(gen_files_pkinit:.x=.obj) \ 117 1.1 elric $(gen_files_pkcs8:.x=.obj) \ 118 1.1 elric $(gen_files_pkcs9:.x=.obj) \ 119 1.1 elric $(gen_files_pkcs12:.x=.obj) \ 120 1.1 elric $(gen_files_digest:.x=.obj) \ 121 1.1 elric $(gen_files_kx509:.x=.obj) \ 122 1.1 elric $(OBJ)\asn1_err.obj 123 1.1 elric 124 1.1 elric $(LIBASN1): $(LIBASN1_OBJS) 125 1.1 elric $(LIBCON_C) -out:$@ @<< 126 1.1 elric $(**: = 127 1.1 elric ) 128 1.1 elric << 129 1.1 elric 130 1.1 elric clean:: 131 1.1 elric -$(RM) $(LIBASN1) 132 1.1 elric 133 1.1 elric # 134 1.1 elric # Generate list of exports 135 1.1 elric # 136 1.1 elric # This target is only used during development to generate a list of 137 1.1 elric # symbols that are exported from all the object files in LIBASN1_OBJS. 138 1.1 elric # 139 1.1 elric exports-list.txt: $(LIBASN1_OBJS) 140 1.1 elric $(PERL) ..\..\cf\w32-list-externs-from-objs.pl -q -u @<< > $@ 141 1.1 elric $(**: = 142 1.1 elric ) 143 1.1 elric << 144 1.1 elric 145 1.1 elric $(gen_files_krb5:.x=.c) : $$(@R).x 146 1.1 elric 147 1.1 elric $(gen_files_pkinit:.x=.c) : $$(@R).x 148 1.1 elric 149 1.1 elric $(gen_files_pkcs8:.x=.c) : $$(@R).x 150 1.1 elric 151 1.1 elric $(gen_files_pkcs9:.x=.c) : $$(@R).x 152 1.1 elric 153 1.1 elric $(gen_files_pkcs12:.x=.c) : $$(@R).x 154 1.1 elric 155 1.1 elric $(gen_files_digest:.x=.c) : $$(@R).x 156 1.1 elric 157 1.1 elric $(gen_files_kx509:.x=.c) : $$(@R).x 158 1.1 elric 159 1.1 elric $(gen_files_rfc2459:.x=.c) : $$(@R).x 160 1.1 elric 161 1.1 elric $(gen_files_cms:.x=.c) : $$(@R).x 162 1.1 elric 163 1.1 elric $(gen_files_test:.x=.c) : $$(@R).x 164 1.1 elric 165 1.1 elric $(gen_files_krb5) $(OBJ)\krb5_asn1.hx: $(BINDIR)\asn1_compile.exe krb5.asn1 krb5.opt 166 1.1 elric cd $(OBJ) 167 1.1 elric $(BINDIR)\asn1_compile.exe \ 168 1.1 elric --one-code-file \ 169 1.1 elric --option-file=$(SRCDIR)\krb5.opt \ 170 1.1 elric $(SRCDIR)\krb5.asn1 krb5_asn1 \ 171 1.1 elric || ($(RM) $(OBJ)\krb5_asn1.h ; exit /b 1) 172 1.1 elric cd $(SRCDIR) 173 1.1 elric 174 1.1 elric $(gen_files_pkinit) $(OBJ)\pkinit_asn1.hx: $(BINDIR)\asn1_compile.exe pkinit.asn1 175 1.1 elric cd $(OBJ) 176 1.1 elric $(BINDIR)\asn1_compile.exe --one-code-file $(SRCDIR)\pkinit.asn1 pkinit_asn1 \ 177 1.1 elric || ($(RM) $(OBJ)\pkinit_asn1.h ; exit /b 1) 178 1.1 elric cd $(SRCDIR) 179 1.1 elric 180 1.1 elric $(gen_files_pkcs8) $(OBJ)\pkcs8_asn1.hx: $(BINDIR)\asn1_compile.exe pkcs8.asn1 181 1.1 elric cd $(OBJ) 182 1.1 elric $(BINDIR)\asn1_compile.exe --one-code-file $(SRCDIR)\pkcs8.asn1 pkcs8_asn1 \ 183 1.1 elric || ($(RM) $(OBJ)\pkcs8_asn1.h ; exit /b 1) 184 1.1 elric cd $(SRCDIR) 185 1.1 elric 186 1.1 elric $(gen_files_pkcs9) $(OBJ)\pkcs9_asn1.hx: $(BINDIR)\asn1_compile.exe pkcs9.asn1 187 1.1 elric cd $(OBJ) 188 1.1 elric $(BINDIR)\asn1_compile.exe --one-code-file $(SRCDIR)\pkcs9.asn1 pkcs9_asn1 \ 189 1.1 elric || ($(RM) $(OBJ)\pkcs9_asn1.h ; exit /b 1) 190 1.1 elric cd $(SRCDIR) 191 1.1 elric 192 1.1 elric $(gen_files_pkcs12) $(OBJ)\pkcs12_asn1.hx: $(BINDIR)\asn1_compile.exe pkcs12.asn1 193 1.1 elric cd $(OBJ) 194 1.1 elric $(BINDIR)\asn1_compile.exe --one-code-file $(SRCDIR)\pkcs12.asn1 pkcs12_asn1 \ 195 1.1 elric || ($(RM) $(OBJ)\pkcs12_asn1.h ; exit /b 1) 196 1.1 elric cd $(SRCDIR) 197 1.1 elric 198 1.1 elric $(gen_files_digest) $(OBJ)\digest_asn1.hx: $(BINDIR)\asn1_compile.exe digest.asn1 199 1.1 elric cd $(OBJ) 200 1.1 elric $(BINDIR)\asn1_compile.exe --one-code-file $(SRCDIR)\digest.asn1 digest_asn1 \ 201 1.1 elric || ($(RM) $(OBJ)\digest_asn1.h ; exit /b 1) 202 1.1 elric cd $(SRCDIR) 203 1.1 elric 204 1.1 elric $(gen_files_kx509) $(OBJ)\kx509_asn1.hx: $(BINDIR)\asn1_compile.exe kx509.asn1 205 1.1 elric cd $(OBJ) 206 1.1 elric $(BINDIR)\asn1_compile.exe --one-code-file $(SRCDIR)\kx509.asn1 kx509_asn1 \ 207 1.1 elric || ($(RM) $(OBJ)\kx509_asn1.h ; exit /b 1) 208 1.1 elric cd $(SRCDIR) 209 1.1 elric 210 1.1 elric $(gen_files_rfc2459) $(OBJ)\rfc2459_asn1.hx: $(BINDIR)\asn1_compile.exe rfc2459.asn1 211 1.1 elric cd $(OBJ) 212 1.1 elric $(BINDIR)\asn1_compile.exe \ 213 1.1 elric --one-code-file \ 214 1.1 elric --preserve-binary=TBSCertificate \ 215 1.1 elric --preserve-binary=TBSCRLCertList \ 216 1.1 elric --preserve-binary=Name \ 217 1.1 elric --sequence=GeneralNames \ 218 1.1 elric --sequence=Extensions \ 219 1.1 elric --sequence=CRLDistributionPoints \ 220 1.1 elric $(SRCDIR)\rfc2459.asn1 rfc2459_asn1 \ 221 1.1 elric || ($(RM) $(OBJ)\rfc2459_asn1.h ; exit /b 1) 222 1.1 elric cd $(SRCDIR) 223 1.1 elric 224 1.1 elric $(gen_files_cms) $(OBJ)\cms_asn1.hx: $(BINDIR)\asn1_compile.exe cms.asn1 cms.opt 225 1.1 elric cd $(OBJ) 226 1.1 elric $(BINDIR)\asn1_compile.exe \ 227 1.1 elric --one-code-file --option-file=$(SRCDIR)\cms.opt \ 228 1.1 elric $(SRCDIR)\cms.asn1 cms_asn1 \ 229 1.1 elric || ($(RM) $(OBJ)\cms_asn1.h ; exit /b 1) 230 1.1 elric cd $(SRCDIR) 231 1.1 elric 232 1.1 elric $(gen_files_test) $(OBJ)\test_asn1.hx: $(BINDIR)\asn1_compile.exe test.asn1 233 1.1 elric cd $(OBJ) 234 1.1 elric $(BINDIR)\asn1_compile.exe \ 235 1.1 elric --one-code-file --sequence=TESTSeqOf \ 236 1.1 elric $(SRCDIR)\test.asn1 test_asn1 \ 237 1.1 elric || ($(RM) $(OBJ)\test_asn1.h ; exit /b 1) 238 1.1 elric cd $(SRCDIR) 239 1.1 elric 240 1.1 elric INCFILES= \ 241 1.1 elric $(INCDIR)\der.h \ 242 1.1 elric $(INCDIR)\heim_asn1.h \ 243 1.1 elric $(INCDIR)\der-protos.h \ 244 1.1 elric $(INCDIR)\der-private.h \ 245 1.1 elric $(INCDIR)\asn1-common.h \ 246 1.1 elric $(INCDIR)\asn1-template.h \ 247 1.1 elric $(OBJ)\asn1_err.h 248 1.1 elric 249 1.1 elric $(INCDIR)\der-protos.h: $(OBJ)\der-protos.h 250 1.1 elric 251 1.1 elric GENINCFILES= \ 252 1.1 elric $(INCDIR)\asn1_err.h \ 253 1.1 elric $(INCDIR)\cms_asn1.h \ 254 1.1 elric $(INCDIR)\digest_asn1.h \ 255 1.1 elric $(INCDIR)\krb5_asn1.h \ 256 1.1 elric $(INCDIR)\kx509_asn1.h \ 257 1.1 elric $(INCDIR)\pkcs12_asn1.h \ 258 1.1 elric $(INCDIR)\pkcs8_asn1.h \ 259 1.1 elric $(INCDIR)\pkcs9_asn1.h \ 260 1.1 elric $(INCDIR)\pkinit_asn1.h \ 261 1.1 elric $(INCDIR)\rfc2459_asn1.h \ 262 1.1 elric $(OBJ)\krb5_asn1-priv.h \ 263 1.1 elric $(OBJ)\pkinit_asn1-priv.h \ 264 1.1 elric $(OBJ)\cms_asn1-priv.h \ 265 1.1 elric $(OBJ)\rfc2459_asn1-priv.h \ 266 1.1 elric $(OBJ)\pkcs8_asn1-priv.h \ 267 1.1 elric $(OBJ)\pkcs9_asn1-priv.h \ 268 1.1 elric $(OBJ)\pkcs12_asn1-priv.h \ 269 1.1 elric $(OBJ)\digest_asn1-priv.h \ 270 1.1 elric $(OBJ)\kx509_asn1-priv.h \ 271 1.1 elric $(OBJ)\test_asn1.h \ 272 1.1 elric $(OBJ)\test_asn1-priv.h 273 1.1 elric 274 1.1 elric libasn1_SOURCES= \ 275 1.1 elric der_locl.h \ 276 1.1 elric der.c \ 277 1.1 elric der.h \ 278 1.1 elric der_get.c \ 279 1.1 elric der_put.c \ 280 1.1 elric der_free.c \ 281 1.1 elric der_length.c \ 282 1.1 elric der_copy.c \ 283 1.1 elric der_cmp.c \ 284 1.1 elric der_format.c \ 285 1.1 elric heim_asn1.h \ 286 1.1 elric extra.c \ 287 1.1 elric timegm.c 288 1.1 elric 289 1.1 elric $(OBJ)\der-protos.h: $(libasn1_SOURCES) 290 1.1 elric $(PERL) ..\..\cf\make-proto.pl -q -P remove -o $(OBJ)\der-protos.h $(libasn1_SOURCES) || $(RM) $(OBJ)\der-protos.h 291 1.1 elric 292 1.1 elric $(OBJ)\der-private.h: $(libasn1_SOURCES) 293 1.1 elric $(PERL) ..\..\cf\make-proto.pl -q -P remove -p $(OBJ)\der-private.h $(libasn1_SOURCES) || $(RM) $(OBJ)\der-private.h 294 1.1 elric 295 1.1 elric clean:: 296 1.1 elric -$(RM) $(INCDIR)\der-protos.h 297 1.1 elric 298 1.1 elric all:: $(INCFILES) $(GENINCFILES) $(ASN1_BINARIES) $(LIBASN1) 299 1.1 elric 300 1.1 elric all-tools:: $(LIBEXECDIR)\asn1_print.exe $(BINDIR)\asn1_gen.exe 301 1.1 elric 302 1.1 elric clean:: 303 1.1 elric -$(RM) $(INCFILES) 304 1.1 elric -$(RM) $(GENINCFILES) 305 1.1 elric -$(RM) $(ASN1_BINARIES:.exe=.*) 306 1.1 elric -$(RM) $(LIBASN1) 307 1.1 elric -$(RM) $(LIBEXECDIR)\asn1_print.* 308 1.1 elric -$(RM) $(LIBEXECDIR)\asn1_gen.* 309 1.1 elric 310 1.1 elric TEST_BINARIES=\ 311 1.1 elric $(OBJ)\check-der.exe \ 312 1.1 elric $(OBJ)\check-gen.exe \ 313 1.1 elric $(OBJ)\check-timegm.exe \ 314 1.1 elric $(OBJ)\check-ber.exe \ 315 1.1 elric $(OBJ)\check-template.exe \ 316 1.1 elric 317 1.1 elric test-binaries: $(TEST_BINARIES) 318 1.1 elric 319 1.1 elric test-run: 320 1.1 elric cd $(OBJ) 321 1.1.1.2 christos -check-der.exe 322 1.1.1.2 christos -check-gen.exe 323 1.1.1.2 christos -check-timegm.exe 324 1.1.1.2 christos -check-ber.exe 325 1.1.1.2 christos -check-template.exe 326 1.1 elric cd $(SRC) 327 1.1 elric 328 1.1 elric test:: test-binaries test-run 329 1.1 elric 330 1.1 elric clean:: 331 1.1 elric -$(RM) $(TEST_BINARIES:.exe=*) 332 1.1 elric 333 1.1 elric $(OBJ)\check-ber.exe: $(OBJ)\check-ber.obj \ 334 1.1 elric $(LIBHEIMDAL) $(LIBROKEN) 335 1.1 elric $(EXECONLINK) 336 1.1 elric $(EXEPREP_NODIST) 337 1.1 elric 338 1.1 elric $(OBJ)\check-der.exe: $(OBJ)\check-der.obj $(OBJ)\check-common.obj \ 339 1.1 elric $(LIBHEIMDAL) $(LIBROKEN) 340 1.1 elric $(EXECONLINK) 341 1.1 elric $(EXEPREP_NODIST) 342 1.1 elric 343 1.1 elric $(OBJ)\check-gen.exe: $(OBJ)\check-gen.obj $(OBJ)\check-common.obj \ 344 1.1 elric $(LIBHEIMDAL) $(LIBROKEN) $(gen_files_test:.x=.obj) 345 1.1 elric $(EXECONLINK) 346 1.1 elric $(EXEPREP_NODIST) 347 1.1 elric 348 1.1 elric $(OBJ)\check-timegm.exe: $(OBJ)\check-timegm.obj \ 349 1.1 elric $(LIBHEIMDAL) $(LIBROKEN) 350 1.1 elric $(EXECONLINK) 351 1.1 elric $(EXEPREP_NODIST) 352 1.1 elric 353 1.1 elric $(OBJ)\check-template.exe: $(OBJ)\check-template.obj $(OBJ)\check-common.obj \ 354 1.1 elric $(LIBHEIMDAL) $(LIBROKEN) $(gen_files_test:.x=.obj) 355 1.1 elric $(EXECONLINK) 356 1.1 elric $(EXEPREP_NODIST) 357