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.

86 lines
2.1 KiB

18 years ago
18 years ago
18 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 := -Wall -fPIC `pkg-config --cflags libxml-2.0` \
  6. `pkg-config --cflags hal-storage`
  7. LDFLAGS := `pkg-config --libs libxml-2.0` \
  8. `pkg-config --libs hal-storage`
  9. # common source files
  10. SRCS := src/conf.c \
  11. src/log.c \
  12. src/xpath.c \
  13. src/hal.c \
  14. src/pad.c \
  15. src/volume.c \
  16. src/local.c \
  17. src/device.c
  18. OBJS := $(SRCS:.c=.o)
  19. # pam_usb
  20. PAM_USB_SRCS := src/pam.c
  21. PAM_USB_OBJS := $(PAM_USB_SRCS:.c=.o)
  22. PAM_USB := pam_usb.so
  23. PAM_USB_LDFLAGS := -shared $(LDFLAGS)
  24. PAM_USB_DEST := $(DESTDIR)/lib/security
  25. # pusb_check
  26. PUSB_CHECK_SRCS := src/pusb_check.c
  27. PUSB_CHECK_OBJS := $(PUSB_CHECK_SRCS:.c=.o)
  28. PUSB_CHECK := pusb_check
  29. # Tools
  30. PUSB_ADM := tools/pusb_adm
  31. PUSB_HOTPLUG := tools/pusb_hotplug
  32. TOOLS_DEST := $(DESTDIR)/usr/bin
  33. # Conf
  34. CONFS := doc/pusb.conf-dist
  35. CONFS_DEST := $(DESTDIR)/etc/pusb
  36. # Doc
  37. DOCS := doc/installation doc/configuration doc/upgrading
  38. DOCS_DEST := $(DESTDIR)/usr/share/doc/pamusb
  39. # Man
  40. MANS := doc/pusb_adm.1.gz doc/pusb_hotplug.1.gz doc/pusb_check.1.gz
  41. MANS_DEST := $(DESTDIR)/usr/share/man/man1
  42. # Binaries
  43. RM := rm
  44. INSTALL := install
  45. MKDIR := mkdir
  46. ifeq (yes, ${DEBUG})
  47. CFLAGS := ${CFLAGS} -ggdb
  48. endif
  49. all : $(PAM_USB) $(PUSB_CHECK)
  50. $(PAM_USB) : $(OBJS) $(PAM_USB_OBJS)
  51. $(CC) -o $(PAM_USB) $(PAM_USB_LDFLAGS) $(OBJS) $(PAM_USB_OBJS)
  52. $(PUSB_CHECK) : $(OBJS) $(PUSB_CHECK_OBJS)
  53. $(CC) -o $(PUSB_CHECK) $(LDFLAGS) $(OBJS) $(PUSB_CHECK_OBJS)
  54. %.o : %.c
  55. ${CC} -c ${CFLAGS} $< -o $@
  56. clean :
  57. $(RM) -f $(PAM_USB) $(PUSB_CHECK) $(OBJS) $(PUSB_CHECK_OBJS) $(PAM_USB_OBJS)
  58. install : all
  59. $(MKDIR) -p $(CONFS_DEST) $(DOCS_DEST)
  60. $(INSTALL) -m644 $(PAM_USB) $(PAM_USB_DEST)
  61. $(INSTALL) -m755 $(PUSB_CHECK) $(PUSB_ADM) $(PUSB_HOTPLUG) $(TOOLS_DEST)
  62. $(INSTALL) -m644 $(CONFS) $(CONFS_DEST)
  63. $(INSTALL) -m644 $(DOCS) $(DOCS_DEST)
  64. $(INSTALL) -m644 $(MANS) $(MANS_DEST)
  65. deinstall :
  66. $(RM) -f $(PAM_USB_DEST)/$(PAM_USB)
  67. $(RM) -f $(TOOLS_DEST)/$(PUSB_CHECK) $(TOOLS_DEST)/$(PUSB_ADM) $(TOOLS_DEST)/$(PUSB_HOTPLUG)
  68. $(RM) -rf $(DOCS_DEST)
  69. $(RM) -f $(MANS_DEST)/pusb_*