blob: bd4b93cb0283562efec54f75689d5ba91d372873 [file] [log] [blame]
David Horstmann4f5adea2024-03-28 16:01:46 +00001MBEDTLS_TEST_PATH:=../../framework
Philippe Antoine03e87d92019-06-04 19:37:52 +02002
Paul Elliott053db692024-01-05 18:11:32 +00003MBEDTLS_PATH := ../..
4include ../../scripts/common.make
Philippe Antoine03e87d92019-06-04 19:37:52 +02005
Paul Elliott053db692024-01-05 18:11:32 +00006DEP=${MBEDLIBS}
Philippe Antoine03e87d92019-06-04 19:37:52 +02007
Philippe Antoine03e87d92019-06-04 19:37:52 +02008ifdef FUZZINGENGINE
9LOCAL_LDFLAGS += -lFuzzingEngine
10endif
11
12# A test application is built for each suites/test_suite_*.data file.
13# Application name is same as .data file's base name and can be
14# constructed by stripping path 'suites/' and extension .data.
15APPS = $(basename $(wildcard fuzz_*.c))
16
17# Construct executable name by adding OS specific suffix $(EXEXT).
18BINARIES := $(addsuffix $(EXEXT),$(APPS))
19
20.SILENT:
21
22.PHONY: all check test clean
23
24all: $(BINARIES)
25
Philippe Antoine03e87d92019-06-04 19:37:52 +020026C_FILES := $(addsuffix .c,$(APPS))
27
28%.o: %.c
29 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c $< -o $@
30
31
32ifdef FUZZINGENGINE
33$(BINARIES): %$(EXEXT): %.o common.o $(DEP)
34 echo " $(CC) common.o $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@"
35 $(CXX) common.o $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
36else
37$(BINARIES): %$(EXEXT): %.o common.o onefile.o $(DEP)
38 echo " $(CC) common.o onefile.o $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@"
39 $(CC) common.o onefile.o $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
40endif
41
42clean:
43ifndef WINDOWS
44 rm -rf $(BINARIES) *.o
45else
Darryl Green9b9a7902019-08-30 14:51:55 +010046 if exist *.o del /Q /F *.o
47 if exist *.exe del /Q /F *.exe
Philippe Antoine03e87d92019-06-04 19:37:52 +020048endif