Makefile 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. MY_PRIVATE_CONFIG ?= n
  41. USE_MY_PRIVATE_WSL_CONFIG ?= n
  42. USE_MY_PRIVATE_MAC_CONFIG ?= n
  43. USE_MY_PRIVATE_LINUX_CONFIG ?= n
  44. USE_MY_PRIVATE_WINDOWS_CONFIG ?= n
  45. # Calling shell causes unintuitive error in Windows:
  46. # OS := $(shell uname -s)
  47. #
  48. # But OS, or MY_PRIVATE_CONFIG should already be defined:
  49. $(info ************* wolfssl_client *************)
  50. ifeq ($(MY_PRIVATE_CONFIG),y)
  51. CFLAGS += -DMY_PRIVATE_CONFIG
  52. $(info Enabled MY_PRIVATE_CONFIG")
  53. endif
  54. # Check for Windows environment variable: USE_MY_PRIVATE_WINDOWS_CONFIG
  55. ifeq ($(USE_MY_PRIVATE_WINDOWS_CONFIG),y)
  56. # This hard coded MY_CONFIG_FILE value must match that in the header file.
  57. MY_CONFIG_FILE := /workspace/my_private_config.h
  58. ifeq ($(wildcard $(MY_CONFIG_FILE)),)
  59. $(info File does not exist: $(MY_CONFIG_FILE))
  60. else
  61. CFLAGS += -DUSE_MY_PRIVATE_WINDOWS_CONFIG
  62. $(info Using private config file for: Windows)
  63. endif
  64. endif
  65. # Check for WSL environment variable: USE_MY_PRIVATE_WSL_CONFIG
  66. ifeq ($(USE_MY_PRIVATE_WSL_CONFIG),y)
  67. # This hard coded MY_CONFIG_FILE value must match that in the header file.
  68. MY_CONFIG_FILE := /mnt/c/workspace/my_private_config.h
  69. ifeq ($(wildcard $(MY_CONFIG_FILE)),)
  70. $(info File does not exist: $(MY_CONFIG_FILE))
  71. else
  72. CFLAGS += -DUSE_MY_PRIVATE_WSL_CONFIG
  73. $(info Using private config file for: WSL)
  74. endif
  75. endif
  76. # Check for Linux environment variable: USE_MY_PRIVATE_LINUX_CONFIG
  77. ifeq ($(USE_MY_PRIVATE_LINUX_CONFIG),y)
  78. # This hard coded MY_CONFIG_FILE value must match that in the header file.
  79. MY_CONFIG_FILE := ~/workspace/my_private_config.h
  80. ifeq ($(wildcard $(MY_CONFIG_FILE)),)
  81. $(info File does not exist: $(MY_CONFIG_FILE))
  82. else
  83. CFLAGS += -DUSE_MY_PRIVATE_LINUX_CONFIG
  84. $(info Using private config file for: Linux)
  85. endif
  86. endif
  87. # Check for Mac environment variable: USE_MY_PRIVATE_MAC_CONFIG
  88. ifeq ($(USE_MY_PRIVATE_MAC_CONFIG),y)
  89. # This hard coded MY_CONFIG_FILE value must match that in the header file.
  90. MY_CONFIG_FILE := ~/Documents/my_private_config.h
  91. ifeq ($(wildcard $(MY_CONFIG_FILE)),)
  92. $(info File does not exist: $(MY_CONFIG_FILE))
  93. else
  94. CFLAGS += -DUSE_MY_PRIVATE_MAC_CONFIG
  95. $(info Using private config file for: Mac)
  96. endif
  97. endif
  98. ifneq ($(OS),MY_PRIVATE_CONFIG)
  99. CFLAGS += -DMY_PRIVATE_CONFIG="$(MY_PRIVATE_CONFIG)"
  100. else
  101. ifeq ($(OS),Linux)
  102. CFLAGS += -DOS_LINUX
  103. endif
  104. ifeq ($(OS),Windows_NT)
  105. CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_WINDOWS
  106. endif
  107. ifeq ($(OS),Darwin)
  108. CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_APPLE
  109. endif
  110. ifneq (,$(findstring MINGW,$(OS)))
  111. CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_MINGW
  112. endif
  113. ifneq (,$(findstring CYGWIN,$(OS)))
  114. CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_CYGWIN
  115. endif
  116. endif
  117. # It is essential that the build process sees the WOLFSSL_USER_SETTINGS
  118. CFLAGS += -DWOLFSSL_USER_SETTINGS
  119. # if directory not available, please disable the line below.
  120. EXTRA_COMPONENT_DIRS = $(IDF_PATH)/examples/common_components/protocol_examples_common
  121. # The Standard Espressif IDF include:
  122. include $(IDF_PATH)/make/project.mk