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/pelican/pelican.o \
443 mac/pelican/pelican_memory.o \
444 mac/pelican/pelican_test.o \
445 mac/pmac/pmac_done.o \
446 mac/pmac/pmac_file.o \
447 mac/pmac/pmac_init.o \
448 mac/pmac/pmac_memory.o \
449 mac/pmac/pmac_memory_multi.o \
450 mac/pmac/pmac_ntz.o \
451 mac/pmac/pmac_process.o \
452 mac/pmac/pmac_shift_xor.o \
453 mac/pmac/pmac_test.o \
454 mac/poly1305/poly1305.o \
455 mac/poly1305/poly1305_file.o \
456 mac/poly1305/poly1305_memory.o \
457 mac/poly1305/poly1305_memory_multi.o \
458 mac/poly1305/poly1305_test.o \
459 mac/xcbc/xcbc_done.o \
460 mac/xcbc/xcbc_file.o \
461 mac/xcbc/xcbc_init.o \
462 mac/xcbc/xcbc_memory.o \
463 mac/xcbc/xcbc_memory_multi.o \
464 mac/xcbc/xcbc_process.o \
465 mac/xcbc/xcbc_test.o \
466 math/fp/ltc_ecc_fp_mulmod.o \
470 math/radix_to_bin.o \
475 misc/base64/base64_decode.o \
476 misc/base64/base64_encode.o \
478 misc/compare_testvector.o \
481 misc/crypt/crypt_argchk.o \
482 misc/crypt/crypt_cipher_descriptor.o \
483 misc/crypt/crypt_cipher_is_valid.o \
484 misc/crypt/crypt_constants.o \
485 misc/crypt/crypt_find_cipher.o \
486 misc/crypt/crypt_find_cipher_any.o \
487 misc/crypt/crypt_fsa.o \
488 misc/crypt/crypt_hash_descriptor.o \
489 misc/crypt/crypt_hash_is_valid.o \
490 misc/crypt/crypt_inits.o \
491 misc/crypt/crypt_ltc_mp_descriptor.o \
492 misc/crypt/crypt_prng_descriptor.o \
493 misc/crypt/crypt_prng_is_valid.o \
494 misc/crypt/crypt_prng_rng_descriptor.o \
495 misc/crypt/crypt_register_all_ciphers.o \
496 misc/crypt/crypt_register_all_hashes.o \
497 misc/crypt/crypt_register_all_prngs.o \
498 misc/crypt/crypt_register_cipher.o \
499 misc/crypt/crypt_register_hash.o \
500 misc/crypt/crypt_register_prng.o \
501 misc/crypt/crypt_sizes.o \
502 misc/crypt/crypt_unregister_cipher.o \
503 misc/crypt/crypt_unregister_hash.o \
504 misc/crypt/crypt_unregister_prng.o \
505 misc/error_to_string.o \
507 misc/hkdf/hkdf_test.o \
510 misc/pkcs5/pkcs_5_1.o \
511 misc/pkcs5/pkcs_5_2.o \
512 misc/pkcs5/pkcs_5_test.o \
514 modes/cbc/cbc_decrypt.o \
515 modes/cbc/cbc_done.o \
516 modes/cbc/cbc_encrypt.o \
517 modes/cbc/cbc_getiv.o \
518 modes/cbc/cbc_setiv.o \
519 modes/cbc/cbc_start.o \
520 modes/cfb/cfb_decrypt.o \
521 modes/cfb/cfb_done.o \
522 modes/cfb/cfb_encrypt.o \
523 modes/cfb/cfb_getiv.o \
524 modes/cfb/cfb_setiv.o \
525 modes/cfb/cfb_start.o \
526 modes/ctr/ctr_decrypt.o \
527 modes/ctr/ctr_done.o \
528 modes/ctr/ctr_encrypt.o \
529 modes/ctr/ctr_getiv.o \
530 modes/ctr/ctr_setiv.o \
531 modes/ctr/ctr_start.o \
532 modes/ctr/ctr_test.o \
533 modes/ecb/ecb_decrypt.o \
534 modes/ecb/ecb_done.o \
535 modes/ecb/ecb_encrypt.o \
536 modes/ecb/ecb_start.o \
537 modes/f8/f8_decrypt.o \
539 modes/f8/f8_encrypt.o \
540 modes/f8/f8_getiv.o \
541 modes/f8/f8_setiv.o \
542 modes/f8/f8_start.o \
543 modes/f8/f8_test_mode.o \
544 modes/lrw/lrw_decrypt.o \
545 modes/lrw/lrw_done.o \
546 modes/lrw/lrw_encrypt.o \
547 modes/lrw/lrw_getiv.o \
548 modes/lrw/lrw_process.o \
549 modes/lrw/lrw_start.o \
550 modes/lrw/lrw_setiv.o \
551 modes/lrw/lrw_test.o \
552 modes/ofb/ofb_decrypt.o \
553 modes/ofb/ofb_done.o \
554 modes/ofb/ofb_encrypt.o \
555 modes/ofb/ofb_getiv.o \
556 modes/ofb/ofb_setiv.o \
557 modes/ofb/ofb_start.o \
558 modes/xts/xts_decrypt.o \
559 modes/xts/xts_done.o \
560 modes/xts/xts_encrypt.o \
561 modes/xts/xts_init.o \
562 modes/xts/xts_mult_x.o \
563 modes/xts/xts_test.o \
564 pk/asn1/der/bit/der_decode_bit_string.o \
565 pk/asn1/der/bit/der_decode_raw_bit_string.o \
566 pk/asn1/der/bit/der_encode_bit_string.o \
567 pk/asn1/der/bit/der_encode_raw_bit_string.o \
568 pk/asn1/der/bit/der_length_bit_string.o \
569 pk/asn1/der/boolean/der_decode_boolean.o \
570 pk/asn1/der/boolean/der_encode_boolean.o \
571 pk/asn1/der/boolean/der_length_boolean.o \
572 pk/asn1/der/choice/der_decode_choice.o \
573 pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \
574 pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \
575 pk/asn1/der/generalizedtime/der_length_generalizedtime.o \
576 pk/asn1/der/ia5/der_decode_ia5_string.o \
577 pk/asn1/der/ia5/der_encode_ia5_string.o \
578 pk/asn1/der/ia5/der_length_ia5_string.o \
579 pk/asn1/der/integer/der_decode_integer.o \
580 pk/asn1/der/integer/der_encode_integer.o \
581 pk/asn1/der/integer/der_length_integer.o \
582 pk/asn1/der/object_identifier/der_decode_object_identifier.o \
583 pk/asn1/der/object_identifier/der_encode_object_identifier.o \
584 pk/asn1/der/object_identifier/der_length_object_identifier.o \
585 pk/asn1/der/octet/der_decode_octet_string.o \
586 pk/asn1/der/octet/der_encode_octet_string.o \
587 pk/asn1/der/octet/der_length_octet_string.o \
588 pk/asn1/der/printable_string/der_decode_printable_string.o \
589 pk/asn1/der/printable_string/der_encode_printable_string.o \
590 pk/asn1/der/printable_string/der_length_printable_string.o \
591 pk/asn1/der/sequence/der_decode_sequence_ex.o \
592 pk/asn1/der/sequence/der_decode_sequence_flexi.o \
593 pk/asn1/der/sequence/der_decode_sequence_multi.o \
594 pk/asn1/der/sequence/der_decode_subject_public_key_info.o \
595 pk/asn1/der/sequence/der_encode_sequence_ex.o \
596 pk/asn1/der/sequence/der_encode_sequence_multi.o \
597 pk/asn1/der/sequence/der_encode_subject_public_key_info.o \
598 pk/asn1/der/sequence/der_length_sequence.o \
599 pk/asn1/der/sequence/der_sequence_free.o \
600 pk/asn1/der/sequence/der_sequence_shrink.o \
601 pk/asn1/der/set/der_encode_set.o \
602 pk/asn1/der/set/der_encode_setof.o \
603 pk/asn1/der/short_integer/der_decode_short_integer.o \
604 pk/asn1/der/short_integer/der_encode_short_integer.o \
605 pk/asn1/der/short_integer/der_length_short_integer.o \
606 pk/asn1/der/teletex_string/der_decode_teletex_string.o \
607 pk/asn1/der/teletex_string/der_length_teletex_string.o \
608 pk/asn1/der/utctime/der_decode_utctime.o \
609 pk/asn1/der/utctime/der_encode_utctime.o \
610 pk/asn1/der/utf8/der_decode_utf8_string.o \
611 pk/asn1/der/utctime/der_length_utctime.o \
612 pk/asn1/der/utf8/der_encode_utf8_string.o \
613 pk/asn1/der/utf8/der_length_utf8_string.o \
615 pk/dh/dh_check_pubkey.o \
617 pk/dh/dh_export_key.o \
619 pk/dh/dh_generate_key.o \
622 pk/dh/dh_set_pg_dhparam.o \
623 pk/dh/dh_shared_secret.o \
624 pk/dsa/dsa_decrypt_key.o \
625 pk/dsa/dsa_encrypt_key.o \
626 pk/dsa/dsa_export.o \
627 pk/dsa/dsa_generate_key.o \
628 pk/dsa/dsa_generate_pqg.o \
630 pk/dsa/dsa_import.o \
631 pk/dsa/dsa_make_key.o \
633 pk/dsa/dsa_set_pqg_dsaparam.o \
634 pk/dsa/dsa_shared_secret.o \
635 pk/dsa/dsa_sign_hash.o \
636 pk/dsa/dsa_verify_hash.o \
637 pk/dsa/dsa_verify_key.o \
639 pk/ecc/ecc_ansi_x963_export.o \
640 pk/ecc/ecc_ansi_x963_import.o \
641 pk/ecc/ecc_decrypt_key.o \
642 pk/ecc/ecc_encrypt_key.o \
643 pk/ecc/ecc_export.o \
645 pk/ecc/ecc_get_size.o \
646 pk/ecc/ecc_import.o \
647 pk/ecc/ecc_make_key.o \
648 pk/ecc/ecc_shared_secret.o \
649 pk/ecc/ecc_sign_hash.o \
652 pk/ecc/ecc_verify_hash.o \
653 pk/ecc/ltc_ecc_map.o \
654 pk/ecc/ltc_ecc_is_valid_idx.o \
655 pk/ecc/ltc_ecc_mul2add.o \
656 pk/ecc/ltc_ecc_mulmod.o \
657 pk/ecc/ltc_ecc_mulmod_timing.o \
658 pk/ecc/ltc_ecc_points.o \
659 pk/ecc/ltc_ecc_projective_add_point.o \
660 pk/ecc/ltc_ecc_projective_dbl_point.o \
661 pk/pkcs1/pkcs_1_i2osp.o \
662 pk/pkcs1/pkcs_1_mgf1.o \
663 pk/pkcs1/pkcs_1_oaep_decode.o \
664 pk/pkcs1/pkcs_1_oaep_encode.o \
665 pk/pkcs1/pkcs_1_os2ip.o \
666 pk/pkcs1/pkcs_1_pss_decode.o \
667 pk/pkcs1/pkcs_1_pss_encode.o \
668 pk/pkcs1/pkcs_1_v1_5_decode.o \
669 pk/pkcs1/pkcs_1_v1_5_encode.o \
670 pk/rsa/rsa_decrypt_key.o \
671 pk/rsa/rsa_encrypt_key.o \
672 pk/rsa/rsa_export.o \
673 pk/rsa/rsa_exptmod.o \
675 pk/rsa/rsa_get_size.o \
676 pk/rsa/rsa_import.o \
677 pk/rsa/rsa_import_pkcs8.o \
678 pk/rsa/rsa_import_x509.o \
679 pk/rsa/rsa_make_key.o \
681 pk/rsa/rsa_sign_hash.o \
682 pk/rsa/rsa_sign_saltlen_get.o \
683 pk/rsa/rsa_verify_hash.o \
686 prngs/rng_get_bytes.o \
687 prngs/rng_make_prng.o \
689 stream/chacha/chacha_crypt.o \
690 stream/chacha/chacha_done.o \
691 stream/chacha/chacha_ivctr32.o \
692 stream/chacha/chacha_ivctr64.o \
693 stream/chacha/chacha_keystream.o \
694 stream/chacha/chacha_setup.o \
695 stream/chacha/chacha_test.o
697 libtomcrypt/%.o: CFLAGS+= -Isrc/headers -Itomsfastmath/src/headers -DARGTYPE=4 -Ilibtomcrypt/src/headers
698 libtomcrypt/%.o: CFLAGS+= \
705 -DLTC_CHACHA20POLY1305_MODE \
723 -DLTC_TRY_URANDOM_FIRST \
724 -DLTC_RNG_GET_BYTES \
725 -DLTC_RNG_MAKE_PRNG \
732 rm -f $(addprefix libtomcrypt/src/, $(LTCOBJ))
735 ltc.o: $(addprefix libtomcrypt/src/, $(LTCOBJ))
738 crypto/rfc3986.c: crypto/rfc3986.re
739 re2c --input custom --tags -o $@ $<
742 $(CC) -Wall -W -Wextra -Werror -o $@ $+
744 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
746 bin/zpm-fetchurl: ltc.o crypto/tls.o tfm.o src/fetchurl.o crypto/https.o crypto/rfc3986.o
747 $(CC) $(CFLAGS) -static -o $@ $+
749 testddg: zpm-fetchurl
750 ./zpm-fetchurl duckduckgo.com 443 /
752 testgra: zpm-fetchurl
753 ./zpm-fetchurl granicus.if.org 443 /
756 crypto/libeddsa/sign.c \
757 crypto/libeddsa/lib/burn.c \
758 crypto/libeddsa/lib/burnstack.c \
759 crypto/libeddsa/lib/ed.c \
760 crypto/libeddsa/lib/ed25519-sha512.c \
761 crypto/libeddsa/lib/fld.c \
762 crypto/libeddsa/lib/sc.c \
763 crypto/libeddsa/lib/sha512.c \
764 crypto/libeddsa/lib/x25519.c
766 SIGNOBJ=$(SIGNSRC:.c=.o) lib/readpass.o lib/blake2b.o \
769 $(SIGNOBJ): CFLAGS=-Wall -Wextra -W -Werror -Wno-pointer-sign \
770 -Wno-missing-braces \
771 -Icrypto/libeddsa/lib -Wno-unused-command-line-argument \
774 bin/zpm-sign: $(SIGNOBJ)
775 $(CC) -Wall -Wextra -W -Werror -Wno-unused-command-line-argument -static -o $@ $+
778 rm -f *.o sqlite/*.o lib/*.o $(LZMAOBJ) liblzma.a \
779 libelf.a libzpm.a zpm-addfile soname \
785 elf/*.o lib/jsw/*.o \
786 $(addprefix crypto/ref10/, $(X255OBJ)) \
787 $(addprefix crypto/, $(TLSOBJ)) \
788 $(addprefix tomsfastmath/src/, $(TFMOBJ)) \
789 $(addprefix libtomcrypt/src/, $(LTCOBJ)) \