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.

87 lines
2.3 KiB

17 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 hal-storage`
  7. LIBS := `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
  24. PAM_USB_DEST := $(DESTDIR)/lib/security
  25. # pamusb-check
  26. PAMUSB_CHECK_SRCS := src/pamusb-check.c
  27. PAMUSB_CHECK_OBJS := $(PAMUSB_CHECK_SRCS:.c=.o)
  28. PAMUSB_CHECK := pamusb-check
  29. # Tools
  30. PAMUSB_CONF := pamusb-conf
  31. PAMUSB_AGENT := pamusb-agent
  32. TOOLS_DEST := $(DESTDIR)/usr/bin
  33. TOOLS_SRC := tools
  34. # Conf
  35. CONFS := doc/pamusb.conf
  36. CONFS_DEST := $(DESTDIR)/etc
  37. # Doc
  38. DOCS := doc/QUICKSTART doc/CONFIGURATION doc/UPGRADING doc/FAQ
  39. DOCS_DEST := $(DESTDIR)/usr/share/doc/pamusb
  40. # Man
  41. MANS := doc/pamusb-conf.1.gz doc/pamusb-agent.1.gz doc/pamusb-check.1.gz
  42. MANS_DEST := $(DESTDIR)/usr/share/man/man1
  43. # Binaries
  44. RM := rm
  45. INSTALL := install
  46. MKDIR := mkdir
  47. ifeq (yes, ${DEBUG})
  48. CFLAGS := ${CFLAGS} -ggdb
  49. endif
  50. all : $(PAM_USB) $(PAMUSB_CHECK)
  51. $(PAM_USB) : $(OBJS) $(PAM_USB_OBJS)
  52. $(CC) -o $(PAM_USB) $(PAM_USB_LDFLAGS) $(LDFLAGS) $(OBJS) $(PAM_USB_OBJS) $(LIBS)
  53. $(PAMUSB_CHECK) : $(OBJS) $(PAMUSB_CHECK_OBJS)
  54. $(CC) -o $(PAMUSB_CHECK) $(LDFLAGS) $(OBJS) $(PAMUSB_CHECK_OBJS) $(LIBS)
  55. %.o : %.c
  56. ${CC} -c ${CFLAGS} $< -o $@
  57. clean :
  58. $(RM) -f $(PAM_USB) $(PAMUSB_CHECK) $(OBJS) $(PAMUSB_CHECK_OBJS) $(PAM_USB_OBJS)
  59. install : all
  60. $(MKDIR) -p $(CONFS_DEST) $(DOCS_DEST) $(MANS_DEST) $(TOOLS_DEST) $(PAM_USB_DEST)
  61. $(INSTALL) -m755 $(PAM_USB) $(PAM_USB_DEST)
  62. $(INSTALL) -m755 $(PAMUSB_CHECK) $(TOOLS_SRC)/$(PAMUSB_CONF) $(TOOLS_SRC)/$(PAMUSB_AGENT) $(TOOLS_DEST)
  63. $(INSTALL) -b -m644 $(CONFS) $(CONFS_DEST)
  64. $(INSTALL) -m644 $(DOCS) $(DOCS_DEST)
  65. $(INSTALL) -m644 $(MANS) $(MANS_DEST)
  66. deinstall :
  67. $(RM) -f $(PAM_USB_DEST)/$(PAM_USB)
  68. $(RM) -f $(TOOLS_DEST)/$(PAMUSB_CHECK) $(TOOLS_DEST)/$(PAMUSB_CONF) $(TOOLS_DEST)/$(PAMUSB_AGENT)
  69. $(RM) -rf $(DOCS_DEST)
  70. $(RM) -f $(MANS_DEST)/pusb_*