-
Notifications
You must be signed in to change notification settings - Fork 0
gh #109: Makefile Update #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
gh #109: Makefile Update #110
Conversation
bhanucbp
commented
Dec 16, 2025
- Added LDFLAGS and CFLAGS
- Changed CC, and directory paths portable
- Added LDFLAGS and CFLAGS - Changed CC, and directory paths portable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the Makefile to improve portability and flexibility by making build configuration more customizable. The changes allow users to override default compiler settings and library paths through environment variables, while also adding support for system-installed libraries as fallbacks.
Key changes:
- Made CC, CURL_DIR, and LIBWEBSOCKETS_DIR overridable via environment variables
- Added LDFLAGS support for custom linker flags
- Implemented fallback to system-installed libwebsockets when local build is unavailable
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
release script results: |
kanjoe24
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ulrond
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to check this
| # LIBWEBSOCKETS Requirements | ||
| LIBWEBSOCKETS_DIR = $(FRAMEWORK_BUILD_DIR)/libwebsockets | ||
| LIBWEBSOCKETS_DIR ?= $(FRAMEWORK_BUILD_DIR)/libwebsockets | ||
| ifneq ($(wildcard $(LIBWEBSOCKETS_DIR)),) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you comment what is the expectation here... I don't think this will work for the requirements for the ticket..
Your still setting LIBWEBSOCKETS_DIR ?= will be set it if it doesn't exist, you'd need something like a EXTERNAL_WEBSOCKETS = TRUE flag of something surely?
| # Defaults for target linux | ||
| ifeq ($(TARGET),linux) | ||
| CC := gcc -ggdb -o0 -Wall | ||
| CC ?= gcc -ggdb -o0 -Wall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linux is a hardcoded target ,you can still override any of these variables by passing it to the makefile
make TARGET=linux CC=ABC
will still work with CC:= gcc -ggdb -o0 -Wall
I don't see the need for this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above, := was correct as far as I can see.
| CURL_DIR ?= $(FRAMEWORK_BUILD_DIR)/curl | ||
| ifneq ($(wildcard $(CURL_DIR)),) | ||
| INC_DIRS += $(CURL_DIR)/include | ||
| XLDFLAGS += $(CURL_DIR)/lib/libcurl.a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah don't think these changes are correct, := is more correct.
One subtle edge case (empty value)
If the caller does make CURL_DIR= (explicitly empty), ?= will not set the default (because it’s still “defined”). If you want “empty means use default”, do this instead:
CURL_DIR := $(or $(CURL_DIR),$(FRAMEWORK_BUILD_DIR)/curl)
ifneq ($(wildcard $(CURL_DIR)),)
INC_DIRS += $(CURL_DIR)/include
XLDFLAGS += $(CURL_DIR)/lib/libcurl.a
endifThat gives you: env/CLI wins if non-empty; otherwise fallback.