|
| 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-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 |
4 | 20 | # |
5 | 21 |
|
| 22 | +# |
| 23 | +# This is a project Makefile. |
| 24 | +# It is assumed the directory this Makefile resides in is a |
| 25 | +# project subdirectory containing an entire project. |
| 26 | +# |
| 27 | +# Optional private config headers. Define environment variables |
| 28 | +# to include various default header files that are typically |
| 29 | +# not in a git path, and thus excluded from being checked in. |
| 30 | +# |
| 31 | +# Environment Variable Name | Header file name included |
| 32 | +# ---------------------------------- | --------------------------------------- |
| 33 | +# MY_PRIVATE_CONFIG (files detected / selected in header) |
| 34 | +# USE_MY_PRIVATE_WSL_CONFIG /mnt/c/workspace/my_private_config.h |
| 35 | +# USE_MY_PRIVATE_MAC_CONFIG ~/Documents/my_private_config.h |
| 36 | +# USE_MY_PRIVATE_LINUX_CONFIG ~/workspace/my_private_config.h |
| 37 | +# USE_MY_PRIVATE_WINDOWS_CONFIG /workspace/my_private_config.h |
| 38 | +# |
| 39 | +# |
6 | 40 | PROJECT_NAME := wolfssl_client |
7 | 41 |
|
| 42 | +MY_PRIVATE_CONFIG ?= n |
| 43 | +USE_MY_PRIVATE_WSL_CONFIG ?= n |
| 44 | +USE_MY_PRIVATE_MAC_CONFIG ?= n |
| 45 | +USE_MY_PRIVATE_LINUX_CONFIG ?= n |
| 46 | +USE_MY_PRIVATE_WINDOWS_CONFIG ?= n |
| 47 | + |
| 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 | + |
| 54 | +ifeq ($(MY_PRIVATE_CONFIG),y) |
| 55 | + CFLAGS += -DMY_PRIVATE_CONFIG |
| 56 | + $(info Enabled MY_PRIVATE_CONFIG") |
| 57 | +endif |
| 58 | + |
| 59 | +# Check for Windows environment variable: USE_MY_PRIVATE_WINDOWS_CONFIG |
| 60 | +ifeq ($(USE_MY_PRIVATE_WINDOWS_CONFIG),y) |
| 61 | + # This hard coded MY_CONFIG_FILE value must match that in the header file. |
| 62 | + MY_CONFIG_FILE := /workspace/my_private_config.h |
| 63 | + ifeq ($(wildcard $(MY_CONFIG_FILE)),) |
| 64 | + $(info File does not exist: $(MY_CONFIG_FILE)) |
| 65 | + else |
| 66 | + CFLAGS += -DUSE_MY_PRIVATE_WINDOWS_CONFIG |
| 67 | + $(info Using private config file for: Windows) |
| 68 | + endif |
| 69 | +endif |
| 70 | + |
| 71 | +# Check for WSL environment variable: USE_MY_PRIVATE_WSL_CONFIG |
| 72 | +ifeq ($(USE_MY_PRIVATE_WSL_CONFIG),y) |
| 73 | + # This hard coded MY_CONFIG_FILE value must match that in the header file. |
| 74 | + MY_CONFIG_FILE := /mnt/c/workspace/my_private_config.h |
| 75 | + ifeq ($(wildcard $(MY_CONFIG_FILE)),) |
| 76 | + $(info File does not exist: $(MY_CONFIG_FILE)) |
| 77 | + else |
| 78 | + CFLAGS += -DUSE_MY_PRIVATE_WSL_CONFIG |
| 79 | + $(info Using private config file for: WSL) |
| 80 | + endif |
| 81 | +endif |
| 82 | + |
| 83 | +# Check for Linux environment variable: USE_MY_PRIVATE_LINUX_CONFIG |
| 84 | +ifeq ($(USE_MY_PRIVATE_LINUX_CONFIG),y) |
| 85 | + # This hard coded MY_CONFIG_FILE value must match that in the header file. |
| 86 | + MY_CONFIG_FILE := ~/workspace/my_private_config.h |
| 87 | + ifeq ($(wildcard $(MY_CONFIG_FILE)),) |
| 88 | + $(info File does not exist: $(MY_CONFIG_FILE)) |
| 89 | + else |
| 90 | + CFLAGS += -DUSE_MY_PRIVATE_LINUX_CONFIG |
| 91 | + $(info Using private config file for: Linux) |
| 92 | + endif |
| 93 | +endif |
| 94 | + |
| 95 | +# Check for Mac environment variable: USE_MY_PRIVATE_MAC_CONFIG |
| 96 | +ifeq ($(USE_MY_PRIVATE_MAC_CONFIG),y) |
| 97 | + # This hard coded MY_CONFIG_FILE value must match that in the header file. |
| 98 | + MY_CONFIG_FILE := ~/Documents/my_private_config.h |
| 99 | + ifeq ($(wildcard $(MY_CONFIG_FILE)),) |
| 100 | + $(info File does not exist: $(MY_CONFIG_FILE)) |
| 101 | + else |
| 102 | + CFLAGS += -DUSE_MY_PRIVATE_MAC_CONFIG |
| 103 | + $(info Using private config file for: Mac) |
| 104 | + endif |
| 105 | +endif |
| 106 | + |
| 107 | +ifneq ($(OS),MY_PRIVATE_CONFIG) |
| 108 | + CFLAGS += -DMY_PRIVATE_CONFIG="$(MY_PRIVATE_CONFIG)" |
| 109 | +else |
| 110 | + ifeq ($(OS),Linux) |
| 111 | + CFLAGS += -DOS_LINUX |
| 112 | + endif |
| 113 | + ifeq ($(OS),Windows_NT) |
| 114 | + CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_WINDOWS |
| 115 | + endif |
| 116 | + ifeq ($(OS),Darwin) |
| 117 | + CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_APPLE |
| 118 | + endif |
| 119 | + ifneq (,$(findstring MINGW,$(OS))) |
| 120 | + CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_MINGW |
| 121 | + endif |
| 122 | + ifneq (,$(findstring CYGWIN,$(OS))) |
| 123 | + CFLAGS += -DWOLFSSL_MAKE_SYSTEM_NAME_CYGWIN |
| 124 | + endif |
| 125 | +endif |
| 126 | + |
| 127 | +# It is essential that the build process sees the WOLFSSL_USER_SETTINGS |
8 | 128 | CFLAGS += -DWOLFSSL_USER_SETTINGS |
9 | | -# if there isn't the directory, please disable the line below. |
| 129 | + |
| 130 | +# if directory not available, please disable the line below. |
10 | 131 | EXTRA_COMPONENT_DIRS = $(IDF_PATH)/examples/common_components/protocol_examples_common |
11 | 132 |
|
| 133 | +# The Standard Espressif IDF include: |
12 | 134 | include $(IDF_PATH)/make/project.mk |
0 commit comments