mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-03 23:43:40 +00:00
Allow programs/fuzz to be linked against pthread
Use the same mechanisms used to link other programs against pthread with make, i.e. include common.make, and remove common code from programs/ fuzz/Makefile Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
parent
7ed1cf57ba
commit
053db696b3
@ -1,40 +1,17 @@
|
|||||||
MBEDTLS_TEST_PATH:=../../tests/src
|
MBEDTLS_TEST_PATH:=../../tests
|
||||||
MBEDTLS_TEST_OBJS:=$(patsubst %.c,%.o,$(wildcard ${MBEDTLS_TEST_PATH}/*.c ${MBEDTLS_TEST_PATH}/drivers/*.c))
|
|
||||||
|
|
||||||
CFLAGS ?= -O2
|
|
||||||
WARNING_CFLAGS ?= -Wall -Wextra
|
|
||||||
LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../../tests/include -I../../include -D_FILE_OFFSET_BITS=64
|
LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../../tests/include -I../../include -D_FILE_OFFSET_BITS=64
|
||||||
LOCAL_LDFLAGS = ${MBEDTLS_TEST_OBJS} \
|
MBEDTLS_PATH := ../..
|
||||||
-L../../library \
|
include ../../scripts/common.make
|
||||||
-lmbedtls$(SHARED_SUFFIX) \
|
|
||||||
-lmbedx509$(SHARED_SUFFIX) \
|
|
||||||
-lmbedcrypto$(SHARED_SUFFIX)
|
|
||||||
|
|
||||||
LOCAL_CFLAGS += $(patsubst -I../%,-I../../%,$(THIRDPARTY_INCLUDES))
|
LOCAL_CFLAGS += $(patsubst -I../%,-I../../%,$(THIRDPARTY_INCLUDES))
|
||||||
|
|
||||||
ifndef SHARED
|
DEP=${MBEDLIBS}
|
||||||
DEP=../../library/libmbedcrypto.a ../../library/libmbedx509.a ../../library/libmbedtls.a
|
|
||||||
else
|
|
||||||
DEP=../../library/libmbedcrypto.$(DLEXT) ../../library/libmbedx509.$(DLEXT) ../../library/libmbedtls.$(DLEXT)
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
DLEXT ?= so
|
|
||||||
EXEXT=
|
|
||||||
SHARED_SUFFIX=
|
|
||||||
|
|
||||||
ifdef FUZZINGENGINE
|
ifdef FUZZINGENGINE
|
||||||
LOCAL_LDFLAGS += -lFuzzingEngine
|
LOCAL_LDFLAGS += -lFuzzingEngine
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef WINDOWS_BUILD
|
|
||||||
LOCAL_LDFLAGS += -lbcrypt
|
|
||||||
else
|
|
||||||
ifeq ($(THREADING),pthread)
|
|
||||||
LOCAL_LDFLAGS += -lpthread
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
# A test application is built for each suites/test_suite_*.data file.
|
# A test application is built for each suites/test_suite_*.data file.
|
||||||
# Application name is same as .data file's base name and can be
|
# Application name is same as .data file's base name and can be
|
||||||
# constructed by stripping path 'suites/' and extension .data.
|
# constructed by stripping path 'suites/' and extension .data.
|
||||||
@ -49,9 +26,6 @@ BINARIES := $(addsuffix $(EXEXT),$(APPS))
|
|||||||
|
|
||||||
all: $(BINARIES)
|
all: $(BINARIES)
|
||||||
|
|
||||||
$(DEP):
|
|
||||||
$(MAKE) -C ../../library
|
|
||||||
|
|
||||||
C_FILES := $(addsuffix .c,$(APPS))
|
C_FILES := $(addsuffix .c,$(APPS))
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
|
Loading…
Reference in New Issue
Block a user