mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-06-28 00:58:05 +08:00
Create common.make with LOCAL_CFLAGS and friends
Create a common.make for definitions that are shared between tests/Makefile and programs/Makefile, to facilitate maintenance. Start populating it with CFLAGS/LDFLAGS variables. More to follow in subsequent commits. Keep library/Makefile independent, at least for the time being. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
f5c5ce7789
commit
f3d1ae1f05
@ -1,23 +1,10 @@
|
|||||||
|
|
||||||
# To compile on SunOS: add "-lsocket -lnsl" to LDFLAGS
|
|
||||||
|
|
||||||
CFLAGS ?= -O2
|
|
||||||
WARNING_CFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral
|
|
||||||
WARNING_CXXFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral
|
|
||||||
LDFLAGS ?=
|
|
||||||
|
|
||||||
MBEDTLS_TEST_PATH = ../tests
|
MBEDTLS_TEST_PATH = ../tests
|
||||||
# Support code used by test programs and test builds, excluding TLS-specific
|
# Support code used by test programs and test builds, excluding TLS-specific
|
||||||
# code which is in the src/test_helpers subdirectory.
|
# code which is in the src/test_helpers subdirectory.
|
||||||
MBEDTLS_TEST_OBJS = $(patsubst %.c,%.o,$(wildcard ${MBEDTLS_TEST_PATH}/src/*.c ${MBEDTLS_TEST_PATH}/src/drivers/*.c))
|
MBEDTLS_TEST_OBJS = $(patsubst %.c,%.o,$(wildcard ${MBEDTLS_TEST_PATH}/src/*.c ${MBEDTLS_TEST_PATH}/src/drivers/*.c))
|
||||||
|
|
||||||
LOCAL_CFLAGS = $(WARNING_CFLAGS) -I$(MBEDTLS_TEST_PATH)/include -I../include -D_FILE_OFFSET_BITS=64
|
LOCAL_CFLAGS = $(WARNING_CFLAGS) -I$(MBEDTLS_TEST_PATH)/include -I../include -D_FILE_OFFSET_BITS=64
|
||||||
LOCAL_CXXFLAGS = $(WARNING_CXXFLAGS) -I../include -I../tests/include -D_FILE_OFFSET_BITS=64
|
include ../scripts/common.make
|
||||||
LOCAL_LDFLAGS = ${MBEDTLS_TEST_OBJS} \
|
|
||||||
-L../library \
|
|
||||||
-lmbedtls$(SHARED_SUFFIX) \
|
|
||||||
-lmbedx509$(SHARED_SUFFIX) \
|
|
||||||
-lmbedcrypto$(SHARED_SUFFIX)
|
|
||||||
|
|
||||||
ifeq ($(shell uname -s),Linux)
|
ifeq ($(shell uname -s),Linux)
|
||||||
DLOPEN_LDFLAGS ?= -ldl
|
DLOPEN_LDFLAGS ?= -ldl
|
||||||
|
14
scripts/common.make
Normal file
14
scripts/common.make
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# To compile on SunOS: add "-lsocket -lnsl" to LDFLAGS
|
||||||
|
|
||||||
|
CFLAGS ?= -O2
|
||||||
|
WARNING_CFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral
|
||||||
|
WARNING_CXXFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral
|
||||||
|
LDFLAGS ?=
|
||||||
|
|
||||||
|
LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../tests/include -I../include -D_FILE_OFFSET_BITS=64
|
||||||
|
LOCAL_CXXFLAGS = $(WARNING_CXXFLAGS) -I../include -I../tests/include -D_FILE_OFFSET_BITS=64
|
||||||
|
LOCAL_LDFLAGS = ${MBEDTLS_TEST_OBJS} \
|
||||||
|
-L../library \
|
||||||
|
-lmbedtls$(SHARED_SUFFIX) \
|
||||||
|
-lmbedx509$(SHARED_SUFFIX) \
|
||||||
|
-lmbedcrypto$(SHARED_SUFFIX)
|
@ -1,23 +1,12 @@
|
|||||||
|
include ../scripts/common.make
|
||||||
# To compile on SunOS: add "-lsocket -lnsl" to LDFLAGS
|
|
||||||
|
|
||||||
CFLAGS ?= -O2
|
|
||||||
WARNING_CFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral
|
|
||||||
LDFLAGS ?=
|
|
||||||
|
|
||||||
# Set this to -v to see the details of failing test cases
|
# Set this to -v to see the details of failing test cases
|
||||||
TEST_FLAGS ?= $(if $(filter-out 0 OFF Off off NO No no FALSE False false N n,$(CTEST_OUTPUT_ON_FAILURE)),-v,)
|
TEST_FLAGS ?= $(if $(filter-out 0 OFF Off off NO No no FALSE False false N n,$(CTEST_OUTPUT_ON_FAILURE)),-v,)
|
||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
LOCAL_CFLAGS = $(WARNING_CFLAGS) -I$(MBEDTLS_TEST_PATH)/include -I../include -D_FILE_OFFSET_BITS=64
|
|
||||||
# Also include library headers, for the sake of invasive tests.
|
# Also include library headers, for the sake of invasive tests.
|
||||||
LOCAL_CFLAGS += -I../library
|
LOCAL_CFLAGS += -I../library
|
||||||
LOCAL_LDFLAGS = ${MBEDTLS_TEST_OBJS} \
|
|
||||||
-L../library \
|
|
||||||
-lmbedtls$(SHARED_SUFFIX) \
|
|
||||||
-lmbedx509$(SHARED_SUFFIX) \
|
|
||||||
-lmbedcrypto$(SHARED_SUFFIX)
|
|
||||||
|
|
||||||
include ../3rdparty/Makefile.inc
|
include ../3rdparty/Makefile.inc
|
||||||
LOCAL_CFLAGS+=$(THIRDPARTY_INCLUDES)
|
LOCAL_CFLAGS+=$(THIRDPARTY_INCLUDES)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user