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.

96 lines
2.4 KiB

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