Makefile 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #
  2. # Copyright (C) 2011-2018 Intel Corporation. All rights reserved.
  3. #
  4. # Redistribution and use in source and binary forms, with or without
  5. # modification, are permitted provided that the following conditions
  6. # are met:
  7. #
  8. # * Redistributions of source code must retain the above copyright
  9. # notice, this list of conditions and the following disclaimer.
  10. # * Redistributions in binary form must reproduce the above copyright
  11. # notice, this list of conditions and the following disclaimer in
  12. # the documentation and/or other materials provided with the
  13. # distribution.
  14. # * Neither the name of Intel Corporation nor the names of its
  15. # contributors may be used to endorse or promote products derived
  16. # from this software without specific prior written permission.
  17. #
  18. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22. # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  24. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  28. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. #
  30. #
  31. include ../../buildenv.mk
  32. CHECK_CURL := $(shell which curl-config)
  33. ifeq ($(CHECK_CURL), )
  34. CURL_RESULT := check_fail
  35. else
  36. CURL_RESULT :=
  37. endif
  38. ifneq ($(USE_OPT_LIBS), 1)
  39. .PHONY: all
  40. all:
  41. $(info ***NOTE***: SDK is not built based on prebuilt optimized libs. SKIP the build for aesm_service.)
  42. else
  43. .PHONY: all
  44. ifeq ($(BUILD_REF_LE), 1)
  45. all: $(CURL_RESULT) AESM REF_LE COPY_AES CSE| $(BUILD_DIR)
  46. else
  47. all: $(CURL_RESULT) AESM COPY_AES CSE| $(BUILD_DIR)
  48. endif #($(BUILD_REF_LE), 1)
  49. endif #!($(USE_OPT_LIBS), 1)
  50. # COPY_AES: currently copy le, qe, pve, pce, pse_op, pse_pr
  51. .PHONY: COPY_AES
  52. COPY_AES: | $(BUILD_DIR)
  53. $(CP) data/prebuilt/* $(BUILD_DIR)
  54. .PHONY: AESM
  55. AESM: | $(BUILD_DIR)
  56. $(MAKE) -C aesm_service
  57. $(CP) aesm_service/config/aesmd_service/aesmd.conf $(BUILD_DIR)
  58. $(CP) aesm_service/config/aesmd_service/aesmd.service $(BUILD_DIR)
  59. .PHONY: REF_LE
  60. REF_LE:
  61. $(MAKE) -C ref_le
  62. .PHONY: CSE
  63. CSE: | $(BUILD_DIR)
  64. $(MAKE) -C cse_provision_tool
  65. @$(CP) cse_provision_tool/cse_provision_tool $|
  66. $(BUILD_DIR):
  67. @$(MKDIR) $@
  68. .PHONY: clean
  69. clean:
  70. $(MAKE) -C aesm_service/ clean
  71. $(MAKE) -C cse_provision_tool clean
  72. $(MAKE) -C ref_le clean
  73. .PHONY: rebuild
  74. rebuild:
  75. $(MAKE) clean
  76. $(MAKE) all
  77. .PHONY: check_fail
  78. check_fail:
  79. @echo ERROR: Please install libcurl by command such as
  80. @echo apt-get install libcurl4-openssl-dev
  81. @echo or
  82. @echo yum install libcurl-devel
  83. @echo with root account
  84. @exit 2