Hardware authentication for Linux using ordinary USB Flash Drives.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.3 KiB

12 years ago
18 years ago
9 years ago
9 years ago
18 years ago
13 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
  1. # Set to 'yes' to include debugging information, e.g. DEBUG=yes make -e
  2. DEBUG := no
  3. PREFIX ?= /usr
  4. LIBDIR ?= lib
  5. # compiler/linker options
  6. CC := gcc
  7. CFLAGS := $(CFLAGS) -Wall -fPIC `pkg-config --cflags libxml-2.0` \
  8. `pkg-config --cflags udisks2`
  9. LIBS := `pkg-config --libs libxml-2.0` \
  10. `pkg-config --libs udisks2`
  11. # common source files
  12. SRCS := src/conf.c \
  13. src/mem.c \
  14. src/log.c \
  15. src/xpath.c \
  16. src/pad.c \
  17. src/volume.c \
  18. src/local.c \
  19. src/device.c
  20. OBJS := $(SRCS:.c=.o)
  21. # pam_usb
  22. PAM_USB_SRCS := src/pam.c
  23. PAM_USB_OBJS := $(PAM_USB_SRCS:.c=.o)
  24. PAM_USB := pam_usb.so
  25. PAM_USB_LDFLAGS := -shared
  26. PAM_USB_DEST := $(DESTDIR)/$(LIBDIR)/security
  27. # pamusb-check
  28. PAMUSB_CHECK_SRCS := src/pamusb-check.c
  29. PAMUSB_CHECK_OBJS := $(PAMUSB_CHECK_SRCS:.c=.o)
  30. PAMUSB_CHECK := pamusb-check
  31. # Tools
  32. PAMUSB_CONF := pamusb-conf
  33. PAMUSB_AGENT := pamusb-agent
  34. TOOLS_DEST := $(DESTDIR)$(PREFIX)/bin
  35. TOOLS_SRC := tools
  36. # Conf
  37. CONFS := doc/pamusb.conf
  38. CONFS_DEST := $(DESTDIR)/etc
  39. # Doc
  40. DOCS := doc/CONFIGURATION.md
  41. DOCS_DEST := $(DESTDIR)$(PREFIX)/share/doc/pamusb
  42. # Man
  43. MANS := doc/pamusb-conf.1.gz doc/pamusb-agent.1.gz doc/pamusb-check.1.gz
  44. MANS_DEST := $(DESTDIR)$(PREFIX)/share/man/man1
  45. # Binaries
  46. RM := rm
  47. INSTALL := install
  48. MKDIR := mkdir
  49. ifeq (yes, ${DEBUG})
  50. CFLAGS := ${CFLAGS} -ggdb
  51. endif
  52. all : $(PAM_USB) $(PAMUSB_CHECK)
  53. $(PAM_USB) : $(OBJS) $(PAM_USB_OBJS)
  54. $(CC) -o $(PAM_USB) $(PAM_USB_LDFLAGS) $(LDFLAGS) $(OBJS) $(PAM_USB_OBJS) $(LIBS)
  55. $(PAMUSB_CHECK) : $(OBJS) $(PAMUSB_CHECK_OBJS)
  56. $(CC) -o $(PAMUSB_CHECK) $(LDFLAGS) $(OBJS) $(PAMUSB_CHECK_OBJS) $(LIBS)
  57. %.o : %.c
  58. ${CC} -c ${CFLAGS} $< -o $@
  59. clean :
  60. $(RM) -f $(PAM_USB) $(PAMUSB_CHECK) $(OBJS) $(PAMUSB_CHECK_OBJS) $(PAM_USB_OBJS)
  61. install : all
  62. $(MKDIR) -p $(CONFS_DEST) $(DOCS_DEST) $(MANS_DEST) $(TOOLS_DEST) $(PAM_USB_DEST)
  63. $(INSTALL) -m755 $(PAM_USB) $(PAM_USB_DEST)
  64. $(INSTALL) -m755 $(PAMUSB_CHECK) $(TOOLS_SRC)/$(PAMUSB_CONF) $(TOOLS_SRC)/$(PAMUSB_AGENT) $(TOOLS_DEST)
  65. $(INSTALL) -b -m644 $(CONFS) $(CONFS_DEST)
  66. $(INSTALL) -m644 $(DOCS) $(DOCS_DEST)
  67. $(INSTALL) -m644 $(MANS) $(MANS_DEST)
  68. deinstall :
  69. $(RM) -f $(PAM_USB_DEST)/$(PAM_USB)
  70. $(RM) -f $(TOOLS_DEST)/$(PAMUSB_CHECK) $(TOOLS_DEST)/$(PAMUSB_CONF) $(TOOLS_DEST)/$(PAMUSB_AGENT)
  71. $(RM) -rf $(DOCS_DEST)
  72. $(RM) -f $(MANS_DEST)/pusb_*