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.

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