mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
tools/libfsimage: Cleanup makefiles
Remove the need for "fs-*" targets by creating a "common.mk" which
have flags that are common to libfsimage/common/ and the other
libfsimages/*/ directories.
In common.mk, make $(PIC_OBJS) a recursively expanded variable so it
doesn't matter where $(LIB_SRCS-y) is defined, and remove the extra
$(PIC_OBJS) from libfsimage/common/Makefile.
Use a $(TARGETS) variable to list things to be built. And $(TARGETS)
can be use in the clean target in common.mk.
iso9660/:
Remove the explicit dependency between fsys_iso9660.c and
iso9660.h, this is handled automaticaly by the .*.d dependency files,
and iso9660.h already exist.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
This commit is contained in:
1 parent
290a9b91d9
commit
4aa436df4b
11 files changed
+22
-100
No files matched your search
@@ -1,25 +1,18 @@
|
||||
include $(XEN_ROOT)/tools/Rules.mk
|
||||
|
||||
CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
|
||||
CFLAGS += -Werror -D_GNU_SOURCE
|
||||
LDFLAGS += -L../common/
|
||||
|
||||
PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
|
||||
|
||||
FSDIR = $(libdir)/xenfsimage
|
||||
include $(XEN_ROOT)/tools/libfsimage/common.mk
|
||||
|
||||
FSLIB = fsimage.so
|
||||
TARGETS += $(FSLIB)
|
||||
|
||||
.PHONY: fs-all
|
||||
fs-all: $(FSLIB)
|
||||
.PHONY: all
|
||||
all: $(TARGETS)
|
||||
|
||||
.PHONY: fs-install
|
||||
fs-install: fs-all
|
||||
.PHONY: install
|
||||
install: all
|
||||
$(INSTALL_DIR) $(DESTDIR)$(FSDIR)/$(FS)
|
||||
$(INSTALL_PROG) $(FSLIB) $(DESTDIR)$(FSDIR)/$(FS)
|
||||
|
||||
.PHONY: fs-uninstall
|
||||
fs-uninstall:
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
rm -f $(addprefix $(DESTDIR)$(FSDIR)/$(FS)/, $(FSLIB))
|
||||
if [ -d $(DESTDIR)$(FSDIR)/$(FS) ]; then \
|
||||
rmdir $(DESTDIR)$(FSDIR)/$(FS); \
|
||||
@@ -28,7 +21,4 @@ fs-uninstall:
|
||||
$(FSLIB): $(PIC_OBJS)
|
||||
$(CC) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $^ -lxenfsimage $(FS_LIBDEPS) $(APPEND_LDFLAGS)
|
||||
|
||||
clean distclean::
|
||||
rm -f $(PIC_OBJS) $(FSLIB) $(DEPS_RM)
|
||||
|
||||
-include $(DEPS_INCLUDE)
|
||||
@@ -0,0 +1,11 @@
|
||||
include $(XEN_ROOT)/tools/Rules.mk
|
||||
|
||||
FSDIR := $(libdir)/xenfsimage
|
||||
CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
|
||||
CFLAGS += -Werror -D_GNU_SOURCE
|
||||
LDFLAGS += -L../common/
|
||||
|
||||
PIC_OBJS = $(patsubst %.c,%.opic,$(LIB_SRCS-y))
|
||||
|
||||
clean distclean::
|
||||
rm -f $(PIC_OBJS) $(TARGETS) $(DEPS_RM)
|
||||
@@ -1,5 +1,5 @@
|
||||
XEN_ROOT = $(CURDIR)/../../..
|
||||
include $(XEN_ROOT)/tools/libfsimage/Rules.mk
|
||||
include $(XEN_ROOT)/tools/libfsimage/common.mk
|
||||
|
||||
MAJOR := $(shell $(XEN_ROOT)/version.sh $(XEN_ROOT)/xen/Makefile)
|
||||
MINOR = 0
|
||||
@@ -13,12 +13,10 @@ LDFLAGS += $(PTHREAD_LDFLAGS)
|
||||
|
||||
LIB_SRCS-y = fsimage.c fsimage_plugin.c fsimage_grub.c
|
||||
|
||||
PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
|
||||
|
||||
LIB = libxenfsimage.so libxenfsimage.so.$(MAJOR) libxenfsimage.so.$(MAJOR).$(MINOR)
|
||||
TARGETS = libxenfsimage.so libxenfsimage.so.$(MAJOR) libxenfsimage.so.$(MAJOR).$(MINOR)
|
||||
|
||||
.PHONY: all
|
||||
all: $(LIB)
|
||||
all: $(TARGETS)
|
||||
|
||||
.PHONY: install
|
||||
install: all
|
||||
@@ -40,9 +38,6 @@ uninstall:
|
||||
rm -f $(DESTDIR)$(libdir)/libxenfsimage.so.$(MAJOR)
|
||||
rm -f $(DESTDIR)$(libdir)/libxenfsimage.so.$(MAJOR).$(MINOR)
|
||||
|
||||
clean distclean::
|
||||
rm -f $(LIB)
|
||||
|
||||
libxenfsimage.so: libxenfsimage.so.$(MAJOR)
|
||||
ln -sf $< $@
|
||||
libxenfsimage.so.$(MAJOR): libxenfsimage.so.$(MAJOR).$(MINOR)
|
||||
|
||||
@@ -9,13 +9,4 @@ FS_LIBDEPS = $(EXTFS_LIBS)
|
||||
# Include configure output (config.h)
|
||||
CFLAGS += -include $(XEN_ROOT)/tools/config.h
|
||||
|
||||
.PHONY: all
|
||||
all: fs-all
|
||||
|
||||
.PHONY: install
|
||||
install: fs-install
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall: fs-uninstall
|
||||
|
||||
include $(XEN_ROOT)/tools/libfsimage/Rules.mk
|
||||
@@ -4,13 +4,4 @@ LIB_SRCS-y = fsys_ext2fs.c
|
||||
|
||||
FS = ext2fs
|
||||
|
||||
.PHONY: all
|
||||
all: fs-all
|
||||
|
||||
.PHONY: install
|
||||
install: fs-install
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall: fs-uninstall
|
||||
|
||||
include $(XEN_ROOT)/tools/libfsimage/Rules.mk
|
||||
@@ -4,13 +4,4 @@ LIB_SRCS-y = fsys_fat.c
|
||||
|
||||
FS = fat
|
||||
|
||||
.PHONY: all
|
||||
all: fs-all
|
||||
|
||||
.PHONY: install
|
||||
install: fs-install
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall: fs-uninstall
|
||||
|
||||
include $(XEN_ROOT)/tools/libfsimage/Rules.mk
|
||||
@@ -4,15 +4,4 @@ LIB_SRCS-y = fsys_iso9660.c
|
||||
|
||||
FS = iso9660
|
||||
|
||||
.PHONY: all
|
||||
all: fs-all
|
||||
|
||||
.PHONY: install
|
||||
install: fs-install
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall: fs-uninstall
|
||||
|
||||
fsys_iso9660.c: iso9660.h
|
||||
|
||||
include $(XEN_ROOT)/tools/libfsimage/Rules.mk
|
||||
@@ -4,13 +4,4 @@ LIB_SRCS-y = fsys_reiserfs.c
|
||||
|
||||
FS = reiserfs
|
||||
|
||||
.PHONY: all
|
||||
all: fs-all
|
||||
|
||||
.PHONY: install
|
||||
install: fs-install
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall: fs-uninstall
|
||||
|
||||
include $(XEN_ROOT)/tools/libfsimage/Rules.mk
|
||||
@@ -4,13 +4,4 @@ LIB_SRCS-y = fsys_ufs.c
|
||||
|
||||
FS = ufs
|
||||
|
||||
.PHONY: all
|
||||
all: fs-all
|
||||
|
||||
.PHONY: install
|
||||
install: fs-install
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall: fs-uninstall
|
||||
|
||||
include $(XEN_ROOT)/tools/libfsimage/Rules.mk
|
||||
@@ -4,13 +4,4 @@ LIB_SRCS-y = fsys_xfs.c
|
||||
|
||||
FS = xfs
|
||||
|
||||
.PHONY: all
|
||||
all: fs-all
|
||||
|
||||
.PHONY: install
|
||||
install: fs-install
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall: fs-uninstall
|
||||
|
||||
include $(XEN_ROOT)/tools/libfsimage/Rules.mk
|
||||
@@ -28,13 +28,4 @@ LIB_SRCS-y = zfs_lzjb.c zfs_sha256.c zfs_fletcher.c fsi_zfs.c fsys_zfs.c
|
||||
|
||||
FS = zfs
|
||||
|
||||
.PHONY: all
|
||||
all: fs-all
|
||||
|
||||
.PHONY: install
|
||||
install: fs-install
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall: fs-uninstall
|
||||
|
||||
include $(XEN_ROOT)/tools/libfsimage/Rules.mk
|
||||