-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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)),) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
| 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
|
@@ -107,7 +113,7 @@ endif | |
|
|
||
| # Defaults for target linux | ||
| ifeq ($(TARGET),linux) | ||
| CC := gcc -ggdb -o0 -Wall | ||
| CC ?= gcc -ggdb -o0 -Wall | ||
bhanucbp marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see above, := was correct as far as I can see. |
||
| endif | ||
|
|
||
| SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c -or -name *.s) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.