Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #!/usr/bin/make -f
  2. #define variables
  3. IPP_API_INCLUDE_DIR = ../ext/ipp/include
  4. EXAMPLE_INSTALL_DIR = $(epidinstalldir)/example
  5. COMPRESSED_DEFAULT_FILES_INSTALL_DIR = $(epidinstalldir)/compressed_example
  6. SIGNMSG_INCLUDE_DIR = ./signmsg
  7. SIGNMSG_SRC = $(wildcard ./signmsg/src/*.c)
  8. SIGNMSG_OBJ = $(sort $(SIGNMSG_SRC:.c=.o))
  9. SIGNMSG_EXE = ./signmsg/src/signmsg
  10. VERIFYSIG_INCLUDE_DIR = ./verifysig
  11. VERIFYSIG_SRC = $(wildcard ./verifysig/src/*.c)
  12. VERIFYSIG_OBJ = $(sort $(VERIFYSIG_SRC:.c=.o))
  13. VERIFYSIG_EXE = ./verifysig/src/verifysig
  14. LIB_UTIL_DIR = ./util/src
  15. LIB_DROPT_DIR = ../ext/dropt/src
  16. LIB_IPPCP_DIR = ../ext/ipp/sources/ippcp/src
  17. LIB_IPPCPEPID_DIR = ../ext/ipp/sources/ippcpepid/src
  18. LIB_MEMBER_DIR = ../epid/member
  19. LIB_VERIFIER_DIR = ../epid/verifier
  20. LIB_COMMON_DIR = ../epid/common
  21. #set linker flags
  22. LDFLAGS += -L$(LIB_UTIL_DIR) \
  23. -L$(LIB_DROPT_DIR) \
  24. -L$(LIB_IPPCP_DIR) \
  25. -L$(LIB_COMMON_DIR) \
  26. -L$(LIB_IPPCPEPID_DIR) \
  27. -lcommon -lippcpepid \
  28. -lippcp -lutil -ldropt
  29. $(VERIFYSIG_EXE): $(VERIFYSIG_OBJ)
  30. $(CC) -o $@ $^ $(CFLAGS) -L$(LIB_VERIFIER_DIR) -lverifier $(LDFLAGS)
  31. $(VERIFYSIG_OBJ): %.o: %.c
  32. $(CC) -o $@ $(CFLAGS) -I$(LIB_UTIL_DIR)/../.. \
  33. -I$(LIB_DROPT_DIR)/../include \
  34. -I$(LIB_VERIFIER_DIR)/../.. \
  35. -I$(VERIFYSIG_INCLUDE_DIR) \
  36. -I$(IPP_API_INCLUDE_DIR) -c $^
  37. $(SIGNMSG_EXE): $(SIGNMSG_OBJ)
  38. $(CC) -o $@ $^ $(CFLAGS) -L$(LIB_MEMBER_DIR) -lmember $(LDFLAGS)
  39. $(SIGNMSG_OBJ): %.o: %.c
  40. $(CC) -o $@ $(CFLAGS) -I$(LIB_UTIL_DIR)/../.. \
  41. -I$(LIB_DROPT_DIR)/../include \
  42. -I$(LIB_MEMBER_DIR)/../.. \
  43. -I$(SIGNMSG_INCLUDE_DIR) \
  44. -I$(IPP_API_INCLUDE_DIR) -c $^
  45. #target part
  46. build: all install
  47. all: $(VERIFYSIG_EXE) $(SIGNMSG_EXE)
  48. install:
  49. mkdir -p '$(EXAMPLE_INSTALL_DIR)/data'
  50. cp -r ./data/group* ./data/grprl_empty.bin \
  51. ./data/*.md '$(EXAMPLE_INSTALL_DIR)/data'
  52. cp ./data/cacert.bin ./data/grprl.bin \
  53. ./data/privrl.bin ./data/sigrl.bin \
  54. ./data/mprivkey.dat ./data/pubkey.bin \
  55. '$(EXAMPLE_INSTALL_DIR)'
  56. mkdir -p '$(EXAMPLE_INSTALL_DIR)/compressed_data'
  57. cp -r ./compressed_data/group* ./compressed_data/grprl_empty.bin \
  58. ./compressed_data/*.md '$(EXAMPLE_INSTALL_DIR)/compressed_data'
  59. mkdir -p '$(COMPRESSED_DEFAULT_FILES_INSTALL_DIR)'
  60. cp ./compressed_data/cacert.bin ./compressed_data/grprl.bin \
  61. ./compressed_data/privrl.bin ./compressed_data/sigrl.bin \
  62. ./compressed_data/mprivkey.dat ./compressed_data/pubkey.bin \
  63. '$(COMPRESSED_DEFAULT_FILES_INSTALL_DIR)'
  64. cp $(VERIFYSIG_EXE) $(SIGNMSG_EXE) '$(EXAMPLE_INSTALL_DIR)'
  65. clean:
  66. rm -f $(VERIFYSIG_OBJ) \
  67. $(VERIFYSIG_EXE) \
  68. $(SIGNMSG_OBJ) \
  69. $(SIGNMSG_EXE)