1 CC=clang --target=x86_64-pc-linux-musl
2 CC=/usr/musl/bin/musl-clang
4 #CC=/usr/musl/bin/musl-gcc
5 #CFLAGS=-Wall -W -Wextra -Werror -Wno-implicit-fallthrough -std=c99 -Ilib -Isqlite -Ielf -I. -Ilzma/api --target=x86_64-pc-linux-musl
6 CFLAGS=-Wall -W -Wextra -Werror -Wno-implicit-fallthrough -std=c99 -Ilib -Isqlite -Ielf -I. -Ilzma/api -Wno-unused-command-line-argument
8 ZPMVER:=$(shell git describe --tags --match 'v[0-9]*' | sed -e 's/^v//' | sed -e 's/-g.\+//' | sed -e 's/-/./g')
10 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
12 #LDFLAGS=-fuse-ld=lld -L. -static
13 LDFLAGS=-fuse-ld=/usr/musl/bin/ld.musl-clang -L. -static
15 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
16 LZMASRC=$(shell ls lzma/lzma/*.c lzma/common/*.c lzma/lz/*.c) $(LZMACHECKSRC) lzma/rangecoder/price_table.c
17 LZMAOBJ=$(filter-out lzma/common/stream_encoder_mt.o, $(LZMASRC:%.c=%.o))
19 JSWSRC=lib/jsw/jsw_avltree.c \
24 JSWOBJ=$(JSWSRC:%.c=%.o)
25 LIBZPMSRC=sha256.c db.c compress.c uncompress.c zpm.c zpm_hash.c \
26 foreach_path.c vercmp.c findpkg.c quote.c dbquery.c script_hash.c \
27 parse.c integ.c seterror.c notes.c createpkg.c buffer.c \
28 blake2/ref/blake2b-ref.o
30 LIBZPMOBJ=$(addprefix lib/, $(LIBZPMSRC:%.c=%.o))
34 ZPKGBIN=zpm-addfile zpm-extract zpm-init zpm-vercmp zpm-stat zpm-hash \
35 zpm-findpkg zpm-shell zpm-soneed zpm-foreach-path zpm-parse \
36 zpm-script zpm-soname zpm-syncfs zpm-packagehash zpm-verify \
37 zpm-elftype zpm-quote zpm-note zpm-search zpm-add zpm-fetchurl \
40 SCRIPTS=zpm zpm-install zpm-merge zpm-list zpm-test zpm-log \
41 zpm-contents zpm-uninstall zpm-pathmod zpm-rmpackage zpm-newpackage \
42 zpm-pkg zpm-pkgfile zpm-gc zpm-repo zpm-update zpm-confgit \
45 MANPAGES=$(shell ls doc/*.8)
46 #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)
48 PROGRAMS=$(SCRIPTS) $(COMPILED)
54 printf '%s\n' $(LZMAOBJ)
57 libzpm.a: $(LIBZPMOBJ) sqlite/sqlite3.o \
62 package: zpm-$(ZPMVER)-1.zpm
65 find xz/src/liblzma -type d -name .deps -prune \
66 -o -type f -printf '%P\n' \
67 | xargs -IZ echo Z Z Z \
68 | xargs printf 'test -e lzma/%s && cp xz/src/liblzma/%s lzma/%s\n' \
71 #lzma/lz/lz_decoder.o: lzma/lz/lz_decoder.c
72 #lzma/lz/lz_encoder.o: lzma/lz/lz_encoder.c
75 $(CC) $(CFLAGS) $(LZMAFLAGS) -c -o $@ $<
77 lib/liblzma.a: $(LZMAOBJ)
80 lib/libjsw.a: $(JSWOBJ)
85 zpm-$(ZPMVER)-1.zpm: programs $(MANPAGES)
87 $(ZPM) newpackage -C zpm-$(ZPMVER)-1
88 $(ZPM) add -v -u root -g root -f $@ -P /sbin zpm-$(ZPMVER)-1 $(sort $(PROGRAMS))
89 $(ZPM) add -v -u root -g root -f $@ -P /usr/share/man/man8 -S doc $(MANPAGES)
91 tarball: zpm-$(ZPMVER)-1.tar.xz
93 zpm-$(ZPMVER)-1.tar.xz: programs
95 tar -cJf $@ --transform='s|^|sbin/|' \
102 gcc -std=c99 -Wall -c -o $@ $<
105 PATH=$(curdir)/t:$(curdir):$(PATH) t/$(T).t
107 t/ctap/prove: t/ctap/prove.o
108 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+
110 test: $(ZPKGBIN) t/ctap/prove
111 @PATH=$(curdir)/t:$(curdir):$(PATH) t/ctap/prove t/*.t
115 uncompress: uncompress.o
116 $(CC) $(CFLAGS) -o $@ $+ -llzma
118 zpm-elftype: elf/elftype.o
119 $(CC) $(CFLAGS) -Ielf $(LDFLAGS) -o $@ $+
121 zpm-soname: elf/soname.o
122 $(CC) $(CFLAGS) -Ielf $(LDFLAGS) -o $@ $+
124 zpm-soneed: elf/needed.o
125 $(CC) $(CFLAGS) -Ielf $(LDFLAGS) -o $@ $+
127 zpm-addfile: src/addfile.o libzpm.a libelf.a
128 $(CC) -Ielf $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
130 lib/sha256.o: CFLAGS+=-O3
131 lib/blake2/ref/blake2b-ref.o: CFLAGS+=-O3
134 zpm-hash: src/hash.o lib/sha256.o
135 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm
137 zpm-blake2: src/blake2.o lib/sha256.o lib/blake2/ref/blake2b-ref.o
138 $(CC) -O3 $(CFLAGS) $(LDFLAGS) -o $@ $+
140 zpm-verify: src/verify.o t/ctap/ctap.o libzpm.a
141 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< t/ctap/ctap.o -lzpm -lelf
143 zpm-init: src/init.o libzpm.a
144 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
147 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
149 zpm-extract: src/extract.o libzpm.a
150 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
152 zpm-script: src/script.o libzpm.a
153 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
155 zpm-packagehash: src/packagehash.o libzpm.a
156 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
158 src/foreach-path.o: CFLAGS+=-Wno-unused-parameter
159 src/script.o: CFLAGS+=-Wno-unused-parameter
161 zpm-foreach-path: src/foreach-path.o libzpm.a sqlite/sqlite3.h
162 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
164 zpm-findpkg: src/findpkg.o libzpm.a
165 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
167 zpm-search: src/search.o libzpm.a
168 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
170 zpm-note: src/note.o libzpm.a
171 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
173 zpm-syncfs: src/syncfs.o libzpm.a libelf.a
174 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf -lm
176 zpm-parse: src/parse.o lib/parse.o
177 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+
179 zpm-add: src/add.o libzpm.a libelf.a
180 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
182 zpm-quote: src/quote.o
183 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
185 db.sql: schema/main.sql schema/syncconflicts.sql schema/syncinfo.sql schema/preserve_packages.sql schema/age.sql schema/sign.sql
191 echo "char createdb[] = {" > $@
195 sqlite/sqlite3.o: sqlite/sqlite3.c sqlite/config.h
196 $(CC) -Wall -Wno-unused-command-line-argument -std=c99 -Ilib -D_HAVE_SQLITE_CONFIG_H=1 -c -o $@ $<
198 sqlite/extensions.o: sqlite/extensions.c
199 $(CC) -O3 -Wall -std=c99 -I. -Isqlite -DSQLITE_CORE=1 -c -o $@ $<
201 sqlite/shell.o: sqlite/shell.c sqlite/config.h Makefile
202 $(CC) -Wall -Wno-unused-command-line-argument -std=c99 -Ilib \
203 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
204 '-DSQLITE_SHELL_INIT_PROC(x)=zpm_setup_extensions(x)' \
205 -D_POSIX_C_SOURCE=200112L -c -o $@ $<
209 zpm-vercmp: src/vercmp.o lib/vercmp.o lib/parse.o
210 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+
212 zpm-shell: sqlite/sqlite3.o sqlite/shell.o sqlite/extensions.o lib/vercmp.o lib/parse.o
213 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+
215 libelf.a: elf/libelf.o
218 install: $(COMPILED) $(MANPAGES)
219 test -d $(DESTDIR)/sbin || install -d $(DESTDIR)/sbin
220 test -d $(DESTDIR)/var/lib/zpm || install -d $(DESTDIR)/var/lib/zpm
221 test -d $(DESTDIR)/var/lib/zpm/packages || install -d $(DESTDIR)/var/lib/zpm/packages
222 install $(PROGRAMS) $(DESTDIR)/sbin
223 mkdir -p $(DESTDIR)/usr/share/man/man8
224 install -m644 $(MANPAGES) $(DESTDIR)/usr/share/man/man8
226 scan-prep: clean sqlite/sqlite3.o sqlite/shell.o lib/liblzma.a
227 @echo scan-build -v -o report make -j10
246 TLSOBJ= tlse.o x25519.o chacha.o base64.o pem.o forward.o handshake.o \
247 buffer.o parse_client_hello.o parse_message.o cipher_supported.o \
248 packet_update.o hmac_message.o hkdf.o hash.o cipher_name.o
250 crypto/x25519.o: $(addprefix crypto/ref10/, $(X255OBJ))
253 crypto/%.o: CFLAGS+=-Icrypto -DTFM_DESC -DTFM_NO_ASM \
254 -Itomsfastmath/src/headers \
255 -Wno-pointer-sign -Wno-missing-braces -Ilibtomcrypt/src/headers
259 # /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
261 #/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
263 tls.o: $(addprefix crypto/, $(TLSOBJ))
272 addsub/fp_cmp_mag.o \
278 bin/fp_radix_size.o \
279 bin/fp_read_radix.o \
280 bin/fp_read_signed_bin.o \
282 bin/fp_read_unsigned_bin.o \
283 bin/fp_signed_bin_size.o \
287 bin/fp_to_signed_bin.o \
288 bin/fp_to_unsigned_bin.o \
289 bin/fp_unsigned_bin_size.o \
291 bit/fp_count_bits.o \
302 exptmod/fp_exptmod.o \
306 mont/fp_montgomery_calc_normalization.o \
307 mont/fp_montgomery_reduce.o \
308 mont/fp_montgomery_setup.o \
312 mul/fp_mul_comba_12.o \
313 mul/fp_mul_comba_17.o \
314 mul/fp_mul_comba_20.o \
315 mul/fp_mul_comba_24.o \
316 mul/fp_mul_comba_28.o \
317 mul/fp_mul_comba_32.o \
318 mul/fp_mul_comba_3.o \
319 mul/fp_mul_comba_48.o \
320 mul/fp_mul_comba_4.o \
321 mul/fp_mul_comba_64.o \
322 mul/fp_mul_comba_6.o \
323 mul/fp_mul_comba_7.o \
324 mul/fp_mul_comba_8.o \
326 mul/fp_mul_comba_small_set.o \
328 mul/fp_mul_comba_9.o \
331 numtheory/fp_invmod.o \
332 numtheory/fp_isprime.o \
333 numtheory/fp_isprime_ex.o \
335 numtheory/fp_prime_miller_rabin.o \
336 numtheory/fp_prime_random_ex.o \
338 sqr/fp_sqr_comba_12.o \
339 sqr/fp_sqr_comba_17.o \
340 sqr/fp_sqr_comba_20.o \
341 sqr/fp_sqr_comba_24.o \
342 sqr/fp_sqr_comba_28.o \
343 sqr/fp_sqr_comba_32.o \
344 sqr/fp_sqr_comba_48.o \
345 sqr/fp_sqr_comba_3.o \
346 sqr/fp_sqr_comba_4.o \
347 sqr/fp_sqr_comba_64.o \
348 sqr/fp_sqr_comba_6.o \
349 sqr/fp_sqr_comba_7.o \
350 sqr/fp_sqr_comba_8.o \
351 sqr/fp_sqr_comba_9.o \
353 sqr/fp_sqr_comba_generic.o \
354 sqr/fp_sqr_comba_small_set.o \
357 tomsfastmath/src/addsub/%.o: CFLAGS+=-DTFM_DESC -DTFM_NO_ASM -Itomsfastmath/src/headers -DARGTYPE=4
358 tomsfastmath/src/%.o: CFLAGS+=-DTFM_DESC -DTFM_NO_ASM -Itomsfastmath/src/headers -DARGTYPE=4
360 tfm.o: $(addprefix tomsfastmath/src/, $(TFMOBJ))
378 ciphers/safer/safer.o \
379 ciphers/safer/saferp.o \
381 ciphers/twofish/twofish.o \
383 encauth/ccm/ccm_add_aad.o \
384 encauth/ccm/ccm_add_nonce.o \
385 encauth/ccm/ccm_done.o \
386 encauth/ccm/ccm_init.o \
387 encauth/ccm/ccm_memory.o \
388 encauth/ccm/ccm_process.o \
389 encauth/ccm/ccm_reset.o \
390 encauth/ccm/ccm_test.o \
391 encauth/chachapoly/chacha20poly1305_add_aad.o \
392 encauth/chachapoly/chacha20poly1305_decrypt.o \
393 encauth/chachapoly/chacha20poly1305_done.o \
394 encauth/chachapoly/chacha20poly1305_encrypt.o \
395 encauth/chachapoly/chacha20poly1305_init.o \
396 encauth/chachapoly/chacha20poly1305_memory.o \
397 encauth/chachapoly/chacha20poly1305_setiv.o \
398 encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \
399 encauth/chachapoly/chacha20poly1305_test.o \
400 encauth/eax/eax_addheader.o \
401 encauth/eax/eax_decrypt.o \
402 encauth/eax/eax_decrypt_verify_memory.o \
403 encauth/eax/eax_done.o \
404 encauth/eax/eax_encrypt.o \
405 encauth/eax/eax_encrypt_authenticate_memory.o \
406 encauth/eax/eax_init.o \
407 encauth/eax/eax_test.o \
408 encauth/gcm/gcm_add_aad.o \
409 encauth/gcm/gcm_add_iv.o \
410 encauth/gcm/gcm_done.o \
411 encauth/gcm/gcm_gf_mult.o \
412 encauth/gcm/gcm_init.o \
413 encauth/gcm/gcm_memory.o \
414 encauth/gcm/gcm_mult_h.o \
415 encauth/gcm/gcm_process.o \
416 encauth/gcm/gcm_reset.o \
417 encauth/gcm/gcm_test.o \
418 misc/crypt/crypt_find_cipher_id.o \
419 misc/crypt/crypt_find_hash_any.o \
420 misc/crypt/crypt_find_hash.o \
421 encauth/ocb/ocb_decrypt.o \
422 encauth/ocb/ocb_decrypt_verify_memory.o \
423 encauth/ocb/ocb_done_decrypt.o \
424 encauth/ocb/ocb_done_encrypt.o \
425 misc/crypt/crypt_find_hash_id.o \
426 misc/crypt/crypt_find_hash_oid.o \
427 encauth/ocb/ocb_encrypt.o \
428 encauth/ocb/ocb_encrypt_authenticate_memory.o \
429 encauth/ocb/ocb_init.o \
430 encauth/ocb/ocb_ntz.o \
431 encauth/ocb/ocb_shift_xor.o \
432 encauth/ocb/ocb_test.o \
433 encauth/ocb/s_ocb_done.o \
434 encauth/ocb3/ocb3_add_aad.o \
435 encauth/ocb3/ocb3_decrypt.o \
436 encauth/ocb3/ocb3_decrypt_last.o \
437 encauth/ocb3/ocb3_decrypt_verify_memory.o \
438 encauth/ocb3/ocb3_done.o \
439 encauth/ocb3/ocb3_encrypt.o \
440 encauth/ocb3/ocb3_encrypt_authenticate_memory.o \
441 encauth/ocb3/ocb3_encrypt_last.o \
442 encauth/ocb3/ocb3_init.o \
443 encauth/ocb3/ocb3_int_ntz.o \
444 encauth/ocb3/ocb3_int_xor_blocks.o \
445 encauth/ocb3/ocb3_test.o \
449 hashes/helper/hash_file.o \
450 hashes/helper/hash_filehandle.o \
451 hashes/helper/hash_memory.o \
452 hashes/helper/hash_memory_multi.o \
461 hashes/sha2/sha224.o \
462 hashes/sha2/sha256.o \
463 hashes/sha2/sha384.o \
464 hashes/sha2/sha512.o \
465 hashes/sha2/sha512_224.o \
466 hashes/sha2/sha512_256.o \
470 hashes/whirl/whirl.o \
471 mac/blake2/blake2bmac.o \
472 mac/blake2/blake2bmac_file.o \
473 mac/blake2/blake2bmac_memory.o \
474 mac/blake2/blake2bmac_memory_multi.o \
475 mac/blake2/blake2bmac_test.o \
476 mac/blake2/blake2smac.o \
477 mac/blake2/blake2smac_file.o \
478 mac/blake2/blake2smac_memory.o \
479 mac/blake2/blake2smac_memory_multi.o \
480 mac/blake2/blake2smac_test.o \
485 mac/f9/f9_memory_multi.o \
486 mac/f9/f9_process.o \
488 mac/hmac/hmac_done.o \
489 mac/hmac/hmac_file.o \
490 mac/hmac/hmac_init.o \
491 mac/hmac/hmac_memory.o \
492 mac/hmac/hmac_memory_multi.o \
493 mac/hmac/hmac_process.o \
494 mac/hmac/hmac_test.o \
495 mac/omac/omac_done.o \
496 mac/omac/omac_file.o \
497 mac/omac/omac_init.o \
498 mac/omac/omac_memory.o \
499 mac/omac/omac_memory_multi.o \
500 mac/omac/omac_process.o \
501 misc/crypt/crypt_find_prng.o \
502 mac/omac/omac_test.o \
503 mac/pelican/pelican.o \
504 mac/pelican/pelican_memory.o \
505 mac/pelican/pelican_test.o \
506 mac/pmac/pmac_done.o \
507 mac/pmac/pmac_file.o \
508 mac/pmac/pmac_init.o \
509 mac/pmac/pmac_memory.o \
510 mac/pmac/pmac_memory_multi.o \
511 mac/pmac/pmac_ntz.o \
512 mac/pmac/pmac_process.o \
513 mac/pmac/pmac_shift_xor.o \
514 mac/pmac/pmac_test.o \
515 mac/poly1305/poly1305.o \
516 mac/poly1305/poly1305_file.o \
517 mac/poly1305/poly1305_memory.o \
518 mac/poly1305/poly1305_memory_multi.o \
519 mac/poly1305/poly1305_test.o \
520 mac/xcbc/xcbc_done.o \
521 mac/xcbc/xcbc_file.o \
522 mac/xcbc/xcbc_init.o \
523 mac/xcbc/xcbc_memory.o \
524 mac/xcbc/xcbc_memory_multi.o \
525 mac/xcbc/xcbc_process.o \
526 mac/xcbc/xcbc_test.o \
527 math/fp/ltc_ecc_fp_mulmod.o \
531 math/radix_to_bin.o \
536 misc/base64/base64_decode.o \
537 misc/base64/base64_encode.o \
539 misc/compare_testvector.o \
542 misc/crypt/crypt_argchk.o \
543 misc/crypt/crypt_cipher_descriptor.o \
544 misc/crypt/crypt_cipher_is_valid.o \
545 misc/crypt/crypt_constants.o \
546 misc/crypt/crypt_find_cipher.o \
547 misc/crypt/crypt_find_cipher_any.o \
548 misc/crypt/crypt_fsa.o \
549 misc/crypt/crypt_hash_descriptor.o \
550 misc/crypt/crypt_hash_is_valid.o \
551 misc/crypt/crypt_inits.o \
552 misc/crypt/crypt_ltc_mp_descriptor.o \
553 misc/crypt/crypt_prng_descriptor.o \
554 misc/crypt/crypt_prng_is_valid.o \
555 misc/crypt/crypt_prng_rng_descriptor.o \
556 misc/crypt/crypt_register_all_ciphers.o \
557 misc/crypt/crypt_register_all_hashes.o \
558 misc/crypt/crypt_register_all_prngs.o \
559 misc/crypt/crypt_register_cipher.o \
560 misc/crypt/crypt_register_hash.o \
561 misc/crypt/crypt_register_prng.o \
562 misc/crypt/crypt_sizes.o \
563 misc/crypt/crypt_unregister_cipher.o \
564 misc/crypt/crypt_unregister_hash.o \
565 misc/crypt/crypt_unregister_prng.o \
566 misc/error_to_string.o \
568 misc/hkdf/hkdf_test.o \
571 misc/pkcs5/pkcs_5_1.o \
572 misc/pkcs5/pkcs_5_2.o \
573 misc/pkcs5/pkcs_5_test.o \
575 modes/cbc/cbc_decrypt.o \
576 modes/cbc/cbc_done.o \
577 modes/cbc/cbc_encrypt.o \
578 modes/cbc/cbc_getiv.o \
579 modes/cbc/cbc_setiv.o \
580 modes/cbc/cbc_start.o \
581 modes/cfb/cfb_decrypt.o \
582 modes/cfb/cfb_done.o \
583 modes/cfb/cfb_encrypt.o \
584 modes/cfb/cfb_getiv.o \
585 modes/cfb/cfb_setiv.o \
586 modes/cfb/cfb_start.o \
587 modes/ctr/ctr_decrypt.o \
588 modes/ctr/ctr_done.o \
589 modes/ctr/ctr_encrypt.o \
590 modes/ctr/ctr_getiv.o \
591 modes/ctr/ctr_setiv.o \
592 modes/ctr/ctr_start.o \
593 modes/ctr/ctr_test.o \
594 modes/ecb/ecb_decrypt.o \
595 modes/ecb/ecb_done.o \
596 modes/ecb/ecb_encrypt.o \
597 modes/ecb/ecb_start.o \
598 modes/f8/f8_decrypt.o \
600 modes/f8/f8_encrypt.o \
601 modes/f8/f8_getiv.o \
602 modes/f8/f8_setiv.o \
603 modes/f8/f8_start.o \
604 modes/f8/f8_test_mode.o \
605 modes/lrw/lrw_decrypt.o \
606 modes/lrw/lrw_done.o \
607 modes/lrw/lrw_encrypt.o \
608 modes/lrw/lrw_getiv.o \
609 modes/lrw/lrw_process.o \
610 modes/lrw/lrw_start.o \
611 modes/lrw/lrw_setiv.o \
612 modes/lrw/lrw_test.o \
613 modes/ofb/ofb_decrypt.o \
614 modes/ofb/ofb_done.o \
615 modes/ofb/ofb_encrypt.o \
616 modes/ofb/ofb_getiv.o \
617 modes/ofb/ofb_setiv.o \
618 modes/ofb/ofb_start.o \
619 modes/xts/xts_decrypt.o \
620 modes/xts/xts_done.o \
621 modes/xts/xts_encrypt.o \
622 modes/xts/xts_init.o \
623 modes/xts/xts_mult_x.o \
624 modes/xts/xts_test.o \
625 pk/asn1/der/bit/der_decode_bit_string.o \
626 pk/asn1/der/bit/der_decode_raw_bit_string.o \
627 pk/asn1/der/bit/der_encode_bit_string.o \
628 pk/asn1/der/bit/der_encode_raw_bit_string.o \
629 pk/asn1/der/bit/der_length_bit_string.o \
630 pk/asn1/der/boolean/der_decode_boolean.o \
631 pk/asn1/der/boolean/der_encode_boolean.o \
632 pk/asn1/der/boolean/der_length_boolean.o \
633 pk/asn1/der/choice/der_decode_choice.o \
634 pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \
635 pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \
636 pk/asn1/der/generalizedtime/der_length_generalizedtime.o \
637 pk/asn1/der/ia5/der_decode_ia5_string.o \
638 pk/asn1/der/ia5/der_encode_ia5_string.o \
639 pk/asn1/der/ia5/der_length_ia5_string.o \
640 pk/asn1/der/integer/der_decode_integer.o \
641 pk/asn1/der/integer/der_encode_integer.o \
642 pk/asn1/der/integer/der_length_integer.o \
643 pk/asn1/der/object_identifier/der_decode_object_identifier.o \
644 pk/asn1/der/object_identifier/der_encode_object_identifier.o \
645 pk/asn1/der/object_identifier/der_length_object_identifier.o \
646 pk/asn1/der/octet/der_decode_octet_string.o \
647 pk/asn1/der/octet/der_encode_octet_string.o \
648 pk/asn1/der/octet/der_length_octet_string.o \
649 pk/asn1/der/printable_string/der_decode_printable_string.o \
650 pk/asn1/der/printable_string/der_encode_printable_string.o \
651 pk/asn1/der/printable_string/der_length_printable_string.o \
652 pk/asn1/der/sequence/der_decode_sequence_ex.o \
653 pk/asn1/der/sequence/der_decode_sequence_flexi.o \
654 pk/asn1/der/sequence/der_decode_sequence_multi.o \
655 pk/asn1/der/sequence/der_decode_subject_public_key_info.o \
656 pk/asn1/der/sequence/der_encode_sequence_ex.o \
657 pk/asn1/der/sequence/der_encode_sequence_multi.o \
658 pk/asn1/der/sequence/der_encode_subject_public_key_info.o \
659 pk/asn1/der/sequence/der_length_sequence.o \
660 pk/asn1/der/sequence/der_sequence_free.o \
661 pk/asn1/der/sequence/der_sequence_shrink.o \
662 pk/asn1/der/set/der_encode_set.o \
663 pk/asn1/der/set/der_encode_setof.o \
664 pk/asn1/der/short_integer/der_decode_short_integer.o \
665 pk/asn1/der/short_integer/der_encode_short_integer.o \
666 pk/asn1/der/short_integer/der_length_short_integer.o \
667 pk/asn1/der/teletex_string/der_decode_teletex_string.o \
668 pk/asn1/der/teletex_string/der_length_teletex_string.o \
669 pk/asn1/der/utctime/der_decode_utctime.o \
670 pk/asn1/der/utctime/der_encode_utctime.o \
671 pk/asn1/der/utf8/der_decode_utf8_string.o \
672 pk/asn1/der/utctime/der_length_utctime.o \
673 pk/asn1/der/utf8/der_encode_utf8_string.o \
674 pk/asn1/der/utf8/der_length_utf8_string.o \
676 pk/dh/dh_check_pubkey.o \
678 pk/dh/dh_export_key.o \
680 pk/dh/dh_generate_key.o \
683 pk/dh/dh_set_pg_dhparam.o \
684 pk/dh/dh_shared_secret.o \
685 pk/dsa/dsa_decrypt_key.o \
686 pk/dsa/dsa_encrypt_key.o \
687 pk/dsa/dsa_export.o \
688 pk/dsa/dsa_generate_key.o \
689 pk/dsa/dsa_generate_pqg.o \
691 pk/dsa/dsa_import.o \
692 pk/dsa/dsa_make_key.o \
694 pk/dsa/dsa_set_pqg_dsaparam.o \
695 pk/dsa/dsa_shared_secret.o \
696 pk/dsa/dsa_sign_hash.o \
697 pk/dsa/dsa_verify_hash.o \
698 pk/dsa/dsa_verify_key.o \
700 pk/ecc/ecc_ansi_x963_export.o \
701 pk/ecc/ecc_ansi_x963_import.o \
702 pk/ecc/ecc_decrypt_key.o \
703 pk/ecc/ecc_encrypt_key.o \
704 pk/ecc/ecc_export.o \
706 pk/ecc/ecc_get_size.o \
707 pk/ecc/ecc_import.o \
708 pk/ecc/ecc_make_key.o \
709 pk/ecc/ecc_shared_secret.o \
710 pk/ecc/ecc_sign_hash.o \
713 pk/ecc/ecc_verify_hash.o \
714 pk/ecc/ltc_ecc_map.o \
715 pk/ecc/ltc_ecc_is_valid_idx.o \
716 pk/ecc/ltc_ecc_mul2add.o \
717 pk/ecc/ltc_ecc_mulmod.o \
718 pk/ecc/ltc_ecc_mulmod_timing.o \
719 pk/ecc/ltc_ecc_points.o \
720 pk/ecc/ltc_ecc_projective_add_point.o \
721 pk/ecc/ltc_ecc_projective_dbl_point.o \
722 pk/katja/katja_decrypt_key.o \
723 pk/katja/katja_encrypt_key.o \
724 pk/katja/katja_export.o \
725 pk/katja/katja_exptmod.o \
726 pk/katja/katja_free.o \
727 pk/katja/katja_import.o \
728 pk/katja/katja_make_key.o \
729 pk/pkcs1/pkcs_1_i2osp.o \
730 pk/pkcs1/pkcs_1_mgf1.o \
731 pk/pkcs1/pkcs_1_oaep_decode.o \
732 pk/pkcs1/pkcs_1_oaep_encode.o \
733 pk/pkcs1/pkcs_1_os2ip.o \
734 pk/pkcs1/pkcs_1_pss_decode.o \
735 pk/pkcs1/pkcs_1_pss_encode.o \
736 pk/pkcs1/pkcs_1_v1_5_decode.o \
737 pk/pkcs1/pkcs_1_v1_5_encode.o \
738 pk/rsa/rsa_decrypt_key.o \
739 pk/rsa/rsa_encrypt_key.o \
740 pk/rsa/rsa_export.o \
741 pk/rsa/rsa_exptmod.o \
743 pk/rsa/rsa_get_size.o \
744 pk/rsa/rsa_import.o \
745 pk/rsa/rsa_import_pkcs8.o \
746 pk/rsa/rsa_import_x509.o \
747 pk/rsa/rsa_make_key.o \
749 pk/rsa/rsa_sign_hash.o \
750 pk/rsa/rsa_sign_saltlen_get.o \
751 pk/rsa/rsa_verify_hash.o \
755 prngs/rng_get_bytes.o \
756 prngs/rng_make_prng.o \
760 stream/chacha/chacha_crypt.o \
761 stream/chacha/chacha_done.o \
762 stream/chacha/chacha_ivctr32.o \
763 stream/chacha/chacha_ivctr64.o \
764 stream/chacha/chacha_keystream.o \
765 stream/chacha/chacha_setup.o \
766 stream/chacha/chacha_test.o \
767 stream/rc4/rc4_stream.o \
768 stream/rc4/rc4_test.o \
769 stream/sober128/sober128_stream.o \
770 stream/sober128/sober128_test.o
772 libtomcrypt/%.o: CFLAGS+=-DTFM_DESC -Isrc/headers -Itomsfastmath/src/headers -DARGTYPE=4 -DLTC_NO_ASM -DTFM_NO_ASM -Ilibtomcrypt/src/headers -DLTC_SOURCE
774 ltc.o: $(addprefix libtomcrypt/src/, $(LTCOBJ))
777 crypto/rfc3986.c: crypto/rfc3986.re
778 re2c --input custom --tags -o $@ $<
781 $(CC) -Wall -W -Wextra -Werror -o $@ $+
783 src/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
785 zpm-fetchurl: ltc.o tls.o tfm.o src/fetchurl.o crypto/https.o crypto/rfc3986.o
786 $(CC) $(CFLAGS) -static -o $@ $+
788 testddg: zpm-fetchurl
789 ./zpm-fetchurl duckduckgo.com 443 /
791 testgra: zpm-fetchurl
792 ./zpm-fetchurl granicus.if.org 443 /
795 crypto/libeddsa/sign.c \
796 crypto/libeddsa/lib/burn.c \
797 crypto/libeddsa/lib/burnstack.c \
798 crypto/libeddsa/lib/ed.c \
799 crypto/libeddsa/lib/ed25519-sha512.c \
800 crypto/libeddsa/lib/fld.c \
801 crypto/libeddsa/lib/sc.c \
802 crypto/libeddsa/lib/sha512.c \
803 crypto/libeddsa/lib/x25519.c
805 SIGNOBJ=$(SIGNSRC:.c=.o) lib/readpass.o lib/blake2/ref/blake2b-ref.o \
808 $(SIGNOBJ): CFLAGS=-Wall -Wextra -W -Werror -Wno-pointer-sign \
809 -Wno-missing-braces \
810 -Icrypto/libeddsa/lib -Wno-unused-command-line-argument \
814 $(CC) -Wall -Wextra -W -Werror -Wno-unused-command-line-argument -static -o $@ $+
817 rm -f *.o sqlite/*.o lib/*.o $(LZMAOBJ) liblzma.a \
818 libelf.a libzpm.a zpm-addfile soname \
824 elf/*.o lib/jsw/*.o \
825 $(addprefix crypto/ref10/, $(X255OBJ)) \
826 $(addprefix crypto/, $(TLSOBJ)) \
827 $(addprefix tomsfastmath/src/, $(TFMOBJ)) \
828 $(addprefix libtomcrypt/src/, $(LTCOBJ)) \