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 \
30 LIBZPMOBJ=$(addprefix lib/, $(LIBZPMSRC:%.c=%.o))
34 COMPILED=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 BINARIES=$(addprefix bin/, $(COMPILED))
42 SCRIPTS=zpm zpm-install zpm-merge zpm-list zpm-test zpm-log \
43 zpm-contents zpm-uninstall zpm-pathmod zpm-rmpackage zpm-newpackage \
44 zpm-pkg zpm-pkgfile zpm-gc zpm-repo zpm-update zpm-confgit \
47 MANPAGES=$(shell ls doc/*.8)
48 #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)
49 PROGRAMS=$(addprefix bin/, $(SCRIPTS)) $(BINARIES)
55 printf '%s\n' $(LZMAOBJ)
58 libzpm.a: $(LIBZPMOBJ) sqlite/sqlite3.o \
63 package: zpm-$(ZPMVER)-1.zpm
66 find xz/src/liblzma -type d -name .deps -prune \
67 -o -type f -printf '%P\n' \
68 | xargs -IZ echo Z Z Z \
69 | xargs printf 'test -e lzma/%s && cp xz/src/liblzma/%s lzma/%s\n' \
72 #lzma/lz/lz_decoder.o: lzma/lz/lz_decoder.c
73 #lzma/lz/lz_encoder.o: lzma/lz/lz_encoder.c
76 $(CC) $(CFLAGS) $(LZMAFLAGS) -c -o $@ $<
78 lib/liblzma.a: $(LZMAOBJ)
81 lib/libjsw.a: $(JSWOBJ)
86 zpm-$(ZPMVER)-1.zpm: programs $(MANPAGES)
88 $(ZPM) newpackage -C zpm-$(ZPMVER)-1
89 $(ZPM) add -v -u root -g root -f $@ -P /sbin zpm-$(ZPMVER)-1 $(sort $(PROGRAMS))
90 $(ZPM) add -v -u root -g root -f $@ -P /usr/share/man/man8 -S doc $(MANPAGES)
92 tarball: zpm-$(ZPMVER)-1.tar.xz
94 zpm-$(ZPMVER)-1.tar.xz: programs
96 tar -cJf $@ --transform='s|^|sbin/|' \
103 gcc -std=c99 -Wall -c -o $@ $<
106 PATH=$(curdir)/t:$(curdir)/bin:$(PATH) t/$(T).t
108 t/ctap/prove: t/ctap/prove.o
109 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+
111 test: $(ZPKGBIN) t/ctap/prove
112 @PATH=$(curdir)/t:$(curdir)/bin:$(PATH) t/ctap/prove t/*.t
114 programs: $(PROGRAMS)
116 uncompress: uncompress.o
117 $(CC) $(CFLAGS) -o $@ $+ -llzma
119 bin/zpm-elftype: elf/elftype.o
120 $(CC) $(CFLAGS) -Ielf $(LDFLAGS) -o $@ $+
122 bin/zpm-soname: elf/soname.o
123 $(CC) $(CFLAGS) -Ielf $(LDFLAGS) -o $@ $+
125 bin/zpm-soneed: elf/needed.o
126 $(CC) $(CFLAGS) -Ielf $(LDFLAGS) -o $@ $+
128 bin/zpm-addfile: src/addfile.o libzpm.a libelf.a
129 $(CC) -Ielf $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
131 lib/sha256.o: CFLAGS+=-O3
132 lib/blake2/ref/blake2b-ref.o: CFLAGS+=-O3
135 bin/zpm-hash: src/hash.o lib/sha256.o
136 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm
138 bin/zpm-blake2: src/blake2.o lib/sha256.o lib/blake2/ref/blake2b-ref.o
139 $(CC) -O3 $(CFLAGS) $(LDFLAGS) -o $@ $+
141 bin/zpm-verify: src/verify.o t/ctap/ctap.o libzpm.a
142 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< t/ctap/ctap.o -lzpm -lelf
144 bin/zpm-init: src/init.o libzpm.a
145 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
147 bin/zpm-stat: src/stat.o
148 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
150 bin/zpm-extract: src/extract.o libzpm.a
151 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
153 bin/zpm-script: src/script.o libzpm.a
154 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
156 bin/zpm-packagehash: src/packagehash.o libzpm.a
157 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
159 src/foreach-path.o: CFLAGS+=-Wno-unused-parameter
160 src/script.o: CFLAGS+=-Wno-unused-parameter
162 bin/zpm-foreach-path: src/foreach-path.o libzpm.a sqlite/sqlite3.h
163 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
165 bin/zpm-findpkg: src/findpkg.o libzpm.a
166 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
168 bin/zpm-search: src/search.o libzpm.a
169 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
171 bin/zpm-note: src/note.o libzpm.a
172 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
174 bin/zpm-syncfs: src/syncfs.o libzpm.a libelf.a
175 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf -lm
177 bin/zpm-parse: src/parse.o lib/parse.o
178 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+
180 bin/zpm-add: src/add.o libzpm.a libelf.a
181 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf
183 bin/zpm-quote: src/quote.o
184 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
186 db.sql: schema/main.sql schema/syncconflicts.sql schema/syncinfo.sql schema/preserve_packages.sql schema/age.sql schema/sign.sql
192 echo "char createdb[] = {" > $@
196 sqlite/sqlite3.o: sqlite/sqlite3.c sqlite/config.h
197 $(CC) -Wall -Wno-unused-command-line-argument -std=c99 -Ilib -D_HAVE_SQLITE_CONFIG_H=1 -c -o $@ $<
199 sqlite/extensions.o: sqlite/extensions.c
200 $(CC) -O3 -Wall -std=c99 -I. -Isqlite -DSQLITE_CORE=1 -c -o $@ $<
202 sqlite/shell.o: sqlite/shell.c sqlite/config.h Makefile
203 $(CC) -Wall -Wno-unused-command-line-argument -std=c99 -Ilib \
204 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
205 '-DSQLITE_SHELL_INIT_PROC(x)=zpm_setup_extensions(x)' \
206 -D_POSIX_C_SOURCE=200112L -c -o $@ $<
210 bin/zpm-vercmp: src/vercmp.o lib/vercmp.o lib/parse.o
211 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+
213 bin/zpm-shell: sqlite/sqlite3.o sqlite/shell.o sqlite/extensions.o lib/vercmp.o lib/parse.o
214 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+
216 libelf.a: elf/libelf.o
219 install: $(COMPILED) $(MANPAGES)
220 test -d $(DESTDIR)/sbin || install -d $(DESTDIR)/sbin
221 test -d $(DESTDIR)/var/lib/zpm || install -d $(DESTDIR)/var/lib/zpm
222 test -d $(DESTDIR)/var/lib/zpm/packages || install -d $(DESTDIR)/var/lib/zpm/packages
223 install $(PROGRAMS) $(DESTDIR)/sbin
224 mkdir -p $(DESTDIR)/usr/share/man/man8
225 install -m644 $(MANPAGES) $(DESTDIR)/usr/share/man/man8
227 scan-prep: clean sqlite/sqlite3.o sqlite/shell.o lib/liblzma.a
228 @echo scan-build -v -o report make -j10
247 TLSOBJ= tlse.o x25519.o chacha.o base64.o pem.o forward.o handshake.o \
248 buffer.o parse_client_hello.o parse_message.o cipher_supported.o \
249 packet_update.o hmac_message.o hkdf.o hash.o cipher_name.o
251 crypto/x25519.o: $(addprefix crypto/ref10/, $(X255OBJ))
254 crypto/%.o: CFLAGS+=-Icrypto -DTFM_DESC -DTFM_NO_ASM \
255 -Itomsfastmath/src/headers \
256 -Wno-pointer-sign -Wno-missing-braces -Ilibtomcrypt/src/headers
260 # /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
262 #/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
264 crypto/tls.o: $(addprefix crypto/, $(TLSOBJ))
273 addsub/fp_cmp_mag.o \
279 bin/fp_radix_size.o \
280 bin/fp_read_radix.o \
281 bin/fp_read_signed_bin.o \
283 bin/fp_read_unsigned_bin.o \
284 bin/fp_signed_bin_size.o \
288 bin/fp_to_signed_bin.o \
289 bin/fp_to_unsigned_bin.o \
290 bin/fp_unsigned_bin_size.o \
292 bit/fp_count_bits.o \
303 exptmod/fp_exptmod.o \
307 mont/fp_montgomery_calc_normalization.o \
308 mont/fp_montgomery_reduce.o \
309 mont/fp_montgomery_setup.o \
313 mul/fp_mul_comba_12.o \
314 mul/fp_mul_comba_17.o \
315 mul/fp_mul_comba_20.o \
316 mul/fp_mul_comba_24.o \
317 mul/fp_mul_comba_28.o \
318 mul/fp_mul_comba_32.o \
319 mul/fp_mul_comba_3.o \
320 mul/fp_mul_comba_48.o \
321 mul/fp_mul_comba_4.o \
322 mul/fp_mul_comba_64.o \
323 mul/fp_mul_comba_6.o \
324 mul/fp_mul_comba_7.o \
325 mul/fp_mul_comba_8.o \
327 mul/fp_mul_comba_small_set.o \
329 mul/fp_mul_comba_9.o \
332 numtheory/fp_invmod.o \
333 numtheory/fp_isprime.o \
334 numtheory/fp_isprime_ex.o \
336 numtheory/fp_prime_miller_rabin.o \
337 numtheory/fp_prime_random_ex.o \
339 sqr/fp_sqr_comba_12.o \
340 sqr/fp_sqr_comba_17.o \
341 sqr/fp_sqr_comba_20.o \
342 sqr/fp_sqr_comba_24.o \
343 sqr/fp_sqr_comba_28.o \
344 sqr/fp_sqr_comba_32.o \
345 sqr/fp_sqr_comba_48.o \
346 sqr/fp_sqr_comba_3.o \
347 sqr/fp_sqr_comba_4.o \
348 sqr/fp_sqr_comba_64.o \
349 sqr/fp_sqr_comba_6.o \
350 sqr/fp_sqr_comba_7.o \
351 sqr/fp_sqr_comba_8.o \
352 sqr/fp_sqr_comba_9.o \
354 sqr/fp_sqr_comba_generic.o \
355 sqr/fp_sqr_comba_small_set.o \
358 tomsfastmath/src/addsub/%.o: CFLAGS+=-DTFM_DESC -DTFM_NO_ASM -Itomsfastmath/src/headers -DARGTYPE=4
360 tomsfastmath/src/%.o: CFLAGS+=-DTFM_DESC -DTFM_NO_ASM -Itomsfastmath/src/headers -DARGTYPE=4
362 tfm.o: $(addprefix tomsfastmath/src/, $(TFMOBJ))
369 ciphers/twofish/twofish.o \
370 encauth/ccm/ccm_add_aad.o \
371 encauth/ccm/ccm_add_nonce.o \
372 encauth/ccm/ccm_done.o \
373 encauth/ccm/ccm_init.o \
374 encauth/ccm/ccm_memory.o \
375 encauth/ccm/ccm_process.o \
376 encauth/ccm/ccm_reset.o \
377 encauth/ccm/ccm_test.o \
378 encauth/chachapoly/chacha20poly1305_add_aad.o \
379 encauth/chachapoly/chacha20poly1305_decrypt.o \
380 encauth/chachapoly/chacha20poly1305_done.o \
381 encauth/chachapoly/chacha20poly1305_encrypt.o \
382 encauth/chachapoly/chacha20poly1305_init.o \
383 encauth/chachapoly/chacha20poly1305_memory.o \
384 encauth/chachapoly/chacha20poly1305_setiv.o \
385 encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \
386 encauth/chachapoly/chacha20poly1305_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 misc/crypt/crypt_find_hash_id.o \
401 misc/crypt/crypt_find_hash_oid.o \
405 hashes/helper/hash_file.o \
406 hashes/helper/hash_filehandle.o \
407 hashes/helper/hash_memory.o \
408 hashes/helper/hash_memory_multi.o \
410 hashes/sha2/sha256.o \
411 hashes/sha2/sha384.o \
412 hashes/sha2/sha512.o \
413 hashes/sha2/sha512_256.o \
416 hashes/whirl/whirl.o \
417 mac/blake2/blake2bmac.o \
418 mac/blake2/blake2bmac_file.o \
419 mac/blake2/blake2bmac_memory.o \
420 mac/blake2/blake2bmac_memory_multi.o \
421 mac/blake2/blake2bmac_test.o \
422 mac/blake2/blake2smac.o \
423 mac/blake2/blake2smac_file.o \
424 mac/blake2/blake2smac_memory.o \
425 mac/blake2/blake2smac_memory_multi.o \
426 mac/blake2/blake2smac_test.o \
427 mac/hmac/hmac_done.o \
428 mac/hmac/hmac_file.o \
429 mac/hmac/hmac_init.o \
430 mac/hmac/hmac_memory.o \
431 mac/hmac/hmac_memory_multi.o \
432 mac/hmac/hmac_process.o \
433 mac/hmac/hmac_test.o \
434 mac/omac/omac_done.o \
435 mac/omac/omac_file.o \
436 mac/omac/omac_init.o \
437 mac/omac/omac_memory.o \
438 mac/omac/omac_memory_multi.o \
439 mac/omac/omac_process.o \
440 misc/crypt/crypt_find_prng.o \
441 mac/omac/omac_test.o \
442 mac/poly1305/poly1305.o \
443 mac/poly1305/poly1305_file.o \
444 mac/poly1305/poly1305_memory.o \
445 mac/poly1305/poly1305_memory_multi.o \
446 mac/poly1305/poly1305_test.o \
447 mac/xcbc/xcbc_done.o \
448 mac/xcbc/xcbc_file.o \
449 mac/xcbc/xcbc_init.o \
450 mac/xcbc/xcbc_memory.o \
451 mac/xcbc/xcbc_memory_multi.o \
452 mac/xcbc/xcbc_process.o \
453 mac/xcbc/xcbc_test.o \
454 math/fp/ltc_ecc_fp_mulmod.o \
458 math/radix_to_bin.o \
463 misc/base64/base64_decode.o \
464 misc/base64/base64_encode.o \
466 misc/compare_testvector.o \
469 misc/crypt/crypt_argchk.o \
470 misc/crypt/crypt_cipher_descriptor.o \
471 misc/crypt/crypt_cipher_is_valid.o \
472 misc/crypt/crypt_constants.o \
473 misc/crypt/crypt_find_cipher.o \
474 misc/crypt/crypt_find_cipher_any.o \
475 misc/crypt/crypt_fsa.o \
476 misc/crypt/crypt_hash_descriptor.o \
477 misc/crypt/crypt_hash_is_valid.o \
478 misc/crypt/crypt_inits.o \
479 misc/crypt/crypt_ltc_mp_descriptor.o \
480 misc/crypt/crypt_prng_descriptor.o \
481 misc/crypt/crypt_prng_is_valid.o \
482 misc/crypt/crypt_prng_rng_descriptor.o \
483 misc/crypt/crypt_register_all_ciphers.o \
484 misc/crypt/crypt_register_all_hashes.o \
485 misc/crypt/crypt_register_all_prngs.o \
486 misc/crypt/crypt_register_cipher.o \
487 misc/crypt/crypt_register_hash.o \
488 misc/crypt/crypt_register_prng.o \
489 misc/crypt/crypt_sizes.o \
490 misc/crypt/crypt_unregister_cipher.o \
491 misc/crypt/crypt_unregister_hash.o \
492 misc/crypt/crypt_unregister_prng.o \
493 misc/error_to_string.o \
495 misc/hkdf/hkdf_test.o \
498 misc/pkcs5/pkcs_5_1.o \
499 misc/pkcs5/pkcs_5_2.o \
500 misc/pkcs5/pkcs_5_test.o \
502 modes/cbc/cbc_decrypt.o \
503 modes/cbc/cbc_done.o \
504 modes/cbc/cbc_encrypt.o \
505 modes/cbc/cbc_getiv.o \
506 modes/cbc/cbc_setiv.o \
507 modes/cbc/cbc_start.o \
508 modes/cfb/cfb_decrypt.o \
509 modes/cfb/cfb_done.o \
510 modes/cfb/cfb_encrypt.o \
511 modes/cfb/cfb_getiv.o \
512 modes/cfb/cfb_setiv.o \
513 modes/cfb/cfb_start.o \
514 modes/ctr/ctr_decrypt.o \
515 modes/ctr/ctr_done.o \
516 modes/ctr/ctr_encrypt.o \
517 modes/ctr/ctr_getiv.o \
518 modes/ctr/ctr_setiv.o \
519 modes/ctr/ctr_start.o \
520 modes/ctr/ctr_test.o \
521 modes/ecb/ecb_decrypt.o \
522 modes/ecb/ecb_done.o \
523 modes/ecb/ecb_encrypt.o \
524 modes/ecb/ecb_start.o \
525 modes/f8/f8_decrypt.o \
527 modes/f8/f8_encrypt.o \
528 modes/f8/f8_getiv.o \
529 modes/f8/f8_setiv.o \
530 modes/f8/f8_start.o \
531 modes/f8/f8_test_mode.o \
532 modes/lrw/lrw_decrypt.o \
533 modes/lrw/lrw_done.o \
534 modes/lrw/lrw_encrypt.o \
535 modes/lrw/lrw_getiv.o \
536 modes/lrw/lrw_process.o \
537 modes/lrw/lrw_start.o \
538 modes/lrw/lrw_setiv.o \
539 modes/lrw/lrw_test.o \
540 modes/ofb/ofb_decrypt.o \
541 modes/ofb/ofb_done.o \
542 modes/ofb/ofb_encrypt.o \
543 modes/ofb/ofb_getiv.o \
544 modes/ofb/ofb_setiv.o \
545 modes/ofb/ofb_start.o \
546 modes/xts/xts_decrypt.o \
547 modes/xts/xts_done.o \
548 modes/xts/xts_encrypt.o \
549 modes/xts/xts_init.o \
550 modes/xts/xts_mult_x.o \
551 modes/xts/xts_test.o \
552 pk/asn1/der/bit/der_decode_bit_string.o \
553 pk/asn1/der/bit/der_decode_raw_bit_string.o \
554 pk/asn1/der/bit/der_encode_bit_string.o \
555 pk/asn1/der/bit/der_encode_raw_bit_string.o \
556 pk/asn1/der/bit/der_length_bit_string.o \
557 pk/asn1/der/boolean/der_decode_boolean.o \
558 pk/asn1/der/boolean/der_encode_boolean.o \
559 pk/asn1/der/boolean/der_length_boolean.o \
560 pk/asn1/der/choice/der_decode_choice.o \
561 pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \
562 pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \
563 pk/asn1/der/generalizedtime/der_length_generalizedtime.o \
564 pk/asn1/der/ia5/der_decode_ia5_string.o \
565 pk/asn1/der/ia5/der_encode_ia5_string.o \
566 pk/asn1/der/ia5/der_length_ia5_string.o \
567 pk/asn1/der/integer/der_decode_integer.o \
568 pk/asn1/der/integer/der_encode_integer.o \
569 pk/asn1/der/integer/der_length_integer.o \
570 pk/asn1/der/object_identifier/der_decode_object_identifier.o \
571 pk/asn1/der/object_identifier/der_encode_object_identifier.o \
572 pk/asn1/der/object_identifier/der_length_object_identifier.o \
573 pk/asn1/der/octet/der_decode_octet_string.o \
574 pk/asn1/der/octet/der_encode_octet_string.o \
575 pk/asn1/der/octet/der_length_octet_string.o \
576 pk/asn1/der/printable_string/der_decode_printable_string.o \
577 pk/asn1/der/printable_string/der_encode_printable_string.o \
578 pk/asn1/der/printable_string/der_length_printable_string.o \
579 pk/asn1/der/sequence/der_decode_sequence_ex.o \
580 pk/asn1/der/sequence/der_decode_sequence_flexi.o \
581 pk/asn1/der/sequence/der_decode_sequence_multi.o \
582 pk/asn1/der/sequence/der_decode_subject_public_key_info.o \
583 pk/asn1/der/sequence/der_encode_sequence_ex.o \
584 pk/asn1/der/sequence/der_encode_sequence_multi.o \
585 pk/asn1/der/sequence/der_encode_subject_public_key_info.o \
586 pk/asn1/der/sequence/der_length_sequence.o \
587 pk/asn1/der/sequence/der_sequence_free.o \
588 pk/asn1/der/sequence/der_sequence_shrink.o \
589 pk/asn1/der/set/der_encode_set.o \
590 pk/asn1/der/set/der_encode_setof.o \
591 pk/asn1/der/short_integer/der_decode_short_integer.o \
592 pk/asn1/der/short_integer/der_encode_short_integer.o \
593 pk/asn1/der/short_integer/der_length_short_integer.o \
594 pk/asn1/der/teletex_string/der_decode_teletex_string.o \
595 pk/asn1/der/teletex_string/der_length_teletex_string.o \
596 pk/asn1/der/utctime/der_decode_utctime.o \
597 pk/asn1/der/utctime/der_encode_utctime.o \
598 pk/asn1/der/utf8/der_decode_utf8_string.o \
599 pk/asn1/der/utctime/der_length_utctime.o \
600 pk/asn1/der/utf8/der_encode_utf8_string.o \
601 pk/asn1/der/utf8/der_length_utf8_string.o \
603 pk/dh/dh_check_pubkey.o \
605 pk/dh/dh_export_key.o \
607 pk/dh/dh_generate_key.o \
610 pk/dh/dh_set_pg_dhparam.o \
611 pk/dh/dh_shared_secret.o \
612 pk/dsa/dsa_decrypt_key.o \
613 pk/dsa/dsa_encrypt_key.o \
614 pk/dsa/dsa_export.o \
615 pk/dsa/dsa_generate_key.o \
616 pk/dsa/dsa_generate_pqg.o \
618 pk/dsa/dsa_import.o \
619 pk/dsa/dsa_make_key.o \
621 pk/dsa/dsa_set_pqg_dsaparam.o \
622 pk/dsa/dsa_shared_secret.o \
623 pk/dsa/dsa_sign_hash.o \
624 pk/dsa/dsa_verify_hash.o \
625 pk/dsa/dsa_verify_key.o \
627 pk/ecc/ecc_ansi_x963_export.o \
628 pk/ecc/ecc_ansi_x963_import.o \
629 pk/ecc/ecc_decrypt_key.o \
630 pk/ecc/ecc_encrypt_key.o \
631 pk/ecc/ecc_export.o \
633 pk/ecc/ecc_get_size.o \
634 pk/ecc/ecc_import.o \
635 pk/ecc/ecc_make_key.o \
636 pk/ecc/ecc_shared_secret.o \
637 pk/ecc/ecc_sign_hash.o \
640 pk/ecc/ecc_verify_hash.o \
641 pk/ecc/ltc_ecc_map.o \
642 pk/ecc/ltc_ecc_is_valid_idx.o \
643 pk/ecc/ltc_ecc_mul2add.o \
644 pk/ecc/ltc_ecc_mulmod.o \
645 pk/ecc/ltc_ecc_mulmod_timing.o \
646 pk/ecc/ltc_ecc_points.o \
647 pk/ecc/ltc_ecc_projective_add_point.o \
648 pk/ecc/ltc_ecc_projective_dbl_point.o \
649 pk/pkcs1/pkcs_1_i2osp.o \
650 pk/pkcs1/pkcs_1_mgf1.o \
651 pk/pkcs1/pkcs_1_oaep_decode.o \
652 pk/pkcs1/pkcs_1_oaep_encode.o \
653 pk/pkcs1/pkcs_1_os2ip.o \
654 pk/pkcs1/pkcs_1_pss_decode.o \
655 pk/pkcs1/pkcs_1_pss_encode.o \
656 pk/pkcs1/pkcs_1_v1_5_decode.o \
657 pk/pkcs1/pkcs_1_v1_5_encode.o \
658 pk/rsa/rsa_decrypt_key.o \
659 pk/rsa/rsa_encrypt_key.o \
660 pk/rsa/rsa_export.o \
661 pk/rsa/rsa_exptmod.o \
663 pk/rsa/rsa_get_size.o \
664 pk/rsa/rsa_import.o \
665 pk/rsa/rsa_import_pkcs8.o \
666 pk/rsa/rsa_import_x509.o \
667 pk/rsa/rsa_make_key.o \
669 pk/rsa/rsa_sign_hash.o \
670 pk/rsa/rsa_sign_saltlen_get.o \
671 pk/rsa/rsa_verify_hash.o \
674 prngs/rng_get_bytes.o \
675 prngs/rng_make_prng.o \
677 stream/chacha/chacha_crypt.o \
678 stream/chacha/chacha_done.o \
679 stream/chacha/chacha_ivctr32.o \
680 stream/chacha/chacha_ivctr64.o \
681 stream/chacha/chacha_keystream.o \
682 stream/chacha/chacha_setup.o \
683 stream/chacha/chacha_test.o
685 libtomcrypt/%.o: CFLAGS+= -Isrc/headers -Itomsfastmath/src/headers -DARGTYPE=4 -Ilibtomcrypt/src/headers
686 libtomcrypt/%.o: CFLAGS+= \
693 -DLTC_CHACHA20POLY1305_MODE \
711 -DLTC_TRY_URANDOM_FIRST \
712 -DLTC_RNG_GET_BYTES \
713 -DLTC_RNG_MAKE_PRNG \
720 rm -f $(addprefix libtomcrypt/src/, $(LTCOBJ))
723 ltc.o: $(addprefix libtomcrypt/src/, $(LTCOBJ))
726 crypto/rfc3986.c: crypto/rfc3986.re
727 re2c --input custom --tags -o $@ $<
730 $(CC) -Wall -W -Wextra -Werror -o $@ $+
732 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
734 bin/zpm-fetchurl: ltc.o crypto/tls.o tfm.o src/fetchurl.o crypto/https.o crypto/rfc3986.o
735 $(CC) $(CFLAGS) -static -o $@ $+
737 testddg: zpm-fetchurl
738 ./zpm-fetchurl duckduckgo.com 443 /
740 testgra: zpm-fetchurl
741 ./zpm-fetchurl granicus.if.org 443 /
744 crypto/libeddsa/sign.c \
745 crypto/libeddsa/lib/burn.c \
746 crypto/libeddsa/lib/burnstack.c \
747 crypto/libeddsa/lib/ed.c \
748 crypto/libeddsa/lib/ed25519-sha512.c \
749 crypto/libeddsa/lib/fld.c \
750 crypto/libeddsa/lib/sc.c \
751 crypto/libeddsa/lib/sha512.c \
752 crypto/libeddsa/lib/x25519.c
754 SIGNOBJ=$(SIGNSRC:.c=.o) lib/readpass.o lib/blake2b.o \
757 $(SIGNOBJ): CFLAGS=-Wall -Wextra -W -Werror -Wno-pointer-sign \
758 -Wno-missing-braces \
759 -Icrypto/libeddsa/lib -Wno-unused-command-line-argument \
762 bin/zpm-sign: $(SIGNOBJ)
763 $(CC) -Wall -Wextra -W -Werror -Wno-unused-command-line-argument -static -o $@ $+
766 rm -f *.o sqlite/*.o lib/*.o $(LZMAOBJ) liblzma.a \
767 libelf.a libzpm.a zpm-addfile soname \
773 elf/*.o lib/jsw/*.o \
774 $(addprefix crypto/ref10/, $(X255OBJ)) \
775 $(addprefix crypto/, $(TLSOBJ)) \
776 $(addprefix tomsfastmath/src/, $(TFMOBJ)) \
777 $(addprefix libtomcrypt/src/, $(LTCOBJ)) \