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.

72 lines
1.8 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
  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 `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. # Binaries
  34. RM := rm
  35. INSTALL := install
  36. MKDIR := mkdir
  37. ifeq (yes, ${DEBUG})
  38. CFLAGS := ${CFLAGS} -ggdb
  39. endif
  40. all : $(PAM_USB) $(PUSB_CHECK)
  41. $(PAM_USB) : $(OBJS) $(PAM_USB_OBJS)
  42. $(CC) -o $(PAM_USB) $(PAM_USB_LDFLAGS) $(OBJS) $(PAM_USB_OBJS)
  43. $(PUSB_CHECK) : $(OBJS) $(PUSB_CHECK_OBJS)
  44. $(CC) -o $(PUSB_CHECK) $(LDFLAGS) $(OBJS) $(PUSB_CHECK_OBJS)
  45. %.o : %.c
  46. ${CC} -c ${CFLAGS} $< -o $@
  47. clean :
  48. $(RM) -f $(PAM_USB) $(PUSB_CHECK) $(OBJS) $(PUSB_CHECK_OBJS) $(PAM_USB_OBJS)
  49. install : all
  50. $(MKDIR) -p /etc/pusb
  51. $(INSTALL) -m644 $(PAM_USB) $(PAM_USB_DEST)
  52. $(INSTALL) -m755 $(PUSB_CHECK) $(TOOLS_DEST)
  53. $(INSTALL) -m755 $(PUSB_ADM) $(TOOLS_DEST)
  54. $(INSTALL) -m755 $(PUSB_HOTPLUG) $(TOOLS_DEST)
  55. $(INSTALL) -m644 doc/pusb.conf-example /etc/pusb
  56. deinstall :
  57. $(RM) -f $(PAM_USB_DEST)/$(PAM_USB)
  58. $(RM) -f $(TOOLS_DEST)/$(PUSB_CHECK) $(TOOLS_DEST)/$(PUSB_ADM) $(TOOLS_DEST)/$(PUSB_HOTPLUG)