|
| 1 | +# ESP8266 Project Makefile for wolfssl_client |
1 | 2 | # |
2 | | -# This is a project Makefile. It is assumed the directory this Makefile resides in is a |
3 | | -# project subdirectory. |
| 3 | +# Copyright (C) 2006-2025 wolfSSL Inc. |
4 | 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 3 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 | +PROJECT_NAME := wolfssl_template |
| 23 | +$(info ************* wolfssl_template *************) |
| 24 | + |
| 25 | +# ------------- BEGIN COMMON SECTION ------------- |
| 26 | + |
| 27 | +ifeq ($(strip $(IDF_PATH)),) |
| 28 | + $(error IDF_PATH is not set. Please export it before running make) |
| 29 | +endif |
| 30 | + |
| 31 | +# Default compiler flags |
| 32 | +CFLAGS ?= |
| 33 | +CXXFLAGS ?= |
5 | 34 |
|
6 | 35 | CFLAGS += -DWOLFSSL_USER_SETTINGS |
7 | 36 |
|
8 | 37 | # Some of the tests are CPU intenstive, so we'll force the watchdog timer off. |
9 | 38 | # There's an espressif NO_WATCHDOG; we don't use it, as it is reset by sdkconfig. |
10 | 39 | CFLAGS += -DWOLFSSL_ESP_NO_WATCHDOG=1 |
11 | 40 |
|
12 | | -PROJECT_NAME := wolfssl_template |
| 41 | +# Check if CONFIG_WOLFSSL_USE_MY_PRIVATE_CONFIG is set to 1 in environment |
| 42 | +ifeq ($(CONFIG_WOLFSSL_USE_MY_PRIVATE_CONFIG),1) |
| 43 | + $(info Setting CONFIG_WOLFSSL_USE_MY_PRIVATE_CONFIG from environment variablev for Makefile) |
| 44 | + CFLAGS += -DCONFIG_WOLFSSL_USE_MY_PRIVATE_CONFIG=1 |
| 45 | + CXXFLAGS += -DCONFIG_WOLFSSL_USE_MY_PRIVATE_CONFIG=1 |
| 46 | +else |
| 47 | + $(info CONFIG_WOLFSSL_USE_MY_PRIVATE_CONFIG not set, not using private config.) |
| 48 | +endif |
| 49 | + |
| 50 | +# |
| 51 | +# This is a project Makefile. |
| 52 | +# It is assumed the directory this Makefile resides in is a |
| 53 | +# project subdirectory containing an entire project. |
| 54 | +# |
| 55 | +# Optional private config headers. Define environment variables |
| 56 | +# to include various default header files that are typically |
| 57 | +# not in a git path, and thus excluded from being checked in. |
| 58 | +# |
| 59 | +# Environment Variable Name | Header file name included |
| 60 | +# ---------------------------------- | --------------------------------------- |
| 61 | +# MY_PRIVATE_CONFIG (files detected / selected in header) |
| 62 | +# USE_MY_PRIVATE_WSL_CONFIG /mnt/c/workspace/my_private_config.h |
| 63 | +# USE_MY_PRIVATE_MAC_CONFIG ~/Documents/my_private_config.h |
| 64 | +# USE_MY_PRIVATE_LINUX_CONFIG ~/workspace/my_private_config.h |
| 65 | +# USE_MY_PRIVATE_WINDOWS_CONFIG /workspace/my_private_config.h |
| 66 | +# |
| 67 | +# |
| 68 | + |
| 69 | +# Optionally include component source when print path (needs work to then properly build) |
| 70 | +# |
| 71 | +# include components/wolfssl/component.mk |
| 72 | + |
| 73 | +MY_PRIVATE_CONFIG ?= n |
| 74 | +USE_MY_PRIVATE_WSL_CONFIG ?= n |
| 75 | +USE_MY_PRIVATE_MAC_CONFIG ?= n |
| 76 | +USE_MY_PRIVATE_LINUX_CONFIG ?= n |
| 77 | +USE_MY_PRIVATE_WINDOWS_CONFIG ?= n |
| 78 | + |
| 79 | +# Calling shell causes unintuitive error in Windows: |
| 80 | +# OS := $(shell uname -s) |
| 81 | +# |
| 82 | +# But OS, or MY_PRIVATE_CONFIG should already be defined: |
| 83 | + |
| 84 | +ifeq ($(MY_PRIVATE_CONFIG),y) |
| 85 | + CFLAGS += -DMY_PRIVATE_CONFIG |
| 86 | + $(info Enabled MY_PRIVATE_CONFIG") |
| 87 | +endif |
| 88 | + |
| 89 | +# Check for Windows environment variable: USE_MY_PRIVATE_WINDOWS_CONFIG |
| 90 | +ifeq ($(USE_MY_PRIVATE_WINDOWS_CONFIG),y) |
| 91 | + # This hard coded MY_CONFIG_FILE value must match that in the header file. |
| 92 | + MY_CONFIG_FILE := /workspace/my_private_config.h |
| 93 | + ifeq ($(wildcard $(MY_CONFIG_FILE)),) |
| 94 | + $(info File does not exist: $(MY_CONFIG_FILE)) |
| 95 | + else |
| 96 | + CFLAGS += -DUSE_MY_PRIVATE_WINDOWS_CONFIG |
| 97 | + $(info Using private config file for: Windows) |
| 98 | + endif |
| 99 | +endif |
| 100 | + |
| 101 | +# Check for WSL environment variable: USE_MY_PRIVATE_WSL_CONFIG |
| 102 | +ifeq ($(USE_MY_PRIVATE_WSL_CONFIG),y) |
| 103 | + # This hard coded MY_CONFIG_FILE value must match that in the header file. |
| 104 | + MY_CONFIG_FILE := /mnt/c/workspace/my_private_config.h |
| 105 | + ifeq ($(wildcard $(MY_CONFIG_FILE)),) |
| 106 | + $(info File does not exist: $(MY_CONFIG_FILE)) |
| 107 | + else |
| 108 | + CFLAGS += -DUSE_MY_PRIVATE_WSL_CONFIG |
| 109 | + $(info Using private config file for: WSL) |
| 110 | + endif |
| 111 | +endif |
| 112 | + |
| 113 | +# Check for Linux environment variable: USE_MY_PRIVATE_LINUX_CONFIG |
| 114 | +ifeq ($(USE_MY_PRIVATE_LINUX_CONFIG),y) |
| 115 | + # This hard coded MY_CONFIG_FILE value must match that in the header file. |
| 116 | + MY_CONFIG_FILE := ~/workspace/my_private_config.h |
| 117 | + ifeq ($(wildcard $(MY_CONFIG_FILE)),) |
| 118 | + $(info File does not exist: $(MY_CONFIG_FILE)) |
| 119 | + else |
| 120 | + CFLAGS += -DUSE_MY_PRIVATE_LINUX_CONFIG |
| 121 | + $(info Using private config file for: Linux) |
| 122 | + endif |
| 123 | +endif |
| 124 | + |
| 125 | +# Check for Mac environment variable: USE_MY_PRIVATE_MAC_CONFIG |
| 126 | +ifeq ($(USE_MY_PRIVATE_MAC_CONFIG),y) |
| 127 | + # This hard coded MY_CONFIG_FILE value must match that in the header file. |
| 128 | + MY_CONFIG_FILE := ~/Documents/my_private_config.h |
| 129 | + ifeq ($(wildcard $(MY_CONFIG_FILE)),) |
| 130 | + $(info File does not exist: $(MY_CONFIG_FILE)) |
| 131 | + else |
| 132 | + CFLAGS += -DUSE_MY_PRIVATE_MAC_CONFIG |
| 133 | + $(info Using private config file for: Mac) |
| 134 | + endif |
| 135 | +endif |
| 136 | + |
| 137 | +ifneq ($(OS),MY_PRIVATE_CONFIG) |
| 138 | + CFLAGS += -DMY_PRIVATE_CONFIG="$(MY_PRIVATE_CONFIG)" |
| 139 | +else |
| 140 | + ifeq ($(OS),Linux) |
| 141 | + CFLAGS += -DOS_LINUX |
| 142 | + endif |
| 143 | + ifeq ($(OS),Windows_NT) |
| 144 | + CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_WINDOWS |
| 145 | + endif |
| 146 | + ifeq ($(OS),Darwin) |
| 147 | + CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_APPLE |
| 148 | + endif |
| 149 | + ifneq (,$(findstring MINGW,$(OS))) |
| 150 | + CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_MINGW |
| 151 | + endif |
| 152 | + ifneq (,$(findstring CYGWIN,$(OS))) |
| 153 | + CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_CYGWIN |
| 154 | + endif |
| 155 | +endif |
| 156 | + |
| 157 | +# if there isn't the directory, please disable the line below. |
| 158 | +EXTRA_COMPONENT_DIRS = $(IDF_PATH)/examples/common_components/protocol_examples_common |
13 | 159 |
|
| 160 | +# The Standard Espressif IDF include: |
14 | 161 | include $(IDF_PATH)/make/project.mk |
0 commit comments