Tom Rini | 0344c60 | 2024-10-08 13:56:50 -0600 | [diff] [blame^] | 1 | MBEDTLS_TEST_PATH:=../../tests |
| 2 | |
| 3 | MBEDTLS_PATH := ../.. |
| 4 | include ../../scripts/common.make |
| 5 | |
| 6 | DEP=${MBEDLIBS} |
| 7 | |
| 8 | ifdef FUZZINGENGINE |
| 9 | LOCAL_LDFLAGS += -lFuzzingEngine |
| 10 | endif |
| 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. |
| 15 | APPS = $(basename $(wildcard fuzz_*.c)) |
| 16 | |
| 17 | # Construct executable name by adding OS specific suffix $(EXEXT). |
| 18 | BINARIES := $(addsuffix $(EXEXT),$(APPS)) |
| 19 | |
| 20 | .SILENT: |
| 21 | |
| 22 | .PHONY: all check test clean |
| 23 | |
| 24 | all: $(BINARIES) |
| 25 | |
| 26 | C_FILES := $(addsuffix .c,$(APPS)) |
| 27 | |
| 28 | %.o: %.c |
| 29 | $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c $< -o $@ |
| 30 | |
| 31 | |
| 32 | ifdef 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 $@ |
| 36 | else |
| 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 $@ |
| 40 | endif |
| 41 | |
| 42 | clean: |
| 43 | ifndef WINDOWS |
| 44 | rm -rf $(BINARIES) *.o |
| 45 | else |
| 46 | if exist *.o del /Q /F *.o |
| 47 | if exist *.exe del /Q /F *.exe |
| 48 | endif |