1 CC=clang --target=x86_64-pc-linux-musl
2 CC=/usr/musl/bin/musl-clang
3 #CC=/usr/musl/bin/musl-gcc
4 #CFLAGS=-Wall -W -Wextra -Werror -Wno-implicit-fallthrough -std=c99 -Ilib -Isqlite -Ielf -I. -Ilzma/api --target=x86_64-pc-linux-musl
5 CFLAGS=-Wall -W -Wextra -Werror -Wno-implicit-fallthrough -std=c99 -Ilib -Isqlite -Ielf -I. -Ilzma/api
7 ZPMVER:=$(shell git describe --tags --match 'v[0-9]*' | sed -e 's/^v//' | sed -e 's/-g.\+//' | sed -e 's/-/./g')
9 LZMAFLAGS=-Ilzma/api -Ilzma/tuklib -Ilzma/lzma -Ilzma/common -Ilzma/check -Ilzma/lz -Ilzma/rangecoder -Ilzma/simple -Ilzma/delta -DHAVE_CHECK_CRC64 -DHAVE_CHECK_CRC32 -DHAVE_ENCODER_LZMA2 -DHAVE_DECODER_LZMA2 -DHAVE_MF_BT4
11 LDFLAGS=-fuse-ld=lld -L. -static
13 LZMACHECKSRC=lzma/check/check.c lzma/check/crc32_fast.c lzma/check/crc64_fast.c lzma/check/crc32_table.c lzma/check/crc64_table.c
14 LZMASRC=$(shell ls lzma/lzma/*.c lzma/common/*.c lzma/lz/*.c) $(LZMACHECKSRC) lzma/rangecoder/price_table.c
15 LZMAOBJ=$(filter-out lzma/common/stream_encoder_mt.o, $(LZMASRC:%.c=%.o))
17 JSWSRC=lib/jsw/jsw_avltree.c \
22 JSWOBJ=$(JSWSRC:%.c=%.o)
23 LIBZPMSRC=sha256.c db.c compress.c uncompress.c zpm.c zpm_hash.c \
24 foreach_path.c vercmp.c findpkg.c quote.c dbquery.c script_hash.c \
25 parse.c integ.c seterror.c notes.c
27 LIBZPMOBJ=$(addprefix lib/, $(LIBZPMSRC:%.c=%.o))
31 ZPKGBIN=zpm-addfile zpm-extract zpm-init zpm-vercmp zpm-stat zpm-hash \
32 zpm-findpkg zpm-shell zpm-soneed zpm-foreach-path zpm-parse \
33 zpm-script zpm-soname zpm-syncfs zpm-packagehash zpm-verify \
34 zpm-elftype zpm-quote zpm-note zpm-search zpm-add zpm-fetchurl
36 SCRIPTS=zpm zpm-install zpm-merge zpm-list zpm-preserve zpm-test zpm-log \
37 zpm-contents zpm-uninstall zpm-pathmod zpm-rmpackage zpm-newpackage \
38 zpm-pkg zpm-pkgfile zpm-gc zpm-repo zpm-update zpm-confgit
40 MANPAGES=doc/zpm.8 $(addprefix doc/zpm-, list.8 contents.8 hash.8 quote.8 pathmod.8 note.8 vercmp.8 repo.8 gc.8)
42 PROGRAMS=$(SCRIPTS) $(COMPILED)
48 printf '%s\n' $(LZMAOBJ)
51 libzpm.a: $(LIBZPMOBJ) sqlite/sqlite3.o \
56 package: zpm-$(ZPMVER)-1.zpm
59 find xz/src/liblzma -type d -name .deps -prune \
60 -o -type f -printf '%P\n' \
61 | xargs -IZ echo Z Z Z \
62 | xargs printf 'test -e lzma/%s && cp xz/src/liblzma/%s lzma/%s\n' \
65 #lzma/lz/lz_decoder.o: lzma/lz/lz_decoder.c
66 #lzma/lz/lz_encoder.o: lzma/lz/lz_encoder.c
69 $(CC) $(CFLAGS) $(LZMAFLAGS) -c -o $@ $<
71 lib/liblzma.a: $(LZMAOBJ)
74 lib/libjsw.a: $(JSWOBJ)
79 zpm-$(ZPMVER)-1.zpm: programs $(MANPAGES)
81 $(ZPM) newpackage -C zpm-$(ZPMVER)-1
82 $(ZPM) add -v -u root -g root -f $@ -P /sbin zpm-$(ZPMVER)-1 $(sort $(PROGRAMS))
83 $(ZPM) add -v -u root -g root -f $@ -P /usr/share/man/man8 -S doc $(MANPAGES)
85 tarball: zpm-$(ZPMVER)-1.tar.xz
87 zpm-$(ZPMVER)-1.tar.xz: programs
89 tar -cJf $@ --transform='s|^|sbin/|' \
96 gcc -std=c99 -Wall -c -o $@ $<
99 PATH=$(curdir)/t:$(curdir):$(PATH) t/$(T).t
101 t/ctap/prove: t/ctap/prove.o
102 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+
104 test: $(ZPKGBIN) t/ctap/prove
105 @PATH=$(curdir)/t:$(curdir):$(PATH) t/ctap/prove t/*.t
109 uncompress: uncompress.o
110 $(CC) $(CFLAGS) -o $@ $+ -llzma
112 zpm-elftype: elf/elftype.c
113 $(CC) -Ielf $(CFLAGS) -o $@ $+
115 zpm-soname: elf/soname.c
116 $(CC) -Ielf $(CFLAGS) -o $@ $+
118 zpm-soneed: elf/needed.c
119 $(CC) -Ielf $(CFLAGS) -o $@ $+
121 zpm-addfile: zpm-addfile.o libzpm.a libelf.a
122 $(CC) -Ielf $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
124 zpm-hash: zpm-hash.o libzpm.a
125 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
127 zpm-verify: zpm-verify.o t/ctap/ctap.o libzpm.a
128 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< t/ctap/ctap.o -lzpm -lelf
130 zpm-init: zpm-init.o libzpm.a
131 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
133 zpm-extract: zpm-extract.o libzpm.a
134 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
136 zpm-script: zpm-script.o libzpm.a
137 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
139 zpm-packagehash: zpm-packagehash.o libzpm.a
140 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
142 zpm-foreach-path.o: CFLAGS+=-Wno-unused-parameter
143 zpm-script.o: CFLAGS+=-Wno-unused-parameter
145 zpm-foreach-path: zpm-foreach-path.o libzpm.a sqlite/sqlite3.h
146 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
148 zpm-findpkg: zpm-findpkg.o libzpm.a
149 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
151 zpm-search: zpm-search.o libzpm.a
152 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
154 zpm-note: zpm-note.o libzpm.a
155 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
157 zpm-syncfs: zpm-syncfs.o libzpm.a libelf.a
158 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf -lm
160 zpm-parse: zpm-parse.o lib/parse.o
161 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+
163 zpm-add: zpm-add.o libzpm.a libelf.a
164 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
166 zpm-quote: zpm-quote.o
167 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
169 db.sql: schema/main.sql schema/syncconflicts.sql schema/syncinfo.sql schema/preserve_packages.sql schema/age.sql
175 echo "char createdb[] = {" > $@
179 sqlite/sqlite3.o: sqlite/sqlite3.c sqlite/config.h
180 $(CC) -O3 -Wall -std=c99 -Ilib -D_HAVE_SQLITE_CONFIG_H=1 -c -o $@ $<
182 sqlite/extensions.o: sqlite/extensions.c
183 $(CC) -O3 -Wall -std=c99 -I. -Isqlite -DSQLITE_CORE=1 -c -o $@ $<
185 sqlite/shell.o: sqlite/shell.c sqlite/config.h Makefile
186 $(CC) -Wall -std=c99 -Ilib \
187 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
188 '-DSQLITE_SHELL_INIT_PROC(x)=zpm_setup_extensions(x)' \
189 -D_POSIX_C_SOURCE=200112L -c -o $@ $<
193 zpm-vercmp: zpm-vercmp.o lib/vercmp.o
194 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+
196 zpm-shell: sqlite/sqlite3.o sqlite/shell.o sqlite/extensions.o lib/vercmp.o
197 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+
199 libelf.a: elf/libelf.o
202 install: $(COMPILED) $(MANPAGES)
203 test -d $(DESTDIR)/sbin || install -d $(DESTDIR)/sbin
204 install $(PROGRAMS) $(DESTDIR)/sbin
205 mkdir -p $(DESTDIR)/usr/share/man/man8
206 install -m644 $(MANPAGES) $(DESTDIR)/usr/share/man/man8
208 scan-prep: clean sqlite/sqlite3.o sqlite/shell.o lib/liblzma.a
209 @echo scan-build -v -o report make -j10
228 TLSOBJ= tlse.o x25519.o chacha.o base64.o pem.o forward.o handshake.o \
229 buffer.o parse_client_hello.o parse_message.o cipher_supported.o \
230 packet_update.o hmac_message.o hkdf.o hash.o cipher_name.o
232 crypto/x25519.o: $(addprefix crypto/ref10/, $(X255OBJ))
235 crypto/%.o: CFLAGS+=-Icrypto -DTFM_DESC -DTFM_NO_ASM -Itomsfastmath/src/headers \
236 -Wno-pointer-sign -Wno-missing-braces -Ilibtomcrypt/src/headers
238 # /usr/musl/bin/musl-clang -Wall -Wextra -Wno-missing-braces -Werror -Wno-pointer-sign -I. -DTFM_DESC -DTFM_NO_ASM -I ../libtomcrypt/src/headers -I ../tomsfastmath/src/headers -DSTRICT_TLS -DIGNORE_SESSION_ID --rtlib=compiler-rt -c -o tlse.o tlse.c
240 #/usr/musl/bin/musl-clang -Wall -Wextra -Wno-missing-braces -Werror -Wno-pointer-sign -I. -DTFM_DESC -DTFM_NO_ASM -I ../libtomcrypt/src/headers -I ../tomsfastmath/src/headers -DSTRICT_TLS -DIGNORE_SESSION_ID --rtlib=compiler-rt -c -o tlse.o tlse.c
242 tls.o: $(addprefix crypto/, $(TLSOBJ))
251 addsub/fp_cmp_mag.o \
257 bin/fp_radix_size.o \
258 bin/fp_read_radix.o \
259 bin/fp_read_signed_bin.o \
261 bin/fp_read_unsigned_bin.o \
262 bin/fp_signed_bin_size.o \
266 bin/fp_to_signed_bin.o \
267 bin/fp_to_unsigned_bin.o \
268 bin/fp_unsigned_bin_size.o \
270 bit/fp_count_bits.o \
281 exptmod/fp_exptmod.o \
285 mont/fp_montgomery_calc_normalization.o \
286 mont/fp_montgomery_reduce.o \
287 mont/fp_montgomery_setup.o \
291 mul/fp_mul_comba_12.o \
292 mul/fp_mul_comba_17.o \
293 mul/fp_mul_comba_20.o \
294 mul/fp_mul_comba_24.o \
295 mul/fp_mul_comba_28.o \
296 mul/fp_mul_comba_32.o \
297 mul/fp_mul_comba_3.o \
298 mul/fp_mul_comba_48.o \
299 mul/fp_mul_comba_4.o \
300 mul/fp_mul_comba_64.o \
301 mul/fp_mul_comba_6.o \
302 mul/fp_mul_comba_7.o \
303 mul/fp_mul_comba_8.o \
305 mul/fp_mul_comba_small_set.o \
307 mul/fp_mul_comba_9.o \
310 numtheory/fp_invmod.o \
311 numtheory/fp_isprime.o \
312 numtheory/fp_isprime_ex.o \
314 numtheory/fp_prime_miller_rabin.o \
315 numtheory/fp_prime_random_ex.o \
317 sqr/fp_sqr_comba_12.o \
318 sqr/fp_sqr_comba_17.o \
319 sqr/fp_sqr_comba_20.o \
320 sqr/fp_sqr_comba_24.o \
321 sqr/fp_sqr_comba_28.o \
322 sqr/fp_sqr_comba_32.o \
323 sqr/fp_sqr_comba_48.o \
324 sqr/fp_sqr_comba_3.o \
325 sqr/fp_sqr_comba_4.o \
326 sqr/fp_sqr_comba_64.o \
327 sqr/fp_sqr_comba_6.o \
328 sqr/fp_sqr_comba_7.o \
329 sqr/fp_sqr_comba_8.o \
330 sqr/fp_sqr_comba_9.o \
332 sqr/fp_sqr_comba_generic.o \
333 sqr/fp_sqr_comba_small_set.o \
336 tomsfastmath/src/addsub/%.o: CFLAGS+=-DTFM_DESC -DTFM_NO_ASM -Itomsfastmath/src/headers -DARGTYPE=4
337 tomsfastmath/src/%.o: CFLAGS+=-DTFM_DESC -DTFM_NO_ASM -Itomsfastmath/src/headers -DARGTYPE=4
339 tfm.o: $(addprefix tomsfastmath/src/, $(TFMOBJ))
357 ciphers/safer/safer.o \
358 ciphers/safer/saferp.o \
360 ciphers/twofish/twofish.o \
362 encauth/ccm/ccm_add_aad.o \
363 encauth/ccm/ccm_add_nonce.o \
364 encauth/ccm/ccm_done.o \
365 encauth/ccm/ccm_init.o \
366 encauth/ccm/ccm_memory.o \
367 encauth/ccm/ccm_process.o \
368 encauth/ccm/ccm_reset.o \
369 encauth/ccm/ccm_test.o \
370 encauth/chachapoly/chacha20poly1305_add_aad.o \
371 encauth/chachapoly/chacha20poly1305_decrypt.o \
372 encauth/chachapoly/chacha20poly1305_done.o \
373 encauth/chachapoly/chacha20poly1305_encrypt.o \
374 encauth/chachapoly/chacha20poly1305_init.o \
375 encauth/chachapoly/chacha20poly1305_memory.o \
376 encauth/chachapoly/chacha20poly1305_setiv.o \
377 encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \
378 encauth/chachapoly/chacha20poly1305_test.o \
379 encauth/eax/eax_addheader.o \
380 encauth/eax/eax_decrypt.o \
381 encauth/eax/eax_decrypt_verify_memory.o \
382 encauth/eax/eax_done.o \
383 encauth/eax/eax_encrypt.o \
384 encauth/eax/eax_encrypt_authenticate_memory.o \
385 encauth/eax/eax_init.o \
386 encauth/eax/eax_test.o \
387 encauth/gcm/gcm_add_aad.o \
388 encauth/gcm/gcm_add_iv.o \
389 encauth/gcm/gcm_done.o \
390 encauth/gcm/gcm_gf_mult.o \
391 encauth/gcm/gcm_init.o \
392 encauth/gcm/gcm_memory.o \
393 encauth/gcm/gcm_mult_h.o \
394 encauth/gcm/gcm_process.o \
395 encauth/gcm/gcm_reset.o \
396 encauth/gcm/gcm_test.o \
397 misc/crypt/crypt_find_cipher_id.o \
398 misc/crypt/crypt_find_hash_any.o \
399 misc/crypt/crypt_find_hash.o \
400 encauth/ocb/ocb_decrypt.o \
401 encauth/ocb/ocb_decrypt_verify_memory.o \
402 encauth/ocb/ocb_done_decrypt.o \
403 encauth/ocb/ocb_done_encrypt.o \
404 misc/crypt/crypt_find_hash_id.o \
405 misc/crypt/crypt_find_hash_oid.o \
406 encauth/ocb/ocb_encrypt.o \
407 encauth/ocb/ocb_encrypt_authenticate_memory.o \
408 encauth/ocb/ocb_init.o \
409 encauth/ocb/ocb_ntz.o \
410 encauth/ocb/ocb_shift_xor.o \
411 encauth/ocb/ocb_test.o \
412 encauth/ocb/s_ocb_done.o \
413 encauth/ocb3/ocb3_add_aad.o \
414 encauth/ocb3/ocb3_decrypt.o \
415 encauth/ocb3/ocb3_decrypt_last.o \
416 encauth/ocb3/ocb3_decrypt_verify_memory.o \
417 encauth/ocb3/ocb3_done.o \
418 encauth/ocb3/ocb3_encrypt.o \
419 encauth/ocb3/ocb3_encrypt_authenticate_memory.o \
420 encauth/ocb3/ocb3_encrypt_last.o \
421 encauth/ocb3/ocb3_init.o \
422 encauth/ocb3/ocb3_int_ntz.o \
423 encauth/ocb3/ocb3_int_xor_blocks.o \
424 encauth/ocb3/ocb3_test.o \
428 hashes/helper/hash_file.o \
429 hashes/helper/hash_filehandle.o \
430 hashes/helper/hash_memory.o \
431 hashes/helper/hash_memory_multi.o \
440 hashes/sha2/sha224.o \
441 hashes/sha2/sha256.o \
442 hashes/sha2/sha384.o \
443 hashes/sha2/sha512.o \
444 hashes/sha2/sha512_224.o \
445 hashes/sha2/sha512_256.o \
449 hashes/whirl/whirl.o \
450 mac/blake2/blake2bmac.o \
451 mac/blake2/blake2bmac_file.o \
452 mac/blake2/blake2bmac_memory.o \
453 mac/blake2/blake2bmac_memory_multi.o \
454 mac/blake2/blake2bmac_test.o \
455 mac/blake2/blake2smac.o \
456 mac/blake2/blake2smac_file.o \
457 mac/blake2/blake2smac_memory.o \
458 mac/blake2/blake2smac_memory_multi.o \
459 mac/blake2/blake2smac_test.o \
464 mac/f9/f9_memory_multi.o \
465 mac/f9/f9_process.o \
467 mac/hmac/hmac_done.o \
468 mac/hmac/hmac_file.o \
469 mac/hmac/hmac_init.o \
470 mac/hmac/hmac_memory.o \
471 mac/hmac/hmac_memory_multi.o \
472 mac/hmac/hmac_process.o \
473 mac/hmac/hmac_test.o \
474 mac/omac/omac_done.o \
475 mac/omac/omac_file.o \
476 mac/omac/omac_init.o \
477 mac/omac/omac_memory.o \
478 mac/omac/omac_memory_multi.o \
479 mac/omac/omac_process.o \
480 misc/crypt/crypt_find_prng.o \
481 mac/omac/omac_test.o \
482 mac/pelican/pelican.o \
483 mac/pelican/pelican_memory.o \
484 mac/pelican/pelican_test.o \
485 mac/pmac/pmac_done.o \
486 mac/pmac/pmac_file.o \
487 mac/pmac/pmac_init.o \
488 mac/pmac/pmac_memory.o \
489 mac/pmac/pmac_memory_multi.o \
490 mac/pmac/pmac_ntz.o \
491 mac/pmac/pmac_process.o \
492 mac/pmac/pmac_shift_xor.o \
493 mac/pmac/pmac_test.o \
494 mac/poly1305/poly1305.o \
495 mac/poly1305/poly1305_file.o \
496 mac/poly1305/poly1305_memory.o \
497 mac/poly1305/poly1305_memory_multi.o \
498 mac/poly1305/poly1305_test.o \
499 mac/xcbc/xcbc_done.o \
500 mac/xcbc/xcbc_file.o \
501 mac/xcbc/xcbc_init.o \
502 mac/xcbc/xcbc_memory.o \
503 mac/xcbc/xcbc_memory_multi.o \
504 mac/xcbc/xcbc_process.o \
505 mac/xcbc/xcbc_test.o \
506 math/fp/ltc_ecc_fp_mulmod.o \
510 math/radix_to_bin.o \
515 misc/base64/base64_decode.o \
516 misc/base64/base64_encode.o \
518 misc/compare_testvector.o \
521 misc/crypt/crypt_argchk.o \
522 misc/crypt/crypt_cipher_descriptor.o \
523 misc/crypt/crypt_cipher_is_valid.o \
524 misc/crypt/crypt_constants.o \
525 misc/crypt/crypt_find_cipher.o \
526 misc/crypt/crypt_find_cipher_any.o \
527 misc/crypt/crypt_fsa.o \
528 misc/crypt/crypt_hash_descriptor.o \
529 misc/crypt/crypt_hash_is_valid.o \
530 misc/crypt/crypt_inits.o \
531 misc/crypt/crypt_ltc_mp_descriptor.o \
532 misc/crypt/crypt_prng_descriptor.o \
533 misc/crypt/crypt_prng_is_valid.o \
534 misc/crypt/crypt_prng_rng_descriptor.o \
535 misc/crypt/crypt_register_all_ciphers.o \
536 misc/crypt/crypt_register_all_hashes.o \
537 misc/crypt/crypt_register_all_prngs.o \
538 misc/crypt/crypt_register_cipher.o \
539 misc/crypt/crypt_register_hash.o \
540 misc/crypt/crypt_register_prng.o \
541 misc/crypt/crypt_sizes.o \
542 misc/crypt/crypt_unregister_cipher.o \
543 misc/crypt/crypt_unregister_hash.o \
544 misc/crypt/crypt_unregister_prng.o \
545 misc/error_to_string.o \
547 misc/hkdf/hkdf_test.o \
550 misc/pkcs5/pkcs_5_1.o \
551 misc/pkcs5/pkcs_5_2.o \
552 misc/pkcs5/pkcs_5_test.o \
554 modes/cbc/cbc_decrypt.o \
555 modes/cbc/cbc_done.o \
556 modes/cbc/cbc_encrypt.o \
557 modes/cbc/cbc_getiv.o \
558 modes/cbc/cbc_setiv.o \
559 modes/cbc/cbc_start.o \
560 modes/cfb/cfb_decrypt.o \
561 modes/cfb/cfb_done.o \
562 modes/cfb/cfb_encrypt.o \
563 modes/cfb/cfb_getiv.o \
564 modes/cfb/cfb_setiv.o \
565 modes/cfb/cfb_start.o \
566 modes/ctr/ctr_decrypt.o \
567 modes/ctr/ctr_done.o \
568 modes/ctr/ctr_encrypt.o \
569 modes/ctr/ctr_getiv.o \
570 modes/ctr/ctr_setiv.o \
571 modes/ctr/ctr_start.o \
572 modes/ctr/ctr_test.o \
573 modes/ecb/ecb_decrypt.o \
574 modes/ecb/ecb_done.o \
575 modes/ecb/ecb_encrypt.o \
576 modes/ecb/ecb_start.o \
577 modes/f8/f8_decrypt.o \
579 modes/f8/f8_encrypt.o \
580 modes/f8/f8_getiv.o \
581 modes/f8/f8_setiv.o \
582 modes/f8/f8_start.o \
583 modes/f8/f8_test_mode.o \
584 modes/lrw/lrw_decrypt.o \
585 modes/lrw/lrw_done.o \
586 modes/lrw/lrw_encrypt.o \
587 modes/lrw/lrw_getiv.o \
588 modes/lrw/lrw_process.o \
589 modes/lrw/lrw_start.o \
590 modes/lrw/lrw_setiv.o \
591 modes/lrw/lrw_test.o \
592 modes/ofb/ofb_decrypt.o \
593 modes/ofb/ofb_done.o \
594 modes/ofb/ofb_encrypt.o \
595 modes/ofb/ofb_getiv.o \
596 modes/ofb/ofb_setiv.o \
597 modes/ofb/ofb_start.o \
598 modes/xts/xts_decrypt.o \
599 modes/xts/xts_done.o \
600 modes/xts/xts_encrypt.o \
601 modes/xts/xts_init.o \
602 modes/xts/xts_mult_x.o \
603 modes/xts/xts_test.o \
604 pk/asn1/der/bit/der_decode_bit_string.o \
605 pk/asn1/der/bit/der_decode_raw_bit_string.o \
606 pk/asn1/der/bit/der_encode_bit_string.o \
607 pk/asn1/der/bit/der_encode_raw_bit_string.o \
608 pk/asn1/der/bit/der_length_bit_string.o \
609 pk/asn1/der/boolean/der_decode_boolean.o \
610 pk/asn1/der/boolean/der_encode_boolean.o \
611 pk/asn1/der/boolean/der_length_boolean.o \
612 pk/asn1/der/choice/der_decode_choice.o \
613 pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \
614 pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \
615 pk/asn1/der/generalizedtime/der_length_generalizedtime.o \
616 pk/asn1/der/ia5/der_decode_ia5_string.o \
617 pk/asn1/der/ia5/der_encode_ia5_string.o \
618 pk/asn1/der/ia5/der_length_ia5_string.o \
619 pk/asn1/der/integer/der_decode_integer.o \
620 pk/asn1/der/integer/der_encode_integer.o \
621 pk/asn1/der/integer/der_length_integer.o \
622 pk/asn1/der/object_identifier/der_decode_object_identifier.o \
623 pk/asn1/der/object_identifier/der_encode_object_identifier.o \
624 pk/asn1/der/object_identifier/der_length_object_identifier.o \
625 pk/asn1/der/octet/der_decode_octet_string.o \
626 pk/asn1/der/octet/der_encode_octet_string.o \
627 pk/asn1/der/octet/der_length_octet_string.o \
628 pk/asn1/der/printable_string/der_decode_printable_string.o \
629 pk/asn1/der/printable_string/der_encode_printable_string.o \
630 pk/asn1/der/printable_string/der_length_printable_string.o \
631 pk/asn1/der/sequence/der_decode_sequence_ex.o \
632 pk/asn1/der/sequence/der_decode_sequence_flexi.o \
633 pk/asn1/der/sequence/der_decode_sequence_multi.o \
634 pk/asn1/der/sequence/der_decode_subject_public_key_info.o \
635 pk/asn1/der/sequence/der_encode_sequence_ex.o \
636 pk/asn1/der/sequence/der_encode_sequence_multi.o \
637 pk/asn1/der/sequence/der_encode_subject_public_key_info.o \
638 pk/asn1/der/sequence/der_length_sequence.o \
639 pk/asn1/der/sequence/der_sequence_free.o \
640 pk/asn1/der/sequence/der_sequence_shrink.o \
641 pk/asn1/der/set/der_encode_set.o \
642 pk/asn1/der/set/der_encode_setof.o \
643 pk/asn1/der/short_integer/der_decode_short_integer.o \
644 pk/asn1/der/short_integer/der_encode_short_integer.o \
645 pk/asn1/der/short_integer/der_length_short_integer.o \
646 pk/asn1/der/teletex_string/der_decode_teletex_string.o \
647 pk/asn1/der/teletex_string/der_length_teletex_string.o \
648 pk/asn1/der/utctime/der_decode_utctime.o \
649 pk/asn1/der/utctime/der_encode_utctime.o \
650 pk/asn1/der/utf8/der_decode_utf8_string.o \
651 pk/asn1/der/utctime/der_length_utctime.o \
652 pk/asn1/der/utf8/der_encode_utf8_string.o \
653 pk/asn1/der/utf8/der_length_utf8_string.o \
655 pk/dh/dh_check_pubkey.o \
657 pk/dh/dh_export_key.o \
659 pk/dh/dh_generate_key.o \
662 pk/dh/dh_set_pg_dhparam.o \
663 pk/dh/dh_shared_secret.o \
664 pk/dsa/dsa_decrypt_key.o \
665 pk/dsa/dsa_encrypt_key.o \
666 pk/dsa/dsa_export.o \
667 pk/dsa/dsa_generate_key.o \
668 pk/dsa/dsa_generate_pqg.o \
670 pk/dsa/dsa_import.o \
671 pk/dsa/dsa_make_key.o \
673 pk/dsa/dsa_set_pqg_dsaparam.o \
674 pk/dsa/dsa_shared_secret.o \
675 pk/dsa/dsa_sign_hash.o \
676 pk/dsa/dsa_verify_hash.o \
677 pk/dsa/dsa_verify_key.o \
679 pk/ecc/ecc_ansi_x963_export.o \
680 pk/ecc/ecc_ansi_x963_import.o \
681 pk/ecc/ecc_decrypt_key.o \
682 pk/ecc/ecc_encrypt_key.o \
683 pk/ecc/ecc_export.o \
685 pk/ecc/ecc_get_size.o \
686 pk/ecc/ecc_import.o \
687 pk/ecc/ecc_make_key.o \
688 pk/ecc/ecc_shared_secret.o \
689 pk/ecc/ecc_sign_hash.o \
692 pk/ecc/ecc_verify_hash.o \
693 pk/ecc/ltc_ecc_map.o \
694 pk/ecc/ltc_ecc_is_valid_idx.o \
695 pk/ecc/ltc_ecc_mul2add.o \
696 pk/ecc/ltc_ecc_mulmod.o \
697 pk/ecc/ltc_ecc_mulmod_timing.o \
698 pk/ecc/ltc_ecc_points.o \
699 pk/ecc/ltc_ecc_projective_add_point.o \
700 pk/ecc/ltc_ecc_projective_dbl_point.o \
701 pk/katja/katja_decrypt_key.o \
702 pk/katja/katja_encrypt_key.o \
703 pk/katja/katja_export.o \
704 pk/katja/katja_exptmod.o \
705 pk/katja/katja_free.o \
706 pk/katja/katja_import.o \
707 pk/katja/katja_make_key.o \
708 pk/pkcs1/pkcs_1_i2osp.o \
709 pk/pkcs1/pkcs_1_mgf1.o \
710 pk/pkcs1/pkcs_1_oaep_decode.o \
711 pk/pkcs1/pkcs_1_oaep_encode.o \
712 pk/pkcs1/pkcs_1_os2ip.o \
713 pk/pkcs1/pkcs_1_pss_decode.o \
714 pk/pkcs1/pkcs_1_pss_encode.o \
715 pk/pkcs1/pkcs_1_v1_5_decode.o \
716 pk/pkcs1/pkcs_1_v1_5_encode.o \
717 pk/rsa/rsa_decrypt_key.o \
718 pk/rsa/rsa_encrypt_key.o \
719 pk/rsa/rsa_export.o \
720 pk/rsa/rsa_exptmod.o \
722 pk/rsa/rsa_get_size.o \
723 pk/rsa/rsa_import.o \
724 pk/rsa/rsa_import_pkcs8.o \
725 pk/rsa/rsa_import_x509.o \
726 pk/rsa/rsa_make_key.o \
728 pk/rsa/rsa_sign_hash.o \
729 pk/rsa/rsa_sign_saltlen_get.o \
730 pk/rsa/rsa_verify_hash.o \
734 prngs/rng_get_bytes.o \
735 prngs/rng_make_prng.o \
739 stream/chacha/chacha_crypt.o \
740 stream/chacha/chacha_done.o \
741 stream/chacha/chacha_ivctr32.o \
742 stream/chacha/chacha_ivctr64.o \
743 stream/chacha/chacha_keystream.o \
744 stream/chacha/chacha_setup.o \
745 stream/chacha/chacha_test.o \
746 stream/rc4/rc4_stream.o \
747 stream/rc4/rc4_test.o \
748 stream/sober128/sober128_stream.o \
749 stream/sober128/sober128_test.o
751 libtomcrypt/%.o: CFLAGS+=-DTFM_DESC -Isrc/headers -Itomsfastmath/src/headers -DARGTYPE=4 -DLTC_NO_ASM -DTFM_NO_ASM -Ilibtomcrypt/src/headers -DLTC_SOURCE
753 ltc.o: $(addprefix libtomcrypt/src/, $(LTCOBJ))
756 crypto/rfc3986.c: crypto/rfc3986.re
757 re2c --input custom --tags -o $@ $<
760 $(CC) -Wall -W -Wextra -Werror -o $@ $+
762 zpm-fetchurl.o: CFLAGS+=-DTFM_DESC -Isrc/headers -Itomsfastmath/src/headers -DARGTYPE=4 -DLTC_NO_ASM -DTFM_NO_ASM -Ilibtomcrypt/src/headers -DLTC_SOURCE -Icrypto -Wno-pointer-sign -DDEBUG
764 zpm-fetchurl: ltc.o tls.o tfm.o zpm-fetchurl.o crypto/https.o crypto/rfc3986.o
766 testddg: zpm-fetchurl
767 ./zpm-fetchurl duckduckgo.com 443 /
769 testgra: zpm-fetchurl
770 ./zpm-fetchurl granicus.if.org 443 /
773 crypto/libeddsa/lib/burn.c \
774 crypto/libeddsa/lib/burnstack.c \
775 crypto/libeddsa/lib/ed.c \
776 crypto/libeddsa/lib/ed25519-sha512.c \
777 crypto/libeddsa/lib/fld.c \
778 crypto/libeddsa/lib/sc.c \
779 crypto/libeddsa/lib/sha512.c \
780 crypto/libeddsa/lib/x25519.c \
781 crypto/libeddsa/sign.c
783 SIGNOBJ=$(SIGNSRC:.c=.o)
785 $(SIGNOBJ): CFLAGS+=-Icrypto/libeddsa/lib
788 $(CC) $(CFLAGS) -o $@ $+
791 rm -f *.o sqlite/*.o lib/*.o $(LZMAOBJ) liblzma.a \
792 libelf.a libzpm.a zpm-addfile soname \
798 elf/*.o lib/jsw/*.o \
799 $(addprefix crypto/ref10/, $(X255OBJ)) \
800 $(addprefix crypto/, $(TLSOBJ)) \
801 $(addprefix tomsfastmath/src/, $(TFMOBJ)) \
802 $(addprefix libtomcrypt/src/, $(LTCOBJ)) \