I want to add a header my_header.h in xen/include/public/ and use it in xen's tool; so this my_header.h should also be linked to tools/include/xen/
However, it does NOT work. When I recompile, Make tools
create the soft links for all of the old files (except my_header.h) under xen/include/public.
My question is:
Do I need to change anything in tools/include/Makefile?
The tools/include/Makefile is as follows:
XEN_ROOT = $(CURDIR)/../..
include $(XEN_ROOT)/tools/Rules.mk
.PHONY: all
all: xen-foreign xen/.dir
.PHONY: xen-foreign
xen-foreign:
$(MAKE) -C xen-foreign
xen/.dir:
@rm -rf xen
mkdir -p xen/libelf
ln -sf $(XEN_ROOT)/xen/include/public/COPYING xen
ln -sf $(XEN_ROOT)/xen/include/public/my_header.h xen
ln -sf $(wildcard $(XEN_ROOT)/xen/include/public/*.h) xen
ln -sf $(addprefix $(XEN_ROOT)/xen/include/public/,arch-x86 hvm io xsm) xen
ln -sf ../xen-sys/$(XEN_OS) xen/sys
ln -sf $(addprefix $(XEN_ROOT)/xen/include/xen/,libelf.h elfstructs.h) xen/libelf/
ln -s ../xen-foreign xen/foreign
touch $@
.PHONY: install
install: all
$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xen/arch-x86
$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xen/arch-x86/hvm
$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xen/foreign
$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xen/hvm
$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xen/io
$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xen/sys
$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xen/xsm
$(INSTALL_DATA) xen/COPYING $(DESTDIR)$(INCLUDEDIR)/xen
$(INSTALL_DATA) xen/*.h $(DESTDIR)$(INCLUDEDIR)/xen
$(INSTALL_DATA) xen/arch-x86/*.h $(DESTDIR)$(INCLUDEDIR)/xen/arch-x86
$(INSTALL_DATA) xen/arch-x86/hvm/*.h $(DESTDIR)$(INCLUDEDIR)/xen/arch-x86/hvm
$(INSTALL_DATA) xen/foreign/*.h $(DESTDIR)$(INCLUDEDIR)/xen/foreign
$(INSTALL_DATA) xen/hvm/*.h $(DESTDIR)$(INCLUDEDIR)/xen/hvm
$(INSTALL_DATA) xen/io/*.h $(DESTDIR)$(INCLUDEDIR)/xen/io
$(INSTALL_DATA) xen/sys/*.h $(DESTDIR)$(INCLUDEDIR)/xen/sys
$(INSTALL_DATA) xen/xsm/*.h $(DESTDIR)$(INCLUDEDIR)/xen/xsm
.PHONY: clean
clean:
rm -rf xen
$(MAKE) -C xen-foreign clean
In my understanding, it should create the link for my_header.h, but I don't know why it does NOT.
Did you delete the xen/.dir
file? That file has no prerequisites, which means that if it exists make assumes that it's up to date. So changing the rule won't have any effect, unless you also delete that file.