mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
If you use -MMD -MF then the correct .o filename is written to the .*.d file as the compiler driver arranges everything. This was done in 19010:275abe1c5d24 for the hypervisor. In this patch we do the same elsewhere in the xen-unstable tree, particularly tools/. Specifically: * Change tools/Rules.mk to add -MMD -MF ... to CFLAGS and set DEPS. * Remove -Wp,-MD... from every other Makefile * Remove setting of DEPS from every other Makefile * Ensure that every Makefile says -include $(DEPS) * Ensure that every Makefile's clean target removes $(DEPS) Some Makefiles were already halfway there, but often for a different variable name eg PROG_DEP. The variable name is now standardised in Rules.mk as DEPS. I have done a test build with this change, on Debian etch. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
44 lines
1.2 KiB
Makefile
44 lines
1.2 KiB
Makefile
XEN_ROOT = ../../..
|
|
include $(XEN_ROOT)/tools/Rules.mk
|
|
|
|
MAJOR = 1.0
|
|
MINOR = 0
|
|
|
|
LDFLAGS-$(CONFIG_SunOS) = -Wl,-M -Wl,mapfile-SunOS
|
|
LDFLAGS-$(CONFIG_Linux) = -Wl,mapfile-GNU
|
|
LDFLAGS = $(LDFLAGS-y)
|
|
|
|
LIB_SRCS-y = fsimage.c fsimage_plugin.c fsimage_grub.c
|
|
|
|
PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
|
|
|
|
LIB = libfsimage.so libfsimage.so.$(MAJOR) libfsimage.so.$(MAJOR).$(MINOR)
|
|
|
|
.PHONY: all
|
|
all: $(LIB)
|
|
|
|
.PHONY: install
|
|
install: all
|
|
$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
|
|
$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
|
|
$(INSTALL_PROG) libfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
|
|
ln -sf libfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libfsimage.so.$(MAJOR)
|
|
ln -sf libfsimage.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libfsimage.so
|
|
$(INSTALL_DATA) fsimage.h $(DESTDIR)$(INCLUDEDIR)
|
|
$(INSTALL_DATA) fsimage_plugin.h $(DESTDIR)$(INCLUDEDIR)
|
|
$(INSTALL_DATA) fsimage_grub.h $(DESTDIR)$(INCLUDEDIR)
|
|
|
|
clean distclean:
|
|
rm -f $(PIC_OBJS) $(LIB) $(DEPS)
|
|
|
|
libfsimage.so: libfsimage.so.$(MAJOR)
|
|
ln -sf $< $@
|
|
libfsimage.so.$(MAJOR): libfsimage.so.$(MAJOR).$(MINOR)
|
|
ln -sf $< $@
|
|
|
|
libfsimage.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libfsimage.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^ -lpthread
|
|
|
|
-include $(DEPS)
|
|
|