Makefile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #!/usr/bin/make -f
  2. #define variables
  3. TOOLS_INSTALL_DIR = $(epidinstalldir)/tools
  4. EXTRACTGRPS_INCLUDE_DIR = ./extractgrps
  5. EXTRACTGRPS_SRC = $(wildcard ./extractgrps/src/*.c)
  6. EXTRACTGRPS_OBJ = $(sort $(EXTRACTGRPS_SRC:.c=.o))
  7. EXTRACTGRPS_EXE = ./extractgrps/src/extractgrps
  8. EXTRACTKEYS_INCLUDE_DIR = ./extractkeys
  9. EXTRACTKEYS_SRC = $(wildcard ./extractkeys/src/*.c)
  10. EXTRACTKEYS_OBJ = $(sort $(EXTRACTKEYS_SRC:.c=.o))
  11. EXTRACTKEYS_EXE = ./extractkeys/src/extractkeys
  12. REVOKEGRP_INCLUDE_DIR = ./revokegrp
  13. REVOKEGRP_SRC = $(wildcard ./revokegrp/src/*.c)
  14. REVOKEGRP_OBJ = $(sort $(REVOKEGRP_SRC:.c=.o))
  15. REVOKEGRP_EXE = ./revokegrp/src/revokegrp
  16. REVOKEKEY_INCLUDE_DIR = ./revokekey
  17. REVOKEKEY_SRC = $(wildcard ./revokekey/src/*.c)
  18. REVOKEKEY_OBJ = $(sort $(REVOKEKEY_SRC:.c=.o))
  19. REVOKEKEY_EXE = ./revokekey/src/revokekey
  20. REVOKESIG_INCLUDE_DIR = ./revokesig
  21. REVOKESIG_SRC = $(wildcard ./revokesig/src/*.c)
  22. REVOKESIG_OBJ = $(sort $(REVOKESIG_SRC:.c=.o))
  23. REVOKESIG_EXE = ./revokesig/src/revokesig
  24. EPID_SDK_ROOT_DIR = ..
  25. EXAMPLE_DIR = $(EPID_SDK_ROOT_DIR)/example
  26. LIB_DROPT_DIR = $(EPID_SDK_ROOT_DIR)/ext/dropt/src
  27. LIB_UTIL_DIR = $(EPID_SDK_ROOT_DIR)/example/util/src
  28. LIB_IPPCP_DIR = $(EPID_SDK_ROOT_DIR)/ext/ipp/sources/ippcp/src
  29. LIB_IPPCPEPID_DIR = $(EPID_SDK_ROOT_DIR)/ext/ipp/sources/ippcpepid/src
  30. LIB_MEMBER_DIR = $(EPID_SDK_ROOT_DIR)/epid/member
  31. LIB_COMMON_DIR = $(EPID_SDK_ROOT_DIR)/epid/common
  32. #set linker flags
  33. LDFLAGS += -L$(LIB_UTIL_DIR) \
  34. -L$(LIB_DROPT_DIR) \
  35. -L$(LIB_IPPCP_DIR) \
  36. -L$(LIB_COMMON_DIR) \
  37. -L$(LIB_IPPCPEPID_DIR) \
  38. -lcommon -lippcpepid \
  39. -lippcp -lutil -ldropt
  40. $(EXTRACTGRPS_EXE): $(EXTRACTGRPS_OBJ)
  41. $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
  42. $(EXTRACTGRPS_OBJ): %.o: %.c
  43. $(CC) -o $@ $(CFLAGS) -I$(EPID_SDK_ROOT_DIR) \
  44. -I${EXAMPLE_DIR} -I$(EXTRACTGRPS_INCLUDE_DIR) \
  45. -I${LIB_DROPT_DIR}/../include \
  46. -c $^
  47. $(EXTRACTKEYS_EXE): $(EXTRACTKEYS_OBJ)
  48. $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
  49. $(EXTRACTKEYS_OBJ): %.o: %.c
  50. $(CC) -o $@ $(CFLAGS) -I$(EPID_SDK_ROOT_DIR) \
  51. -I${EXAMPLE_DIR} -I$(EXTRACTKEYS_INCLUDE_DIR) \
  52. -I${LIB_DROPT_DIR}/../include \
  53. -c $^
  54. $(REVOKEGRP_EXE): $(REVOKEGRP_OBJ)
  55. $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
  56. $(REVOKEGRP_OBJ): %.o: %.c
  57. $(CC) -o $@ $(CFLAGS) -I$(EPID_SDK_ROOT_DIR) \
  58. -I${EXAMPLE_DIR} -I$(REVOKEGRP_INCLUDE_DIR) \
  59. -I${LIB_DROPT_DIR}/../include \
  60. -c $^
  61. $(REVOKEKEY_EXE): $(REVOKEKEY_OBJ)
  62. $(CC) -o $@ $^ $(CFLAGS) -L$(LIB_MEMBER_DIR) -lmember $(LDFLAGS)
  63. $(REVOKEKEY_OBJ): %.o: %.c
  64. $(CC) -o $@ $(CFLAGS) -I$(EPID_SDK_ROOT_DIR) \
  65. -I$(LIB_MEMBER_DIR)/../.. \
  66. -I${EXAMPLE_DIR} -I$(REVOKEKEY_INCLUDE_DIR) \
  67. -I${LIB_DROPT_DIR}/../include \
  68. -c $^
  69. $(REVOKESIG_EXE): $(REVOKESIG_OBJ)
  70. $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
  71. $(REVOKESIG_OBJ): %.o: %.c
  72. $(CC) -o $@ $(CFLAGS) -I$(EPID_SDK_ROOT_DIR) \
  73. -I${EXAMPLE_DIR} -I$(REVOKESIG_INCLUDE_DIR) \
  74. -I${LIB_DROPT_DIR}/../include \
  75. -c $^
  76. #target part
  77. build: all install
  78. all: $(EXTRACTGRPS_EXE) $(EXTRACTKEYS_EXE) $(REVOKEGRP_EXE) $(REVOKEKEY_EXE) $(REVOKESIG_EXE)
  79. install:
  80. mkdir -p '$(TOOLS_INSTALL_DIR)'
  81. cp $(EXTRACTGRPS_EXE) $(EXTRACTKEYS_EXE) $(REVOKEGRP_EXE) $(REVOKEKEY_EXE) $(REVOKESIG_EXE) \
  82. '$(TOOLS_INSTALL_DIR)'
  83. clean:
  84. rm -f $(EXTRACTGRPS_EXE) $(EXTRACTKEYS_EXE) $(REVOKEGRP_EXE) $(REVOKEKEY_EXE) $(REVOKESIG_EXE) \
  85. $(EXTRACTGRPS_OBJ) $(EXTRACTKEYS_OBJ) $(REVOKEGRP_OBJ) $(REVOKEKEY_OBJ) $(REVOKESIG_OBJ)