2
0

Makefile 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. # ESP8266 Project Makefile for wolfssl_client
  2. #
  3. # Copyright (C) 2006-2024 wolfSSL Inc.
  4. #
  5. # This file is part of wolfSSL.
  6. #
  7. # wolfSSL is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # wolfSSL is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
  20. #
  21. #
  22. # This is a project Makefile.
  23. # It is assumed the directory this Makefile resides in is a
  24. # project subdirectory containing an entire project.
  25. #
  26. # Optional private config headers. Define environment variables
  27. # to include various default header files that are typically
  28. # not in a git path, and thus excluded from being checked in.
  29. #
  30. # Environment Variable Name | Header file name included
  31. # ---------------------------------- | ---------------------------------------
  32. # MY_PRIVATE_CONFIG (files detected / selected in header)
  33. # USE_MY_PRIVATE_WSL_CONFIG /mnt/c/workspace/my_private_config.h
  34. # USE_MY_PRIVATE_MAC_CONFIG ~/Documents/my_private_config.h
  35. # USE_MY_PRIVATE_LINUX_CONFIG ~/workspace/my_private_config.h
  36. # USE_MY_PRIVATE_WINDOWS_CONFIG /workspace/my_private_config.h
  37. #
  38. #
  39. PROJECT_NAME := wolfssl_client
  40. # Optionally include component source when print path (needs work to then properly build)
  41. #
  42. # include components/wolfssl/component.mk
  43. MY_PRIVATE_CONFIG ?= n
  44. USE_MY_PRIVATE_WSL_CONFIG ?= n
  45. USE_MY_PRIVATE_MAC_CONFIG ?= n
  46. USE_MY_PRIVATE_LINUX_CONFIG ?= n
  47. USE_MY_PRIVATE_WINDOWS_CONFIG ?= n
  48. # Calling shell causes unintuitive error in Windows:
  49. # OS := $(shell uname -s)
  50. #
  51. # But OS, or MY_PRIVATE_CONFIG should already be defined:
  52. $(info ************* wolfssl_client *************)
  53. ifeq ($(MY_PRIVATE_CONFIG),y)
  54. CFLAGS += -DMY_PRIVATE_CONFIG
  55. $(info Enabled MY_PRIVATE_CONFIG")
  56. endif
  57. # Check for Windows environment variable: USE_MY_PRIVATE_WINDOWS_CONFIG
  58. ifeq ($(USE_MY_PRIVATE_WINDOWS_CONFIG),y)
  59. # This hard coded MY_CONFIG_FILE value must match that in the header file.
  60. MY_CONFIG_FILE := /workspace/my_private_config.h
  61. ifeq ($(wildcard $(MY_CONFIG_FILE)),)
  62. $(info File does not exist: $(MY_CONFIG_FILE))
  63. else
  64. CFLAGS += -DUSE_MY_PRIVATE_WINDOWS_CONFIG
  65. $(info Using private config file for: Windows)
  66. endif
  67. endif
  68. # Check for WSL environment variable: USE_MY_PRIVATE_WSL_CONFIG
  69. ifeq ($(USE_MY_PRIVATE_WSL_CONFIG),y)
  70. # This hard coded MY_CONFIG_FILE value must match that in the header file.
  71. MY_CONFIG_FILE := /mnt/c/workspace/my_private_config.h
  72. ifeq ($(wildcard $(MY_CONFIG_FILE)),)
  73. $(info File does not exist: $(MY_CONFIG_FILE))
  74. else
  75. CFLAGS += -DUSE_MY_PRIVATE_WSL_CONFIG
  76. $(info Using private config file for: WSL)
  77. endif
  78. endif
  79. # Check for Linux environment variable: USE_MY_PRIVATE_LINUX_CONFIG
  80. ifeq ($(USE_MY_PRIVATE_LINUX_CONFIG),y)
  81. # This hard coded MY_CONFIG_FILE value must match that in the header file.
  82. MY_CONFIG_FILE := ~/workspace/my_private_config.h
  83. ifeq ($(wildcard $(MY_CONFIG_FILE)),)
  84. $(info File does not exist: $(MY_CONFIG_FILE))
  85. else
  86. CFLAGS += -DUSE_MY_PRIVATE_LINUX_CONFIG
  87. $(info Using private config file for: Linux)
  88. endif
  89. endif
  90. # Check for Mac environment variable: USE_MY_PRIVATE_MAC_CONFIG
  91. ifeq ($(USE_MY_PRIVATE_MAC_CONFIG),y)
  92. # This hard coded MY_CONFIG_FILE value must match that in the header file.
  93. MY_CONFIG_FILE := ~/Documents/my_private_config.h
  94. ifeq ($(wildcard $(MY_CONFIG_FILE)),)
  95. $(info File does not exist: $(MY_CONFIG_FILE))
  96. else
  97. CFLAGS += -DUSE_MY_PRIVATE_MAC_CONFIG
  98. $(info Using private config file for: Mac)
  99. endif
  100. endif
  101. ifneq ($(OS),MY_PRIVATE_CONFIG)
  102. CFLAGS += -DMY_PRIVATE_CONFIG="$(MY_PRIVATE_CONFIG)"
  103. else
  104. ifeq ($(OS),Linux)
  105. CFLAGS += -DOS_LINUX
  106. endif
  107. ifeq ($(OS),Windows_NT)
  108. CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_WINDOWS
  109. endif
  110. ifeq ($(OS),Darwin)
  111. CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_APPLE
  112. endif
  113. ifneq (,$(findstring MINGW,$(OS)))
  114. CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_MINGW
  115. endif
  116. ifneq (,$(findstring CYGWIN,$(OS)))
  117. CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_CYGWIN
  118. endif
  119. endif
  120. # It is essential that the build process sees the WOLFSSL_USER_SETTINGS
  121. CFLAGS += -DWOLFSSL_USER_SETTINGS
  122. # if directory not available, please disable the line below.
  123. EXTRA_COMPONENT_DIRS = $(IDF_PATH)/examples/common_components/protocol_examples_common
  124. # The Standard Espressif IDF include:
  125. include $(IDF_PATH)/make/project.mk