mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
$(LIBEXEC_BIN) is a dumping ground of many things. Separate the "clearly tests" from everything else so we can clean up how they're run in CI. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Anthony PERARD <anthony.perard@vates.tech> Acked-by: Stefano Stabellini <sstabellini@kernel.org> Reviewed-by: Denis Mukhin <dmukhin@ford.com>
51 lines
1.0 KiB
Makefile
51 lines
1.0 KiB
Makefile
XEN_ROOT=$(CURDIR)/../../..
|
|
include $(XEN_ROOT)/tools/Rules.mk
|
|
|
|
TARGET := test-rangeset
|
|
|
|
.PHONY: all
|
|
all: $(TARGET)
|
|
|
|
.PHONY: run
|
|
run: $(TARGET)
|
|
./$<
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
$(RM) -- *.o $(TARGET) $(DEPS_RM) list.h rangeset.h rangeset.c
|
|
|
|
.PHONY: distclean
|
|
distclean: clean
|
|
$(RM) -- *~
|
|
|
|
.PHONY: install
|
|
install: all
|
|
$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC)/tests
|
|
$(INSTALL_PROG) $(TARGET) $(DESTDIR)$(LIBEXEC)/tests
|
|
|
|
.PHONY: uninstall
|
|
uninstall:
|
|
$(RM) -- $(addprefix $(DESTDIR)$(LIBEXEC)/tests/,$(TARGET))
|
|
|
|
list.h: $(XEN_ROOT)/xen/include/xen/list.h
|
|
rangeset.h: $(XEN_ROOT)/xen/include/xen/rangeset.h
|
|
list.h rangeset.h:
|
|
sed -e '/#include/d' <$< >$@
|
|
|
|
rangeset.c: $(XEN_ROOT)/xen/common/rangeset.c
|
|
# Remove includes and add the test harness header
|
|
sed -e '/#include/d' -e '1s/^/#include "harness.h"/' <$< >$@
|
|
|
|
CFLAGS += -D__XEN_TOOLS__
|
|
CFLAGS += $(APPEND_CFLAGS)
|
|
CFLAGS += $(CFLAGS_xeninclude)
|
|
|
|
LDFLAGS += $(APPEND_LDFLAGS)
|
|
|
|
test-rangeset.o rangeset.o: list.h rangeset.h
|
|
|
|
test-rangeset: rangeset.o test-rangeset.o
|
|
$(CC) $^ -o $@ $(LDFLAGS)
|
|
|
|
-include $(DEPS_INCLUDE)
|