blob: 828e5184a67b2ba83de69ed0768b2d0325fc2e2e [file] [log] [blame]
Tom Rini0344c602024-10-08 13:56:50 -06001MBEDTLS_TEST_PATH:=../../tests
2
3MBEDTLS_PATH := ../..
4include ../../scripts/common.make
5
6DEP=${MBEDLIBS}
7
8ifdef 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
26C_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
46 if exist *.o del /Q /F *.o
47 if exist *.exe del /Q /F *.exe
48endif