blob: afe80b7d58bdef42897ffccc186140511d3b4f16 [file] [log] [blame]
Paul Elliott053db692024-01-05 18:11:32 +00001MBEDTLS_TEST_PATH:=../../tests
Philippe Antoine03e87d92019-06-04 19:37:52 +02002
Gilles Peskine9ec14f62022-11-29 17:23:19 +01003LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../../tests/include -I../../include -D_FILE_OFFSET_BITS=64
Paul Elliott053db692024-01-05 18:11:32 +00004MBEDTLS_PATH := ../..
5include ../../scripts/common.make
Philippe Antoine03e87d92019-06-04 19:37:52 +02006
Gilles Peskineaae57bf2020-03-09 17:30:32 +01007LOCAL_CFLAGS += $(patsubst -I../%,-I../../%,$(THIRDPARTY_INCLUDES))
Philippe Antoine03e87d92019-06-04 19:37:52 +02008
Paul Elliott053db692024-01-05 18:11:32 +00009DEP=${MBEDLIBS}
Philippe Antoine03e87d92019-06-04 19:37:52 +020010
Philippe Antoine03e87d92019-06-04 19:37:52 +020011ifdef FUZZINGENGINE
12LOCAL_LDFLAGS += -lFuzzingEngine
13endif
14
15# A test application is built for each suites/test_suite_*.data file.
16# Application name is same as .data file's base name and can be
17# constructed by stripping path 'suites/' and extension .data.
18APPS = $(basename $(wildcard fuzz_*.c))
19
20# Construct executable name by adding OS specific suffix $(EXEXT).
21BINARIES := $(addsuffix $(EXEXT),$(APPS))
22
23.SILENT:
24
25.PHONY: all check test clean
26
27all: $(BINARIES)
28
Philippe Antoine03e87d92019-06-04 19:37:52 +020029C_FILES := $(addsuffix .c,$(APPS))
30
31%.o: %.c
32 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c $< -o $@
33
34
35ifdef FUZZINGENGINE
36$(BINARIES): %$(EXEXT): %.o common.o $(DEP)
37 echo " $(CC) common.o $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@"
38 $(CXX) common.o $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
39else
40$(BINARIES): %$(EXEXT): %.o common.o onefile.o $(DEP)
41 echo " $(CC) common.o onefile.o $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@"
42 $(CC) common.o onefile.o $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
43endif
44
45clean:
46ifndef WINDOWS
47 rm -rf $(BINARIES) *.o
48else
Darryl Green9b9a7902019-08-30 14:51:55 +010049 if exist *.o del /Q /F *.o
50 if exist *.exe del /Q /F *.exe
Philippe Antoine03e87d92019-06-04 19:37:52 +020051endif