2020-06-05 16:00:22 +02:00
|
|
|
MBEDTLS_TEST_PATH:=../../tests/src
|
2020-07-16 20:26:18 +02:00
|
|
|
MBEDTLS_TEST_OBJS:=$(patsubst %.c,%.o,$(wildcard ${MBEDTLS_TEST_PATH}/*.c ${MBEDTLS_TEST_PATH}/drivers/*.c))
|
2019-06-04 19:37:52 +02:00
|
|
|
|
2020-06-05 16:00:22 +02:00
|
|
|
LOCAL_CFLAGS = -I../../tests/include -I../../include -D_FILE_OFFSET_BITS=64
|
|
|
|
LOCAL_LDFLAGS = ${MBEDTLS_TEST_OBJS} \
|
|
|
|
-L../../library \
|
2019-06-04 19:37:52 +02:00
|
|
|
-lmbedtls$(SHARED_SUFFIX) \
|
|
|
|
-lmbedx509$(SHARED_SUFFIX) \
|
|
|
|
-lmbedcrypto$(SHARED_SUFFIX)
|
|
|
|
|
2020-03-09 17:30:32 +01:00
|
|
|
LOCAL_CFLAGS += $(patsubst -I../%,-I../../%,$(THIRDPARTY_INCLUDES))
|
2019-06-04 19:37:52 +02:00
|
|
|
|
|
|
|
ifndef SHARED
|
2020-03-09 17:30:32 +01:00
|
|
|
DEP=../../library/libmbedcrypto.a ../../library/libmbedx509.a ../../library/libmbedtls.a
|
2019-06-04 19:37:52 +02:00
|
|
|
else
|
2020-03-09 17:30:32 +01:00
|
|
|
DEP=../../library/libmbedcrypto.$(DLEXT) ../../library/libmbedx509.$(DLEXT) ../../library/libmbedtls.$(DLEXT)
|
2019-06-04 19:37:52 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
DLEXT ?= so
|
|
|
|
EXEXT=
|
|
|
|
SHARED_SUFFIX=
|
|
|
|
# python2 for POSIX since FreeBSD has only python2 as default.
|
|
|
|
PYTHON ?= python2
|
|
|
|
|
|
|
|
ifdef FUZZINGENGINE
|
|
|
|
LOCAL_LDFLAGS += -lFuzzingEngine
|
|
|
|
endif
|
|
|
|
|
|
|
|
# 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
|
|
|
|
# constructed by stripping path 'suites/' and extension .data.
|
|
|
|
APPS = $(basename $(wildcard fuzz_*.c))
|
|
|
|
|
|
|
|
# Construct executable name by adding OS specific suffix $(EXEXT).
|
|
|
|
BINARIES := $(addsuffix $(EXEXT),$(APPS))
|
|
|
|
|
|
|
|
.SILENT:
|
|
|
|
|
|
|
|
.PHONY: all check test clean
|
|
|
|
|
|
|
|
all: $(BINARIES)
|
|
|
|
|
|
|
|
$(DEP):
|
|
|
|
$(MAKE) -C ../../library
|
|
|
|
|
|
|
|
C_FILES := $(addsuffix .c,$(APPS))
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
|
|
|
|
ifdef FUZZINGENGINE
|
|
|
|
$(BINARIES): %$(EXEXT): %.o common.o $(DEP)
|
|
|
|
echo " $(CC) common.o $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@"
|
|
|
|
$(CXX) common.o $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
|
|
|
|
else
|
|
|
|
$(BINARIES): %$(EXEXT): %.o common.o onefile.o $(DEP)
|
|
|
|
echo " $(CC) common.o onefile.o $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@"
|
|
|
|
$(CC) common.o onefile.o $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
|
|
|
|
endif
|
|
|
|
|
|
|
|
clean:
|
|
|
|
ifndef WINDOWS
|
|
|
|
rm -rf $(BINARIES) *.o
|
|
|
|
else
|
2019-08-30 15:51:55 +02:00
|
|
|
if exist *.o del /Q /F *.o
|
|
|
|
if exist *.exe del /Q /F *.exe
|
2019-06-04 19:37:52 +02:00
|
|
|
endif
|