From b44563560b47aaa7bb525a5769e6a07384a4074f Mon Sep 17 00:00:00 2001 From: bhanucbp <141142298+bhanucbp@users.noreply.github.com> Date: Tue, 16 Dec 2025 14:47:42 +0000 Subject: [PATCH] gh #109: Makefile Update - Added LDFLAGS and CFLAGS - Changed CC, and directory paths portable --- Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ce88543..2cdb4e5 100755 --- a/Makefile +++ b/Makefile @@ -56,16 +56,22 @@ SRC_DIRS += $(ASPRINTF_DIR) INC_DIRS = $(LIBFYAML_DIR)/include INC_DIRS += $(ASPRINTF_DIR) +XLDFLAGS += $(LDFLAGS) + # LIBFYAML Requirements XLDFLAGS += -pthread # LIBWEBSOCKETS Requirements -LIBWEBSOCKETS_DIR = $(FRAMEWORK_BUILD_DIR)/libwebsockets +LIBWEBSOCKETS_DIR ?= $(FRAMEWORK_BUILD_DIR)/libwebsockets +ifneq ($(wildcard $(LIBWEBSOCKETS_DIR)),) INC_DIRS += $(LIBWEBSOCKETS_DIR)/include XLDFLAGS += $(LIBWEBSOCKETS_DIR)/lib/libwebsockets.a +else +XLDFLAGS += -lwebsockets +endif # CURL Requirements -CURL_DIR = $(FRAMEWORK_BUILD_DIR)/curl +CURL_DIR ?= $(FRAMEWORK_BUILD_DIR)/curl ifneq ($(wildcard $(CURL_DIR)),) INC_DIRS += $(CURL_DIR)/include XLDFLAGS += $(CURL_DIR)/lib/libcurl.a @@ -107,7 +113,7 @@ endif # Defaults for target linux ifeq ($(TARGET),linux) -CC := gcc -ggdb -o0 -Wall +CC ?= gcc -ggdb -o0 -Wall endif SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c -or -name *.s)