Makefile: Allow use of CC & LDFLAGS defined by build system.
When building within Yocto projects such as LuneOS, we want to use CC & LDFLAGS provided by the build toolchain. Signed-off-by: Herman van Hazendonk github.com@herrie.org Signed-off-by: Christophe Chapuis chris.chapuis@gmail.com
This commit is contained in:
9
Makefile
9
Makefile
@@ -63,14 +63,17 @@ RELEASE_BUILD_DIR = $(BUILD_DIR)/release
|
|||||||
# Tools and flags
|
# Tools and flags
|
||||||
#
|
#
|
||||||
|
|
||||||
|
ifndef CC
|
||||||
CC = $(CROSS_COMPILE)gcc
|
CC = $(CROSS_COMPILE)gcc
|
||||||
|
endif
|
||||||
|
|
||||||
LD = $(CC)
|
LD = $(CC)
|
||||||
WARNINGS = -Wall -Wno-unused-parameter -Wno-multichar
|
WARNINGS = -Wall -Wno-unused-parameter -Wno-multichar
|
||||||
INCLUDES = -I$(INCLUDE_DIR) -I$(GEN_DIR)
|
INCLUDES = -I$(INCLUDE_DIR) -I$(GEN_DIR)
|
||||||
BASE_FLAGS = -fPIC $(CFLAGS)
|
BASE_FLAGS = -fPIC $(CFLAGS)
|
||||||
FULL_CFLAGS = $(BASE_FLAGS) $(DEFINES) $(WARNINGS) $(INCLUDES) -MMD -MP \
|
FULL_CFLAGS = $(BASE_FLAGS) $(DEFINES) $(WARNINGS) $(INCLUDES) -MMD -MP \
|
||||||
$(shell pkg-config --cflags $(PKGS))
|
$(shell pkg-config --cflags $(PKGS))
|
||||||
LDFLAGS = $(BASE_FLAGS) -shared -Wl,-soname -Wl,$(LIB_SONAME) \
|
FULL_LDFLAGS = $(BASE_FLAGS) $(LDFLAGS) -shared -Wl,-soname -Wl,$(LIB_SONAME)
|
||||||
$(shell pkg-config --libs $(PKGS))
|
$(shell pkg-config --libs $(PKGS))
|
||||||
DEBUG_FLAGS = -g
|
DEBUG_FLAGS = -g
|
||||||
RELEASE_FLAGS =
|
RELEASE_FLAGS =
|
||||||
@@ -85,8 +88,8 @@ endif
|
|||||||
|
|
||||||
DEBUG_CFLAGS = $(FULL_CFLAGS) $(DEBUG_FLAGS) -DDEBUG
|
DEBUG_CFLAGS = $(FULL_CFLAGS) $(DEBUG_FLAGS) -DDEBUG
|
||||||
RELEASE_CFLAGS = $(FULL_CFLAGS) $(RELEASE_FLAGS) -O2
|
RELEASE_CFLAGS = $(FULL_CFLAGS) $(RELEASE_FLAGS) -O2
|
||||||
DEBUG_LDFLAGS = $(LDFLAGS) $(DEBUG_FLAGS)
|
DEBUG_LDFLAGS = $(FULL_LDFLAGS) $(DEBUG_FLAGS)
|
||||||
RELEASE_LDFLAGS = $(LDFLAGS) $(RELEASE_FLAGS)
|
RELEASE_LDFLAGS = $(FULL_LDFLAGS) $(RELEASE_FLAGS)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Files
|
# Files
|
||||||
|
|||||||
Reference in New Issue
Block a user