Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 = $(SIGNMSG_SRC:.c=.o)
  9. SIGNMSG_EXE = ./signmsg/src/signmsg$(EXE_EXTENSION)
  10. VERIFYSIG_INCLUDE_DIR = ./verifysig
  11. VERIFYSIG_SRC = $(wildcard ./verifysig/src/*.c)
  12. VERIFYSIG_OBJ = $(VERIFYSIG_SRC:.c=.o)
  13. VERIFYSIG_EXE = ./verifysig/src/verifysig$(EXE_EXTENSION)
  14. LIB_UTIL_DIR = ./util/src
  15. LIB_ARGTABLE_DIR = ../ext/argtable3
  16. LIB_IPPCP_DIR = ../ext/ipp/sources/ippcp/src
  17. LIB_MEMBER_DIR = ../epid/member
  18. LIB_VERIFIER_DIR = ../epid/verifier
  19. LIB_COMMON_DIR = ../epid/common
  20. #set linker flags
  21. LDFLAGS += -L$(LIB_UTIL_DIR) \
  22. -L$(LIB_ARGTABLE_DIR) \
  23. -L$(LIB_IPPCP_DIR) \
  24. -L$(LIB_COMMON_DIR) \
  25. -lcommon \
  26. -lippcp -lutil -largtable3
  27. ifneq ($(TSS_PATH),)
  28. LDFLAGS += -L$(TSS_PATH) -ltss -lcrypto
  29. endif
  30. ifneq ($(TINY),)
  31. LDFLAGS += -L$(LIB_MEMBER_DIR) -lmath -ltiny_stdlib
  32. endif
  33. $(VERIFYSIG_EXE): $(VERIFYSIG_OBJ)
  34. $(CC) -o $@ $^ -L$(LIB_VERIFIER_DIR) -lverifier $(LDFLAGS)
  35. $(VERIFYSIG_OBJ): %.o: %.c
  36. $(CC) -o $@ $(CFLAGS) -I$(LIB_UTIL_DIR)/../.. \
  37. -I$(LIB_ARGTABLE_DIR) \
  38. -I$(LIB_VERIFIER_DIR)/../.. \
  39. -I$(VERIFYSIG_INCLUDE_DIR) \
  40. -I$(IPP_API_INCLUDE_DIR) -c $^
  41. $(SIGNMSG_EXE): $(SIGNMSG_OBJ)
  42. $(CC) -o $@ $^ -L$(LIB_MEMBER_DIR) -lmember $(LDFLAGS)
  43. $(SIGNMSG_OBJ): %.o: %.c
  44. $(CC) -o $@ $(CFLAGS) -I$(LIB_UTIL_DIR)/../.. \
  45. -I$(LIB_ARGTABLE_DIR) \
  46. -I$(LIB_MEMBER_DIR)/../.. \
  47. -I$(SIGNMSG_INCLUDE_DIR) \
  48. -I$(IPP_API_INCLUDE_DIR) -c $^
  49. #target part
  50. build: all install
  51. all: $(VERIFYSIG_EXE) $(SIGNMSG_EXE)
  52. install:
  53. mkdir -p '$(EXAMPLE_INSTALL_DIR)/data'
  54. cp -r ./data/group* ./data/grprl_empty.bin \
  55. ./data/*.md '$(EXAMPLE_INSTALL_DIR)/data'
  56. cp ./data/cacert.bin ./data/grprl.bin \
  57. ./data/privrl.bin ./data/sigrl.bin \
  58. ./data/mprivkey.dat ./data/pubkey.bin \
  59. '$(EXAMPLE_INSTALL_DIR)'
  60. mkdir -p '$(EXAMPLE_INSTALL_DIR)/compressed_data'
  61. cp -r ./compressed_data/group* ./compressed_data/grprl_empty.bin \
  62. ./compressed_data/*.md '$(EXAMPLE_INSTALL_DIR)/compressed_data'
  63. mkdir -p '$(COMPRESSED_DEFAULT_FILES_INSTALL_DIR)'
  64. cp ./compressed_data/cacert.bin ./compressed_data/grprl.bin \
  65. ./compressed_data/privrl.bin ./compressed_data/sigrl.bin \
  66. ./compressed_data/mprivkey.dat ./compressed_data/pubkey.bin \
  67. '$(COMPRESSED_DEFAULT_FILES_INSTALL_DIR)'
  68. cp $(VERIFYSIG_EXE) $(SIGNMSG_EXE) '$(EXAMPLE_INSTALL_DIR)'
  69. clean:
  70. rm -f $(VERIFYSIG_OBJ) \
  71. $(VERIFYSIG_EXE) \
  72. $(SIGNMSG_OBJ) \
  73. $(SIGNMSG_EXE)