Files
Jan Beulich 9cf4084f4e tools/fuzz: use vpath uniformly for access to hypervisor library code
It's not quite clear why for libelf and the emulator we use symlink-ing,
while elsewhere we use vpath. Do so for these two as well, thus also
eliminating the need for custom -iquote options and custom cleaning.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2025-12-18 09:57:42 +01:00

40 lines
785 B
Makefile

XEN_ROOT = $(CURDIR)/../../..
include $(XEN_ROOT)/tools/Rules.mk
vpath %.c $(XEN_ROOT)/xen/common/libelf
LIBELF_OBJS := libelf-tools.o libelf-loader.o libelf-dominfo.o
$(LIBELF_OBJS): CFLAGS += -Wno-pointer-sign
$(LIBELF_OBJS): CFLAGS += -DFUZZ_NO_LIBXC $(CFLAGS_xeninclude)
libelf-fuzzer.o: CFLAGS += $(CFLAGS_xeninclude)
libelf.a: libelf-fuzzer.o $(LIBELF_OBJS)
$(AR) rc $@ $^
.PHONY: libelf-fuzzer-all
libelf-fuzzer-all: libelf.a libelf-fuzzer.o
afl-libelf-fuzzer: afl-libelf-fuzzer.o libelf-fuzzer.o $(LIBELF_OBJS)
$(CC) $(CFLAGS) $^ -o $@
# Common targets
.PHONY: all
all: libelf-fuzzer-all
.PHONY: distclean
distclean: clean
.PHONY: clean
clean:
rm -f *.o .*.d *.a *-libelf-fuzzer
.PHONY: install
install: all
.PHONY: uninstall
.PHONY: afl
afl: afl-libelf-fuzzer