CC=clang --target=x86_64-pc-linux-musl CC=/usr/musl/bin/musl-clang LD=lld #CC=/usr/musl/bin/musl-gcc #CFLAGS=-Wall -W -Wextra -Werror -Wno-implicit-fallthrough -std=c99 -Ilib -Isqlite -Ielf -I. -Ilzma/api --target=x86_64-pc-linux-musl CFLAGS=-Wall -W -Wextra -Werror -Wno-implicit-fallthrough -std=c99 -Ilib -Isqlite -Ielf -I. -Ilzma/api -Wno-unused-command-line-argument ZPMVER:=$(shell git describe --tags --match 'v[0-9]*' | sed -e 's/^v//' | sed -e 's/-g.\+//' | sed -e 's/-/./g') 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 #LDFLAGS=-fuse-ld=lld -L. -static LDFLAGS=-fuse-ld=/usr/musl/bin/ld.musl-clang -L. -static 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 LZMASRC=$(shell ls lzma/lzma/*.c lzma/common/*.c lzma/lz/*.c) $(LZMACHECKSRC) lzma/rangecoder/price_table.c LZMAOBJ=$(filter-out lzma/common/stream_encoder_mt.o, $(LZMASRC:%.c=%.o)) JSWSRC=lib/jsw/jsw_avltree.c \ lib/jsw/jsw_atree.c \ lib/jsw/jsw_hlib.c \ lib/jsw/jsw_rbtree.c JSWOBJ=$(JSWSRC:%.c=%.o) LIBZPMSRC=sha256.c db.c compress.c uncompress.c zpm.c zpm_hash.c \ foreach_path.c vercmp.c findpkg.c quote.c dbquery.c script_hash.c \ parse.c integ.c seterror.c notes.c createpkg.c LIBZPMOBJ=$(addprefix lib/, $(LIBZPMSRC:%.c=%.o)) curdir=$(shell pwd) ZPKGBIN=zpm-addfile zpm-extract zpm-init zpm-vercmp zpm-stat zpm-hash \ zpm-findpkg zpm-shell zpm-soneed zpm-foreach-path zpm-parse \ zpm-script zpm-soname zpm-syncfs zpm-packagehash zpm-verify \ zpm-elftype zpm-quote zpm-note zpm-search zpm-add zpm-fetchurl \ zpm-sign SCRIPTS=zpm zpm-install zpm-merge zpm-list zpm-test zpm-log \ zpm-contents zpm-uninstall zpm-pathmod zpm-rmpackage zpm-newpackage \ zpm-pkg zpm-pkgfile zpm-gc zpm-repo zpm-update zpm-confgit MANPAGES=$(shell ls doc/*.8) #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) COMPILED=$(ZPKGBIN) PROGRAMS=$(SCRIPTS) $(COMPILED) def: programs strip $(ZPKGBIN) d: printf '%s\n' $(LZMAOBJ) printf '%s\n' $(PATH) libzpm.a: $(LIBZPMOBJ) sqlite/sqlite3.o \ $(LZMAOBJ) \ $(JSWOBJ) ar rcuv $@ $? package: zpm-$(ZPMVER)-1.zpm lzmaupdate: find xz/src/liblzma -type d -name .deps -prune \ -o -type f -printf '%P\n' \ | xargs -IZ echo Z Z Z \ | xargs printf 'test -e lzma/%s && cp xz/src/liblzma/%s lzma/%s\n' \ | sh #lzma/lz/lz_decoder.o: lzma/lz/lz_decoder.c #lzma/lz/lz_encoder.o: lzma/lz/lz_encoder.c lzma/%.o: lzma/%.c $(CC) $(CFLAGS) $(LZMAFLAGS) -c -o $@ $< lib/liblzma.a: $(LZMAOBJ) ar rcuv $@ $? lib/libjsw.a: $(JSWOBJ) ar rcuv $@ $? ZPM:= ./zpm -P. zpm-$(ZPMVER)-1.zpm: programs $(MANPAGES) rm -f $@ $(ZPM) newpackage -C zpm-$(ZPMVER)-1 $(ZPM) add -v -u root -g root -f $@ -P /sbin zpm-$(ZPMVER)-1 $(sort $(PROGRAMS)) $(ZPM) add -v -u root -g root -f $@ -P /usr/share/man/man8 -S doc $(MANPAGES) tarball: zpm-$(ZPMVER)-1.tar.xz zpm-$(ZPMVER)-1.tar.xz: programs rm -f $@ tar -cJf $@ --transform='s|^|sbin/|' \ $(PROGRAMS) lzma.c: mklzma sh mklzma lzma.o: lzma.c gcc -std=c99 -Wall -c -o $@ $< stest: $(ZPKGBIN) PATH=$(curdir)/t:$(curdir):$(PATH) t/$(T).t t/ctap/prove: t/ctap/prove.o $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ test: $(ZPKGBIN) t/ctap/prove @PATH=$(curdir)/t:$(curdir):$(PATH) t/ctap/prove t/*.t programs: $(ZPKGBIN) uncompress: uncompress.o $(CC) $(CFLAGS) -o $@ $+ -llzma zpm-elftype: elf/elftype.o $(CC) $(CFLAGS) -Ielf $(LDFLAGS) -o $@ $+ zpm-soname: elf/soname.o $(CC) $(CFLAGS) -Ielf $(LDFLAGS) -o $@ $+ zpm-soneed: elf/needed.o $(CC) $(CFLAGS) -Ielf $(LDFLAGS) -o $@ $+ zpm-addfile: src/addfile.o libzpm.a libelf.a $(CC) -Ielf $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf zpm-hash: src/hash.o libzpm.a $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm zpm-verify: src/verify.o t/ctap/ctap.o libzpm.a $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< t/ctap/ctap.o -lzpm -lelf zpm-init: src/init.o libzpm.a $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf zpm-stat: src/stat.o $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< zpm-extract: src/extract.o libzpm.a $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf zpm-script: src/script.o libzpm.a $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf zpm-packagehash: src/packagehash.o libzpm.a $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf src/foreach-path.o: CFLAGS+=-Wno-unused-parameter src/script.o: CFLAGS+=-Wno-unused-parameter zpm-foreach-path: src/foreach-path.o libzpm.a sqlite/sqlite3.h $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf zpm-findpkg: src/findpkg.o libzpm.a $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf zpm-search: src/search.o libzpm.a $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf zpm-note: src/note.o libzpm.a $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf zpm-syncfs: src/syncfs.o libzpm.a libelf.a $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf -lm zpm-parse: src/parse.o lib/parse.o $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ zpm-add: src/add.o libzpm.a libelf.a $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lzpm -lelf zpm-quote: src/quote.o $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< db.sql: schema/main.sql schema/syncconflicts.sql schema/syncinfo.sql schema/preserve_packages.sql schema/age.sql echo 'begin;' > $@ cat $+ >> $@ echo 'commit;' >> $@ newdb.c: db.sql echo "char createdb[] = {" > $@ xxd -i < $< >> $@ echo ", 0};" >> $@ sqlite/sqlite3.o: sqlite/sqlite3.c sqlite/config.h $(CC) -Wall -Wno-unused-command-line-argument -std=c99 -Ilib -D_HAVE_SQLITE_CONFIG_H=1 -c -o $@ $< sqlite/extensions.o: sqlite/extensions.c $(CC) -O3 -Wall -std=c99 -I. -Isqlite -DSQLITE_CORE=1 -c -o $@ $< sqlite/shell.o: sqlite/shell.c sqlite/config.h Makefile $(CC) -Wall -Wno-unused-command-line-argument -std=c99 -Ilib \ -DSQLITE_OMIT_LOAD_EXTENSION=1 \ '-DSQLITE_SHELL_INIT_PROC(x)=zpm_setup_extensions(x)' \ -D_POSIX_C_SOURCE=200112L -c -o $@ $< lib/zpm.o: newdb.c zpm-vercmp: src/vercmp.o lib/vercmp.o $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ zpm-shell: sqlite/sqlite3.o sqlite/shell.o sqlite/extensions.o lib/vercmp.o $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ libelf.a: elf/libelf.o ar rcuv $@ $? install: $(COMPILED) $(MANPAGES) test -d $(DESTDIR)/sbin || install -d $(DESTDIR)/sbin test -d $(DESTDIR)/var/lib/zpm || install -d $(DESTDIR)/var/lib/zpm test -d $(DESTDIR)/var/lib/zpm/packages || install -d $(DESTDIR)/var/lib/zpm/packages install $(PROGRAMS) $(DESTDIR)/sbin mkdir -p $(DESTDIR)/usr/share/man/man8 install -m644 $(MANPAGES) $(DESTDIR)/usr/share/man/man8 scan-prep: clean sqlite/sqlite3.o sqlite/shell.o lib/liblzma.a @echo scan-build -v -o report make -j10 # crypto/tls items X255OBJ= \ base.o \ fe_0.o \ fe_1.o \ fe_add.o \ fe_copy.o \ fe_cswap.o \ fe_frombytes.o \ fe_invert.o \ fe_mul.o \ fe_mul121666.o \ fe_sq.o \ fe_sub.o \ fe_tobytes.o \ scalarmult.o TLSOBJ= tlse.o x25519.o chacha.o base64.o pem.o forward.o handshake.o \ buffer.o parse_client_hello.o parse_message.o cipher_supported.o \ packet_update.o hmac_message.o hkdf.o hash.o cipher_name.o crypto/x25519.o: $(addprefix crypto/ref10/, $(X255OBJ)) ld -o $@ -r $+ crypto/%.o: CFLAGS+=-Icrypto -DTFM_DESC -DTFM_NO_ASM \ -Itomsfastmath/src/headers \ -Wno-pointer-sign -Wno-missing-braces -Ilibtomcrypt/src/headers # -DDEBUG # /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 #/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 tls.o: $(addprefix crypto/, $(TLSOBJ)) ld -o $@ -r $+ TFMOBJ= \ addsub/fp_add.o \ addsub/fp_add_d.o \ addsub/fp_addmod.o \ addsub/fp_cmp.o \ addsub/fp_cmp_d.o \ addsub/fp_cmp_mag.o \ addsub/fp_sub.o \ addsub/fp_sub_d.o \ addsub/fp_submod.o \ addsub/s_fp_add.o \ addsub/s_fp_sub.o \ bin/fp_radix_size.o \ bin/fp_read_radix.o \ bin/fp_read_signed_bin.o \ bin/fp_reverse.o \ bin/fp_read_unsigned_bin.o \ bin/fp_signed_bin_size.o \ bin/fp_s_rmap.o \ bin/fp_toradix.o \ bin/fp_toradix_n.o \ bin/fp_to_signed_bin.o \ bin/fp_to_unsigned_bin.o \ bin/fp_unsigned_bin_size.o \ bit/fp_cnt_lsb.o \ bit/fp_count_bits.o \ bit/fp_div_2.o \ bit/fp_div_2d.o \ bit/fp_lshd.o \ bit/fp_mod_2d.o \ bit/fp_rshd.o \ divide/fp_div.o \ divide/fp_div_d.o \ divide/fp_mod.o \ divide/fp_mod_d.o \ exptmod/fp_2expt.o \ exptmod/fp_exptmod.o \ misc/fp_ident.o \ misc/fp_rand.o \ misc/fp_set.o \ mont/fp_montgomery_calc_normalization.o \ mont/fp_montgomery_reduce.o \ mont/fp_montgomery_setup.o \ mul/fp_mul_2.o \ mul/fp_mul_2d.o \ mul/fp_mul.o \ mul/fp_mul_comba_12.o \ mul/fp_mul_comba_17.o \ mul/fp_mul_comba_20.o \ mul/fp_mul_comba_24.o \ mul/fp_mul_comba_28.o \ mul/fp_mul_comba_32.o \ mul/fp_mul_comba_3.o \ mul/fp_mul_comba_48.o \ mul/fp_mul_comba_4.o \ mul/fp_mul_comba_64.o \ mul/fp_mul_comba_6.o \ mul/fp_mul_comba_7.o \ mul/fp_mul_comba_8.o \ mul/fp_mul_comba.o \ mul/fp_mul_comba_small_set.o \ mul/fp_mul_d.o \ mul/fp_mul_comba_9.o \ mul/fp_mulmod.o \ numtheory/fp_gcd.o \ numtheory/fp_invmod.o \ numtheory/fp_isprime.o \ numtheory/fp_isprime_ex.o \ numtheory/fp_lcm.o \ numtheory/fp_prime_miller_rabin.o \ numtheory/fp_prime_random_ex.o \ sqr/fp_sqr.o \ sqr/fp_sqr_comba_12.o \ sqr/fp_sqr_comba_17.o \ sqr/fp_sqr_comba_20.o \ sqr/fp_sqr_comba_24.o \ sqr/fp_sqr_comba_28.o \ sqr/fp_sqr_comba_32.o \ sqr/fp_sqr_comba_48.o \ sqr/fp_sqr_comba_3.o \ sqr/fp_sqr_comba_4.o \ sqr/fp_sqr_comba_64.o \ sqr/fp_sqr_comba_6.o \ sqr/fp_sqr_comba_7.o \ sqr/fp_sqr_comba_8.o \ sqr/fp_sqr_comba_9.o \ sqr/fp_sqr_comba.o \ sqr/fp_sqr_comba_generic.o \ sqr/fp_sqr_comba_small_set.o \ sqr/fp_sqrmod.o tomsfastmath/src/addsub/%.o: CFLAGS+=-DTFM_DESC -DTFM_NO_ASM -Itomsfastmath/src/headers -DARGTYPE=4 tomsfastmath/src/%.o: CFLAGS+=-DTFM_DESC -DTFM_NO_ASM -Itomsfastmath/src/headers -DARGTYPE=4 tfm.o: $(addprefix tomsfastmath/src/, $(TFMOBJ)) ld -o $@ -r $+ LTCOBJ= \ ciphers/aes/aes.o \ ciphers/anubis.o \ ciphers/blowfish.o \ ciphers/camellia.o \ ciphers/cast5.o \ ciphers/des.o \ ciphers/kasumi.o \ ciphers/khazad.o \ ciphers/kseed.o \ ciphers/multi2.o \ ciphers/noekeon.o \ ciphers/rc2.o \ ciphers/rc5.o \ ciphers/rc6.o \ ciphers/safer/safer.o \ ciphers/safer/saferp.o \ ciphers/skipjack.o \ ciphers/twofish/twofish.o \ ciphers/xtea.o \ encauth/ccm/ccm_add_aad.o \ encauth/ccm/ccm_add_nonce.o \ encauth/ccm/ccm_done.o \ encauth/ccm/ccm_init.o \ encauth/ccm/ccm_memory.o \ encauth/ccm/ccm_process.o \ encauth/ccm/ccm_reset.o \ encauth/ccm/ccm_test.o \ encauth/chachapoly/chacha20poly1305_add_aad.o \ encauth/chachapoly/chacha20poly1305_decrypt.o \ encauth/chachapoly/chacha20poly1305_done.o \ encauth/chachapoly/chacha20poly1305_encrypt.o \ encauth/chachapoly/chacha20poly1305_init.o \ encauth/chachapoly/chacha20poly1305_memory.o \ encauth/chachapoly/chacha20poly1305_setiv.o \ encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \ encauth/chachapoly/chacha20poly1305_test.o \ encauth/eax/eax_addheader.o \ encauth/eax/eax_decrypt.o \ encauth/eax/eax_decrypt_verify_memory.o \ encauth/eax/eax_done.o \ encauth/eax/eax_encrypt.o \ encauth/eax/eax_encrypt_authenticate_memory.o \ encauth/eax/eax_init.o \ encauth/eax/eax_test.o \ encauth/gcm/gcm_add_aad.o \ encauth/gcm/gcm_add_iv.o \ encauth/gcm/gcm_done.o \ encauth/gcm/gcm_gf_mult.o \ encauth/gcm/gcm_init.o \ encauth/gcm/gcm_memory.o \ encauth/gcm/gcm_mult_h.o \ encauth/gcm/gcm_process.o \ encauth/gcm/gcm_reset.o \ encauth/gcm/gcm_test.o \ misc/crypt/crypt_find_cipher_id.o \ misc/crypt/crypt_find_hash_any.o \ misc/crypt/crypt_find_hash.o \ encauth/ocb/ocb_decrypt.o \ encauth/ocb/ocb_decrypt_verify_memory.o \ encauth/ocb/ocb_done_decrypt.o \ encauth/ocb/ocb_done_encrypt.o \ misc/crypt/crypt_find_hash_id.o \ misc/crypt/crypt_find_hash_oid.o \ encauth/ocb/ocb_encrypt.o \ encauth/ocb/ocb_encrypt_authenticate_memory.o \ encauth/ocb/ocb_init.o \ encauth/ocb/ocb_ntz.o \ encauth/ocb/ocb_shift_xor.o \ encauth/ocb/ocb_test.o \ encauth/ocb/s_ocb_done.o \ encauth/ocb3/ocb3_add_aad.o \ encauth/ocb3/ocb3_decrypt.o \ encauth/ocb3/ocb3_decrypt_last.o \ encauth/ocb3/ocb3_decrypt_verify_memory.o \ encauth/ocb3/ocb3_done.o \ encauth/ocb3/ocb3_encrypt.o \ encauth/ocb3/ocb3_encrypt_authenticate_memory.o \ encauth/ocb3/ocb3_encrypt_last.o \ encauth/ocb3/ocb3_init.o \ encauth/ocb3/ocb3_int_ntz.o \ encauth/ocb3/ocb3_int_xor_blocks.o \ encauth/ocb3/ocb3_test.o \ hashes/blake2b.o \ hashes/blake2s.o \ hashes/chc/chc.o \ hashes/helper/hash_file.o \ hashes/helper/hash_filehandle.o \ hashes/helper/hash_memory.o \ hashes/helper/hash_memory_multi.o \ hashes/md2.o \ hashes/md4.o \ hashes/md5.o \ hashes/rmd128.o \ hashes/rmd160.o \ hashes/rmd256.o \ hashes/rmd320.o \ hashes/sha1.o \ hashes/sha2/sha224.o \ hashes/sha2/sha256.o \ hashes/sha2/sha384.o \ hashes/sha2/sha512.o \ hashes/sha2/sha512_224.o \ hashes/sha2/sha512_256.o \ hashes/sha3.o \ hashes/sha3_test.o \ hashes/tiger.o \ hashes/whirl/whirl.o \ mac/blake2/blake2bmac.o \ mac/blake2/blake2bmac_file.o \ mac/blake2/blake2bmac_memory.o \ mac/blake2/blake2bmac_memory_multi.o \ mac/blake2/blake2bmac_test.o \ mac/blake2/blake2smac.o \ mac/blake2/blake2smac_file.o \ mac/blake2/blake2smac_memory.o \ mac/blake2/blake2smac_memory_multi.o \ mac/blake2/blake2smac_test.o \ mac/f9/f9_done.o \ mac/f9/f9_file.o \ mac/f9/f9_init.o \ mac/f9/f9_memory.o \ mac/f9/f9_memory_multi.o \ mac/f9/f9_process.o \ mac/f9/f9_test.o \ mac/hmac/hmac_done.o \ mac/hmac/hmac_file.o \ mac/hmac/hmac_init.o \ mac/hmac/hmac_memory.o \ mac/hmac/hmac_memory_multi.o \ mac/hmac/hmac_process.o \ mac/hmac/hmac_test.o \ mac/omac/omac_done.o \ mac/omac/omac_file.o \ mac/omac/omac_init.o \ mac/omac/omac_memory.o \ mac/omac/omac_memory_multi.o \ mac/omac/omac_process.o \ misc/crypt/crypt_find_prng.o \ mac/omac/omac_test.o \ mac/pelican/pelican.o \ mac/pelican/pelican_memory.o \ mac/pelican/pelican_test.o \ mac/pmac/pmac_done.o \ mac/pmac/pmac_file.o \ mac/pmac/pmac_init.o \ mac/pmac/pmac_memory.o \ mac/pmac/pmac_memory_multi.o \ mac/pmac/pmac_ntz.o \ mac/pmac/pmac_process.o \ mac/pmac/pmac_shift_xor.o \ mac/pmac/pmac_test.o \ mac/poly1305/poly1305.o \ mac/poly1305/poly1305_file.o \ mac/poly1305/poly1305_memory.o \ mac/poly1305/poly1305_memory_multi.o \ mac/poly1305/poly1305_test.o \ mac/xcbc/xcbc_done.o \ mac/xcbc/xcbc_file.o \ mac/xcbc/xcbc_init.o \ mac/xcbc/xcbc_memory.o \ mac/xcbc/xcbc_memory_multi.o \ mac/xcbc/xcbc_process.o \ mac/xcbc/xcbc_test.o \ math/fp/ltc_ecc_fp_mulmod.o \ math/gmp_desc.o \ math/ltm_desc.o \ math/multi.o \ math/radix_to_bin.o \ math/rand_bn.o \ math/rand_prime.o \ math/tfm_desc.o \ misc/adler32.o \ misc/base64/base64_decode.o \ misc/base64/base64_encode.o \ misc/burn_stack.o \ misc/compare_testvector.o \ misc/crc32.o \ misc/crypt/crypt.o \ misc/crypt/crypt_argchk.o \ misc/crypt/crypt_cipher_descriptor.o \ misc/crypt/crypt_cipher_is_valid.o \ misc/crypt/crypt_constants.o \ misc/crypt/crypt_find_cipher.o \ misc/crypt/crypt_find_cipher_any.o \ misc/crypt/crypt_fsa.o \ misc/crypt/crypt_hash_descriptor.o \ misc/crypt/crypt_hash_is_valid.o \ misc/crypt/crypt_inits.o \ misc/crypt/crypt_ltc_mp_descriptor.o \ misc/crypt/crypt_prng_descriptor.o \ misc/crypt/crypt_prng_is_valid.o \ misc/crypt/crypt_prng_rng_descriptor.o \ misc/crypt/crypt_register_all_ciphers.o \ misc/crypt/crypt_register_all_hashes.o \ misc/crypt/crypt_register_all_prngs.o \ misc/crypt/crypt_register_cipher.o \ misc/crypt/crypt_register_hash.o \ misc/crypt/crypt_register_prng.o \ misc/crypt/crypt_sizes.o \ misc/crypt/crypt_unregister_cipher.o \ misc/crypt/crypt_unregister_hash.o \ misc/crypt/crypt_unregister_prng.o \ misc/error_to_string.o \ misc/hkdf/hkdf.o \ misc/hkdf/hkdf_test.o \ misc/mem_neq.o \ misc/pk_get_oid.o \ misc/pkcs5/pkcs_5_1.o \ misc/pkcs5/pkcs_5_2.o \ misc/pkcs5/pkcs_5_test.o \ misc/zeromem.o \ modes/cbc/cbc_decrypt.o \ modes/cbc/cbc_done.o \ modes/cbc/cbc_encrypt.o \ modes/cbc/cbc_getiv.o \ modes/cbc/cbc_setiv.o \ modes/cbc/cbc_start.o \ modes/cfb/cfb_decrypt.o \ modes/cfb/cfb_done.o \ modes/cfb/cfb_encrypt.o \ modes/cfb/cfb_getiv.o \ modes/cfb/cfb_setiv.o \ modes/cfb/cfb_start.o \ modes/ctr/ctr_decrypt.o \ modes/ctr/ctr_done.o \ modes/ctr/ctr_encrypt.o \ modes/ctr/ctr_getiv.o \ modes/ctr/ctr_setiv.o \ modes/ctr/ctr_start.o \ modes/ctr/ctr_test.o \ modes/ecb/ecb_decrypt.o \ modes/ecb/ecb_done.o \ modes/ecb/ecb_encrypt.o \ modes/ecb/ecb_start.o \ modes/f8/f8_decrypt.o \ modes/f8/f8_done.o \ modes/f8/f8_encrypt.o \ modes/f8/f8_getiv.o \ modes/f8/f8_setiv.o \ modes/f8/f8_start.o \ modes/f8/f8_test_mode.o \ modes/lrw/lrw_decrypt.o \ modes/lrw/lrw_done.o \ modes/lrw/lrw_encrypt.o \ modes/lrw/lrw_getiv.o \ modes/lrw/lrw_process.o \ modes/lrw/lrw_start.o \ modes/lrw/lrw_setiv.o \ modes/lrw/lrw_test.o \ modes/ofb/ofb_decrypt.o \ modes/ofb/ofb_done.o \ modes/ofb/ofb_encrypt.o \ modes/ofb/ofb_getiv.o \ modes/ofb/ofb_setiv.o \ modes/ofb/ofb_start.o \ modes/xts/xts_decrypt.o \ modes/xts/xts_done.o \ modes/xts/xts_encrypt.o \ modes/xts/xts_init.o \ modes/xts/xts_mult_x.o \ modes/xts/xts_test.o \ pk/asn1/der/bit/der_decode_bit_string.o \ pk/asn1/der/bit/der_decode_raw_bit_string.o \ pk/asn1/der/bit/der_encode_bit_string.o \ pk/asn1/der/bit/der_encode_raw_bit_string.o \ pk/asn1/der/bit/der_length_bit_string.o \ pk/asn1/der/boolean/der_decode_boolean.o \ pk/asn1/der/boolean/der_encode_boolean.o \ pk/asn1/der/boolean/der_length_boolean.o \ pk/asn1/der/choice/der_decode_choice.o \ pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \ pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \ pk/asn1/der/generalizedtime/der_length_generalizedtime.o \ pk/asn1/der/ia5/der_decode_ia5_string.o \ pk/asn1/der/ia5/der_encode_ia5_string.o \ pk/asn1/der/ia5/der_length_ia5_string.o \ pk/asn1/der/integer/der_decode_integer.o \ pk/asn1/der/integer/der_encode_integer.o \ pk/asn1/der/integer/der_length_integer.o \ pk/asn1/der/object_identifier/der_decode_object_identifier.o \ pk/asn1/der/object_identifier/der_encode_object_identifier.o \ pk/asn1/der/object_identifier/der_length_object_identifier.o \ pk/asn1/der/octet/der_decode_octet_string.o \ pk/asn1/der/octet/der_encode_octet_string.o \ pk/asn1/der/octet/der_length_octet_string.o \ pk/asn1/der/printable_string/der_decode_printable_string.o \ pk/asn1/der/printable_string/der_encode_printable_string.o \ pk/asn1/der/printable_string/der_length_printable_string.o \ pk/asn1/der/sequence/der_decode_sequence_ex.o \ pk/asn1/der/sequence/der_decode_sequence_flexi.o \ pk/asn1/der/sequence/der_decode_sequence_multi.o \ pk/asn1/der/sequence/der_decode_subject_public_key_info.o \ pk/asn1/der/sequence/der_encode_sequence_ex.o \ pk/asn1/der/sequence/der_encode_sequence_multi.o \ pk/asn1/der/sequence/der_encode_subject_public_key_info.o \ pk/asn1/der/sequence/der_length_sequence.o \ pk/asn1/der/sequence/der_sequence_free.o \ pk/asn1/der/sequence/der_sequence_shrink.o \ pk/asn1/der/set/der_encode_set.o \ pk/asn1/der/set/der_encode_setof.o \ pk/asn1/der/short_integer/der_decode_short_integer.o \ pk/asn1/der/short_integer/der_encode_short_integer.o \ pk/asn1/der/short_integer/der_length_short_integer.o \ pk/asn1/der/teletex_string/der_decode_teletex_string.o \ pk/asn1/der/teletex_string/der_length_teletex_string.o \ pk/asn1/der/utctime/der_decode_utctime.o \ pk/asn1/der/utctime/der_encode_utctime.o \ pk/asn1/der/utf8/der_decode_utf8_string.o \ pk/asn1/der/utctime/der_length_utctime.o \ pk/asn1/der/utf8/der_encode_utf8_string.o \ pk/asn1/der/utf8/der_length_utf8_string.o \ pk/dh/dh.o \ pk/dh/dh_check_pubkey.o \ pk/dh/dh_export.o \ pk/dh/dh_export_key.o \ pk/dh/dh_free.o \ pk/dh/dh_generate_key.o \ pk/dh/dh_import.o \ pk/dh/dh_set.o \ pk/dh/dh_set_pg_dhparam.o \ pk/dh/dh_shared_secret.o \ pk/dsa/dsa_decrypt_key.o \ pk/dsa/dsa_encrypt_key.o \ pk/dsa/dsa_export.o \ pk/dsa/dsa_generate_key.o \ pk/dsa/dsa_generate_pqg.o \ pk/dsa/dsa_free.o \ pk/dsa/dsa_import.o \ pk/dsa/dsa_make_key.o \ pk/dsa/dsa_set.o \ pk/dsa/dsa_set_pqg_dsaparam.o \ pk/dsa/dsa_shared_secret.o \ pk/dsa/dsa_sign_hash.o \ pk/dsa/dsa_verify_hash.o \ pk/dsa/dsa_verify_key.o \ pk/ecc/ecc.o \ pk/ecc/ecc_ansi_x963_export.o \ pk/ecc/ecc_ansi_x963_import.o \ pk/ecc/ecc_decrypt_key.o \ pk/ecc/ecc_encrypt_key.o \ pk/ecc/ecc_export.o \ pk/ecc/ecc_free.o \ pk/ecc/ecc_get_size.o \ pk/ecc/ecc_import.o \ pk/ecc/ecc_make_key.o \ pk/ecc/ecc_shared_secret.o \ pk/ecc/ecc_sign_hash.o \ pk/ecc/ecc_sizes.o \ pk/ecc/ecc_test.o \ pk/ecc/ecc_verify_hash.o \ pk/ecc/ltc_ecc_map.o \ pk/ecc/ltc_ecc_is_valid_idx.o \ pk/ecc/ltc_ecc_mul2add.o \ pk/ecc/ltc_ecc_mulmod.o \ pk/ecc/ltc_ecc_mulmod_timing.o \ pk/ecc/ltc_ecc_points.o \ pk/ecc/ltc_ecc_projective_add_point.o \ pk/ecc/ltc_ecc_projective_dbl_point.o \ pk/katja/katja_decrypt_key.o \ pk/katja/katja_encrypt_key.o \ pk/katja/katja_export.o \ pk/katja/katja_exptmod.o \ pk/katja/katja_free.o \ pk/katja/katja_import.o \ pk/katja/katja_make_key.o \ pk/pkcs1/pkcs_1_i2osp.o \ pk/pkcs1/pkcs_1_mgf1.o \ pk/pkcs1/pkcs_1_oaep_decode.o \ pk/pkcs1/pkcs_1_oaep_encode.o \ pk/pkcs1/pkcs_1_os2ip.o \ pk/pkcs1/pkcs_1_pss_decode.o \ pk/pkcs1/pkcs_1_pss_encode.o \ pk/pkcs1/pkcs_1_v1_5_decode.o \ pk/pkcs1/pkcs_1_v1_5_encode.o \ pk/rsa/rsa_decrypt_key.o \ pk/rsa/rsa_encrypt_key.o \ pk/rsa/rsa_export.o \ pk/rsa/rsa_exptmod.o \ pk/rsa/rsa_free.o \ pk/rsa/rsa_get_size.o \ pk/rsa/rsa_import.o \ pk/rsa/rsa_import_pkcs8.o \ pk/rsa/rsa_import_x509.o \ pk/rsa/rsa_make_key.o \ pk/rsa/rsa_set.o \ pk/rsa/rsa_sign_hash.o \ pk/rsa/rsa_sign_saltlen_get.o \ pk/rsa/rsa_verify_hash.o \ prngs/chacha20.o \ prngs/fortuna.o \ prngs/rc4.o \ prngs/rng_get_bytes.o \ prngs/rng_make_prng.o \ prngs/sober128.o \ prngs/sprng.o \ prngs/yarrow.o \ stream/chacha/chacha_crypt.o \ stream/chacha/chacha_done.o \ stream/chacha/chacha_ivctr32.o \ stream/chacha/chacha_ivctr64.o \ stream/chacha/chacha_keystream.o \ stream/chacha/chacha_setup.o \ stream/chacha/chacha_test.o \ stream/rc4/rc4_stream.o \ stream/rc4/rc4_test.o \ stream/sober128/sober128_stream.o \ stream/sober128/sober128_test.o libtomcrypt/%.o: CFLAGS+=-DTFM_DESC -Isrc/headers -Itomsfastmath/src/headers -DARGTYPE=4 -DLTC_NO_ASM -DTFM_NO_ASM -Ilibtomcrypt/src/headers -DLTC_SOURCE ltc.o: $(addprefix libtomcrypt/src/, $(LTCOBJ)) ld -o $@ -r $+ crypto/rfc3986.c: crypto/rfc3986.re re2c --input custom --tags -o $@ $< rfc3986: rfc3986.c $(CC) -Wall -W -Wextra -Werror -o $@ $+ 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 zpm-fetchurl: ltc.o tls.o tfm.o src/fetchurl.o crypto/https.o crypto/rfc3986.o $(CC) $(CFLAGS) -static -o $@ $+ testddg: zpm-fetchurl ./zpm-fetchurl duckduckgo.com 443 / testgra: zpm-fetchurl ./zpm-fetchurl granicus.if.org 443 / SIGNSRC= \ crypto/libeddsa/sign.c \ crypto/libeddsa/lib/burn.c \ crypto/libeddsa/lib/burnstack.c \ crypto/libeddsa/lib/ed.c \ crypto/libeddsa/lib/ed25519-sha512.c \ crypto/libeddsa/lib/fld.c \ crypto/libeddsa/lib/sc.c \ crypto/libeddsa/lib/sha512.c \ crypto/libeddsa/lib/x25519.c SIGNOBJ=$(SIGNSRC:.c=.o) $(SIGNOBJ): CFLAGS=-Wall -Wextra -W -Werror -Wno-pointer-sign \ -Icrypto/libeddsa/lib -Wno-unused-command-line-argument zpm-sign: $(SIGNOBJ) $(CC) -Wall -Wextra -W -Werror -Wno-unused-command-line-argument -static -o $@ $+ clean: rm -f *.o sqlite/*.o lib/*.o $(LZMAOBJ) liblzma.a \ libelf.a libzpm.a zpm-addfile soname \ *.xz \ local.db \ t/ctap/*.o \ $(ZPKGBIN) \ db.sql \ elf/*.o lib/jsw/*.o \ $(addprefix crypto/ref10/, $(X255OBJ)) \ $(addprefix crypto/, $(TLSOBJ)) \ $(addprefix tomsfastmath/src/, $(TFMOBJ)) \ $(addprefix libtomcrypt/src/, $(LTCOBJ)) \ $(SIGNOBJ) \ x25519.o