1XEN_ROOT=$(CURDIR)/../../..
2include $(XEN_ROOT)/tools/Rules.mk
3
4TARGET := test_vpci
5
6.PHONY: all
7all: $(TARGET)
8
9.PHONY: run
10run: $(TARGET)
11	./$(TARGET)
12
13$(TARGET): vpci.c vpci.h list.h main.c emul.h
14	$(HOSTCC) -g -o $@ vpci.c main.c
15
16.PHONY: clean
17clean:
18	rm -rf $(TARGET) *.o *~ vpci.h vpci.c list.h
19
20.PHONY: distclean
21distclean: clean
22
23.PHONY: install
24install:
25
26vpci.c: $(XEN_ROOT)/xen/drivers/vpci/vpci.c
27	# Remove includes and add the test harness header
28	sed -e '/#include/d' -e '1s/^/#include "emul.h"/' <$< >$@
29
30list.h: $(XEN_ROOT)/xen/include/xen/list.h
31vpci.h: $(XEN_ROOT)/xen/include/xen/vpci.h
32list.h vpci.h:
33	sed -e '/#include/d' <$< >$@
34