[parted-devel] [PATCH] Fix non-srcdir build in git tree

Jim Meyering jim at meyering.net
Tue Jan 10 11:27:12 UTC 2012


Keshav P R wrote:
>      I have attached the patch that adds -I$(top_builddir)/include to
> partedincludedir in all Makefile.am files to fix non-srcdir build. Please apply
> it. Thanks in advance.

Thanks.
I'll apply the essence of that shortly.
It exposed excessive duplication in the fs/*/Makefile.am files,
which I'm removing with this patch:


>From f8cae064c36d7086d6894a348eb80bcb7fe64835 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Tue, 10 Jan 2012 11:48:52 +0100
Subject: [PATCH] maint: hoist libparted/fs/*/Makefile.am into parent
 Makefile.am

There was no need to have a separate Makefile.am for each file system
type, and a good reason *not* to do that (reduce duplication).
* configure.ac (AC_OUTPUT): Remove Makefiles.
* libparted/fs/Makefile.am (SUBDIRS): Remove.
(EXTRA_DIST): List the two non-src files: hfs/DOC hfs/HISTORY.
(libfs_la_SOURCES): Hoist file names to here from...
* libparted/fs/amiga/Makefile.am: ...here.
* libparted/fs/ext2/Makefile.am: Likewise.
* libparted/fs/fat/Makefile.am: Likewise.
* libparted/fs/hfs/Makefile.am: Likewise.
* libparted/fs/jfs/Makefile.am: Likewise.
* libparted/fs/linux_swap/Makefile.am: Likewise.
* libparted/fs/nilfs2/Makefile.am: Likewise.
* libparted/fs/ntfs/Makefile.am: Likewise.
* libparted/fs/reiserfs/Makefile.am: Likewise.
* libparted/fs/ufs/Makefile.am: Likewise.
* libparted/fs/xfs/Makefile.am: Likewise.
* libparted/fs/*/Makefile.am: Remove files.
* libparted/fs/amiga/a-interface.c: Now that the .o files are all
in the same place, rename from interface.c, to avoid collision with
name of .o file from ext2/interface.c.
---
 configure.ac                                      |   11 ----
 libparted/fs/Makefile.am                          |   56 ++++++++++++++-------
 libparted/fs/amiga/Makefile.am                    |   17 ------
 libparted/fs/amiga/{interface.c => a-interface.c} |    0
 libparted/fs/ext2/Makefile.am                     |   11 ----
 libparted/fs/fat/Makefile.am                      |   12 -----
 libparted/fs/hfs/Makefile.am                      |   12 -----
 libparted/fs/jfs/Makefile.am                      |    9 ---
 libparted/fs/linux_swap/Makefile.am               |    8 ---
 libparted/fs/nilfs2/Makefile.am                   |   10 ----
 libparted/fs/ntfs/Makefile.am                     |    9 ---
 libparted/fs/reiserfs/Makefile.am                 |   10 ----
 libparted/fs/ufs/Makefile.am                      |    9 ---
 libparted/fs/xfs/Makefile.am                      |    9 ---
 14 files changed, 38 insertions(+), 145 deletions(-)
 delete mode 100644 libparted/fs/amiga/Makefile.am
 rename libparted/fs/amiga/{interface.c => a-interface.c} (100%)
 delete mode 100644 libparted/fs/ext2/Makefile.am
 delete mode 100644 libparted/fs/fat/Makefile.am
 delete mode 100644 libparted/fs/hfs/Makefile.am
 delete mode 100644 libparted/fs/jfs/Makefile.am
 delete mode 100644 libparted/fs/linux_swap/Makefile.am
 delete mode 100644 libparted/fs/nilfs2/Makefile.am
 delete mode 100644 libparted/fs/ntfs/Makefile.am
 delete mode 100644 libparted/fs/reiserfs/Makefile.am
 delete mode 100644 libparted/fs/ufs/Makefile.am
 delete mode 100644 libparted/fs/xfs/Makefile.am

diff --git a/configure.ac b/configure.ac
index a4bbe95..9f36089 100644
--- a/configure.ac
+++ b/configure.ac
@@ -605,17 +605,6 @@ include/parted/Makefile
 libparted/Makefile
 libparted/labels/Makefile
 libparted/fs/Makefile
-libparted/fs/amiga/Makefile
-libparted/fs/ext2/Makefile
-libparted/fs/fat/Makefile
-libparted/fs/hfs/Makefile
-libparted/fs/jfs/Makefile
-libparted/fs/linux_swap/Makefile
-libparted/fs/ntfs/Makefile
-libparted/fs/reiserfs/Makefile
-libparted/fs/ufs/Makefile
-libparted/fs/xfs/Makefile
-libparted/fs/nilfs2/Makefile
 libparted/tests/Makefile
 libparted.pc
 parted/Makefile
diff --git a/libparted/fs/Makefile.am b/libparted/fs/Makefile.am
index cb09ffb..0ce838c 100644
--- a/libparted/fs/Makefile.am
+++ b/libparted/fs/Makefile.am
@@ -3,9 +3,6 @@
 #
 # This file may be modified and/or distributed without restriction.

-SUBDIRS       = amiga ext2 ufs fat ntfs hfs linux_swap xfs jfs reiserfs \
-		nilfs2 # bfs
-
 partedincludedir      =	-I$(top_srcdir)/include
 noinst_LTLIBRARIES    =	libfs.la
 libfs_la_LDFLAGS  = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
@@ -13,22 +10,45 @@ libfs_la_LDFLAGS  = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \

 libfs_la_LIBADD   = $(UUID_LIBS)		\
 		    $(INTLLIBS)			\
-		    $(OS_LIBS)			\
-		    $(REISER_LIBS)		\
-		    amiga/libamigafs.la		\
-		    ext2/libext2.la		\
-		    ufs/libufs.la		\
-		    fat/libfat.la		\
-		    ntfs/libntfs.la		\
-		    hfs/libhfs.la		\
-		    linux_swap/liblinuxswap.la	\
-		    xfs/libxfs.la		\
-		    jfs/libjfs.la		\
-		    reiserfs/libreiserfs.la	\
-		    nilfs2/libnilfs2.la
-#		    bfs/libbfs.la
+		    $(OS_LIBS)
+
+libfs_la_SOURCES =		\
+  amiga/affs.c			\
+  amiga/affs.h			\
+  amiga/amiga.c			\
+  amiga/amiga.h			\
+  amiga/apfs.c			\
+  amiga/apfs.h			\
+  amiga/asfs.c			\
+  amiga/asfs.h			\
+  amiga/a-interface.c		\
+  ext2/ext2.h			\
+  ext2/ext2_fs.h		\
+  ext2/interface.c		\
+  fat/bootsector.c		\
+  fat/bootsector.h		\
+  fat/count.h			\
+  fat/fat.c			\
+  fat/fat.h			\
+  hfs/hfs.c			\
+  hfs/hfs.h			\
+  hfs/probe.c			\
+  hfs/probe.h			\
+  jfs/jfs.c			\
+  jfs/jfs_superblock.h		\
+  jfs/jfs_types.h		\
+  linux_swap/linux_swap.c	\
+  nilfs2/nilfs2.c		\
+  ntfs/ntfs.c			\
+  reiserfs/reiserfs.c		\
+  reiserfs/reiserfs.h		\
+  ufs/ufs.c			\
+  xfs/platform_defs.h		\
+  xfs/xfs.c			\
+  xfs/xfs_sb.h			\
+  xfs/xfs_types.h

-libfs_la_SOURCES   =
+EXTRA_DIST = hfs/DOC hfs/HISTORY

 INCLUDES = $(partedincludedir) $(INTLINCS)

diff --git a/libparted/fs/amiga/Makefile.am b/libparted/fs/amiga/Makefile.am
deleted file mode 100644
index 788ecac..0000000
--- a/libparted/fs/amiga/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
-partedincludedir      =	-I$(top_srcdir)/include
-
-noinst_LTLIBRARIES    =	libamigafs.la
-libamigafs_la_SOURCES   =	amiga.h		\
-			amiga.c		\
-			affs.h		\
-			affs.c		\
-			asfs.h		\
-			asfs.c		\
-			apfs.h		\
-			apfs.c		\
-			interface.c
-
-INCLUDES = $(partedincludedir) $(INTLINCS)
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/libparted/fs/amiga/interface.c b/libparted/fs/amiga/a-interface.c
similarity index 100%
rename from libparted/fs/amiga/interface.c
rename to libparted/fs/amiga/a-interface.c
diff --git a/libparted/fs/ext2/Makefile.am b/libparted/fs/ext2/Makefile.am
deleted file mode 100644
index 0acd080..0000000
--- a/libparted/fs/ext2/Makefile.am
+++ /dev/null
@@ -1,11 +0,0 @@
-AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
-partedincludedir      =	-I$(top_srcdir)/include
-
-noinst_LTLIBRARIES    =	libext2.la
-libext2_la_SOURCES    =	ext2.h \
-			ext2_fs.h \
-			interface.c
-
-INCLUDES = $(partedincludedir) $(INTLINCS)
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/libparted/fs/fat/Makefile.am b/libparted/fs/fat/Makefile.am
deleted file mode 100644
index 9c975d7..0000000
--- a/libparted/fs/fat/Makefile.am
+++ /dev/null
@@ -1,12 +0,0 @@
-partedincludedir      =	-I$(top_srcdir)/include
-
-noinst_LTLIBRARIES    =	libfat.la
-libfat_la_SOURCES     = bootsector.c	\
-			bootsector.h	\
-			count.h		\
-			fat.c		\
-			fat.h
-
-INCLUDES = $(partedincludedir) $(INTLINCS)
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/libparted/fs/hfs/Makefile.am b/libparted/fs/hfs/Makefile.am
deleted file mode 100644
index f85493c..0000000
--- a/libparted/fs/hfs/Makefile.am
+++ /dev/null
@@ -1,12 +0,0 @@
-AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
-partedincludedir	= -I$(top_srcdir)/include
-
-noinst_LTLIBRARIES	= libhfs.la
-libhfs_la_SOURCES	= hfs.c hfs.h \
-			  probe.c probe.h
-
-INCLUDES = $(partedincludedir) $(INTLINCS)
-
-EXTRA_DIST = DOC HISTORY
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/libparted/fs/jfs/Makefile.am b/libparted/fs/jfs/Makefile.am
deleted file mode 100644
index a477874..0000000
--- a/libparted/fs/jfs/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
-partedincludedir	= -I$(top_srcdir)/include
-
-noinst_LTLIBRARIES	= libjfs.la
-libjfs_la_SOURCES	= jfs.c jfs_superblock.h jfs_types.h
-
-INCLUDES = $(partedincludedir) $(INTLINCS)
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/libparted/fs/linux_swap/Makefile.am b/libparted/fs/linux_swap/Makefile.am
deleted file mode 100644
index a366fc6..0000000
--- a/libparted/fs/linux_swap/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-partedincludedir	= -I$(top_srcdir)/include
-
-noinst_LTLIBRARIES	= liblinuxswap.la
-liblinuxswap_la_SOURCES	= linux_swap.c
-
-INCLUDES = $(partedincludedir) $(INTLINCS)
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/libparted/fs/nilfs2/Makefile.am b/libparted/fs/nilfs2/Makefile.am
deleted file mode 100644
index c7cfd68..0000000
--- a/libparted/fs/nilfs2/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-partedincludedir	= -I$(top_srcdir)/include
-
-AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
-
-noinst_LTLIBRARIES	= libnilfs2.la
-libnilfs2_la_SOURCES	= nilfs2.c
-
-INCLUDES = $(partedincludedir) $(INTLINCS)
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/libparted/fs/ntfs/Makefile.am b/libparted/fs/ntfs/Makefile.am
deleted file mode 100644
index 732692a..0000000
--- a/libparted/fs/ntfs/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
-partedincludedir	= -I$(top_srcdir)/include
-
-noinst_LTLIBRARIES	= libntfs.la
-libntfs_la_SOURCES	= ntfs.c
-
-INCLUDES = $(partedincludedir) $(INTLINCS)
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/libparted/fs/reiserfs/Makefile.am b/libparted/fs/reiserfs/Makefile.am
deleted file mode 100644
index 7df005a..0000000
--- a/libparted/fs/reiserfs/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
-partedincludedir	= -I$(top_srcdir)/include
-
-noinst_LTLIBRARIES	= libreiserfs.la
-
-libreiserfs_la_SOURCES	= reiserfs.c reiserfs.h
-
-INCLUDES = $(partedincludedir) $(INTLINCS)
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/libparted/fs/ufs/Makefile.am b/libparted/fs/ufs/Makefile.am
deleted file mode 100644
index c63e8d2..0000000
--- a/libparted/fs/ufs/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
-partedincludedir	= -I$(top_srcdir)/include
-
-noinst_LTLIBRARIES	= libufs.la
-libufs_la_SOURCES	= ufs.c
-
-INCLUDES = $(partedincludedir) $(INTLINCS)
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/libparted/fs/xfs/Makefile.am b/libparted/fs/xfs/Makefile.am
deleted file mode 100644
index 8e55052..0000000
--- a/libparted/fs/xfs/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
-partedincludedir	= -I$(top_srcdir)/include
-
-noinst_LTLIBRARIES	= libxfs.la
-libxfs_la_SOURCES	= xfs.c xfs_sb.h xfs_types.h platform_defs.h
-
-INCLUDES = $(partedincludedir) $(INTLINCS)
-
-MAINTAINERCLEANFILES = Makefile.in
--
1.7.9.rc0.2.g4b783



More information about the parted-devel mailing list