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.

88 lines
2.3 KiB

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