sbin_PROGRAMS=mount.ecryptfs
bin_PROGRAMS=ecryptfs-manager ecryptfs-wrap-passphrase \
	     ecryptfs-unwrap-passphrase \
	     ecryptfs-insert-wrapped-passphrase-into-keyring \
	     ecryptfs-rewrap-passphrase
noinst_PROGRAMS=test

INCLUDES = -I../include

mount_ecryptfs_LDFLAGS = -lkeyutils -lgcrypt -lgpg-error -L../libecryptfs -lecryptfs -ldl -lc -lnsl
mount_ecryptfs_SOURCES = mount.ecryptfs.c io.c gen_key.c plaintext_decision_graph.c
ecryptfs_manager_LDFLAGS = -lgpg-error -lkeyutils -L../libecryptfs -lecryptfs
ecryptfs_manager_SOURCES = manager.c io.c gen_key.c
ecryptfs_wrap_passphrase_LDFLAGS = -L../libecryptfs -lecryptfs
ecryptfs_wrap_passphrase_SOURCES = ecryptfs_wrap_passphrase.c
ecryptfs_unwrap_passphrase_LDFLAGS = -L../libecryptfs -lecryptfs
ecryptfs_unwrap_passphrase_SOURCES = ecryptfs_unwrap_passphrase.c
ecryptfs_insert_wrapped_passphrase_into_keyring_LDFLAGS = -L../libecryptfs -lecryptfs
ecryptfs_insert_wrapped_passphrase_into_keyring_SOURCES = ecryptfs_insert_wrapped_passphrase_into_keyring.c
ecryptfs_rewrap_passphrase_LDFLAGS = -L../libecryptfs -lecryptfs
ecryptfs_rewrap_passphrase_SOURCES = ecryptfs_rewrap_passphrase.c
test_SOURCES = test.c io.c
test_LDFLAGS = -L../libecryptfs -lecryptfs

install-data-local:
	mkdir -p $(DESTDIR)/sbin
	cp -f .libs/mount.ecryptfs $(DESTDIR)/sbin/mount.ecryptfs
	chmod 755 $(DESTDIR)/sbin/mount.ecryptfs
	rm -f $(DESTDIR)/usr/sbin/mount.ecryptfs
	rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/sbin
