[PATCH 1/6] Makefile.am: group set of source files into static lib

Edgar Kaziakhmedov edgar.kaziakhmedov at virtuozzo.com
Sun Dec 10 14:02:25 UTC 2017


As asinfo requires some strace source files to work, it is neccessary to
group them into separate static library.

* Makefile.am (strace_SOURCES): Delete basic_filters.c, error_prints.c,
error_prints.h, filter.h, macros.h, number_set.c, number_set.h,
string_to_uint.h, string_to_uint.c, sysent_shorthand_defs.h,
sysent_shorthand_undefs, xmalloc.c and xmalloc.h.
(libcommon_SOURCES): Add them.
(strace_LDADD): Add libcommon.a.
(noinst_LIBRARIES): Likewise.
* .gitignore: Add libcommon.a.

Signed-off-by: Edgar Kaziakhmedov <edgar.kaziakhmedov at virtuozzo.com>
---
 .gitignore  |  1 +
 Makefile.am | 33 ++++++++++++++++++++-------------
 2 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/.gitignore b/.gitignore
index 94a0be39..30938836 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,6 +29,7 @@
 /ioctlent[012].h
 /ioctls_all[012].h
 /ioctlsort[012]
+/libcommon.a
 /libmpers-m32.a
 /libmpers-mx32.a
 /libstrace.a
diff --git a/Makefile.am b/Makefile.am
index c04125ec..e90c7809 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -83,12 +83,31 @@ libstrace_a_SOURCES =	\
 	upoke.c		\
 	# end of libstrace_a_SOURCES
 
+strace_LDADD += libcommon.a
+noinst_LIBRARIES += libcommon.a
+libcommon_a_CPPFLAGS = $(strace_CPPFLAGS)
+libcommon_a_CFLAGS = $(strace_CFLAGS)
+libcommon_a_SOURCES =	\
+	basic_filters.c	\
+	error_prints.c	\
+	error_prints.h	\
+	filter.h	\
+	macros.h	\
+	number_set.c	\
+	number_set.h	\
+	string_to_uint.h	\
+	string_to_uint.c	\
+	sysent_shorthand_defs.h \
+	sysent_shorthand_undefs.h \
+	xmalloc.c		\
+	xmalloc.h		\
+	#end of libcommon_a_SOURCES
+
 strace_SOURCES =	\
 	access.c	\
 	affinity.c	\
 	aio.c		\
 	alpha.c		\
-	basic_filters.c	\
 	bind.c		\
 	bjm.c		\
 	block.c		\
@@ -116,8 +135,6 @@ strace_SOURCES =	\
 	dyxlat.c	\
 	empty.h		\
 	epoll.c		\
-	error_prints.c	\
-	error_prints.h	\
 	evdev.c		\
 	eventfd.c	\
 	execve.c	\
@@ -137,7 +154,6 @@ strace_SOURCES =	\
 	file_handle.c	\
 	file_ioctl.c	\
 	filter_qualify.c \
-	filter.h	\
 	flock.c		\
 	flock.h		\
 	fs_x_ioctl.c	\
@@ -176,7 +192,6 @@ strace_SOURCES =	\
 	lookup_dcookie.c \
 	loop.c		\
 	lseek.c		\
-	macros.h	\
 	mem.c		\
 	membarrier.c	\
 	memfd_create.c	\
@@ -210,8 +225,6 @@ strace_SOURCES =	\
 	nsfs.h          \
 	nsig.h		\
 	numa.c		\
-	number_set.c	\
-	number_set.h	\
 	oldstat.c	\
 	open.c		\
 	or1k_atomic.c	\
@@ -291,15 +304,11 @@ strace_SOURCES =	\
 	statx.c		\
 	statx.h		\
 	strace.c	\
-	string_to_uint.h \
-	string_to_uint.c \
 	supported_personalities.h \
 	swapon.c	\
 	syscall.c	\
 	sysctl.c	\
 	sysent.h	\
-	sysent_shorthand_defs.h \
-	sysent_shorthand_undefs.h \
 	sysinfo.c	\
 	syslog.c	\
 	sysmips.c	\
@@ -324,8 +333,6 @@ strace_SOURCES =	\
 	xattr.c		\
 	xlat.c		\
 	xlat.h		\
-	xmalloc.c	\
-	xmalloc.h	\
 	# end of strace_SOURCES
 
 if USE_LIBUNWIND
-- 
2.11.0





More information about the Strace-devel mailing list