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.

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