Paul Elliott | 053db69 | 2024-01-05 18:11:32 +0000 | [diff] [blame] | 1 | MBEDTLS_TEST_PATH:=../../tests |
Philippe Antoine | 03e87d9 | 2019-06-04 19:37:52 +0200 | [diff] [blame] | 2 | |
Paul Elliott | 053db69 | 2024-01-05 18:11:32 +0000 | [diff] [blame] | 3 | MBEDTLS_PATH := ../.. |
| 4 | include ../../scripts/common.make |
Philippe Antoine | 03e87d9 | 2019-06-04 19:37:52 +0200 | [diff] [blame] | 5 | |
Paul Elliott | 053db69 | 2024-01-05 18:11:32 +0000 | [diff] [blame] | 6 | DEP=${MBEDLIBS} |
Philippe Antoine | 03e87d9 | 2019-06-04 19:37:52 +0200 | [diff] [blame] | 7 | |
Philippe Antoine | 03e87d9 | 2019-06-04 19:37:52 +0200 | [diff] [blame] | 8 | ifdef FUZZINGENGINE |
| 9 | LOCAL_LDFLAGS += -lFuzzingEngine |
| 10 | endif |
| 11 | |
Ronald Cron | 467775e | 2024-07-12 19:37:00 +0200 | [diff] [blame] | 12 | # A test application is built for each fuzz_*.c file. |
Philippe Antoine | 03e87d9 | 2019-06-04 19:37:52 +0200 | [diff] [blame] | 13 | APPS = $(basename $(wildcard fuzz_*.c)) |
| 14 | |
| 15 | # Construct executable name by adding OS specific suffix $(EXEXT). |
| 16 | BINARIES := $(addsuffix $(EXEXT),$(APPS)) |
| 17 | |
| 18 | .SILENT: |
| 19 | |
| 20 | .PHONY: all check test clean |
| 21 | |
| 22 | all: $(BINARIES) |
| 23 | |
Philippe Antoine | 03e87d9 | 2019-06-04 19:37:52 +0200 | [diff] [blame] | 24 | C_FILES := $(addsuffix .c,$(APPS)) |
| 25 | |
| 26 | %.o: %.c |
| 27 | $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c $< -o $@ |
| 28 | |
| 29 | |
| 30 | ifdef FUZZINGENGINE |
| 31 | $(BINARIES): %$(EXEXT): %.o common.o $(DEP) |
| 32 | echo " $(CC) common.o $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@" |
| 33 | $(CXX) common.o $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ |
| 34 | else |
| 35 | $(BINARIES): %$(EXEXT): %.o common.o onefile.o $(DEP) |
| 36 | echo " $(CC) common.o onefile.o $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@" |
| 37 | $(CC) common.o onefile.o $< $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ |
| 38 | endif |
| 39 | |
| 40 | clean: |
| 41 | ifndef WINDOWS |
| 42 | rm -rf $(BINARIES) *.o |
| 43 | else |
Darryl Green | 9b9a790 | 2019-08-30 14:51:55 +0100 | [diff] [blame] | 44 | if exist *.o del /Q /F *.o |
| 45 | if exist *.exe del /Q /F *.exe |
Philippe Antoine | 03e87d9 | 2019-06-04 19:37:52 +0200 | [diff] [blame] | 46 | endif |