PROG	=	tarsnap-keymgmt
SRCS	=	keymgmt.c
WARNS	?=	6
LDADD	=	-lcrypto
CFLAGS	+=	-DUSERAGENT=\"${PROG}-${TARVERSION}\"
CFLAGS	+=	-DPLATFORM_CONFIG_H=\"config_freebsd.h\"
CFLAGS	+=	-DTSSERVER=\"${TSSERVER}\"
CFLAGS	+=	-I ../tar

# Data structures
.PATH.c	:	../lib/datastruct
SRCS	+=	rwhashtab.c
CFLAGS	+=	-I ../lib/datastruct

# Cryptographic code
.PATH.c	:	../lib/crypto
SRCS	+=	sha256.c
SRCS	+=	crypto_entropy.c
SRCS	+=	crypto_hash.c
SRCS	+=	crypto_keyfile.c
SRCS	+=	crypto_keys.c
SRCS	+=	crypto_keys_subr.c
SRCS	+=	crypto_file.c
SRCS	+=	crypto_aesctr.c
SRCS	+=	crypto_rsa.c
SRCS	+=	crypto_passwd_to_dh.c
SRCS	+=	crypto_dh.c
SRCS	+=	crypto_verify_bytes.c
SRCS	+=	crypto_keys_server.c
SRCS	+=	crypto_dh_group14.c
SRCS	+=	scryptenc.c
SRCS	+=	scrypt-nosse.c
SRCS	+=	scrypt_cpuperf.c
CFLAGS	+=	-I ../lib/crypto

# Utility code
.PATH.c	:	../lib/util
SRCS	+=	b64encode.c
SRCS	+=	entropy.c
SRCS	+=	humansize.c
SRCS	+=	memlimit.c
SRCS	+=	readpass.c
CFLAGS	+=	-I ../lib/util

# Compiler flags for profiling
.if defined(PROFILE)
CFLAGS	+=	-g -pg -DPROFILE
.endif

# Debugging flags
.if defined(DEBUG)
CFLAGS	+=	-g
CFLAGS	+=	-DDEBUG
.endif

.include <bsd.prog.mk>
