All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] cleanup: avoid to generate many redundant obj files
@ 2020-02-18 11:59 Li Wang
  2020-02-18 14:05 ` Yang Xu
  2020-02-19 11:17 ` Xiao Yang
  0 siblings, 2 replies; 10+ messages in thread
From: Li Wang @ 2020-02-18 11:59 UTC (permalink / raw)
  To: ltp

Signed-off-by: Li Wang <liwang@redhat.com>
---

Notes:
    Travis: https://travis-ci.com/wangli5665/ltp/builds/149424324

 testcases/kernel/fs/ftest/Makefile               | 2 +-
 testcases/kernel/input/Makefile                  | 2 +-
 testcases/kernel/io/direct_io/Makefile           | 2 +-
 testcases/kernel/sched/clisrv/Makefile           | 2 +-
 testcases/kernel/sched/sched_stress/Makefile     | 2 +-
 testcases/kernel/syscalls/memfd_create/Makefile  | 2 +-
 testcases/kernel/syscalls/migrate_pages/Makefile | 2 +-
 testcases/kernel/syscalls/move_pages/Makefile    | 2 +-
 testcases/kernel/syscalls/swapoff/Makefile       | 2 +-
 testcases/kernel/syscalls/swapon/Makefile        | 2 +-
 testcases/network/nfs/nfslock01/Makefile         | 2 +-
 testcases/network/stress/ns-tools/Makefile       | 2 +-
 12 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/testcases/kernel/fs/ftest/Makefile b/testcases/kernel/fs/ftest/Makefile
index 1566c5c31..e5672d5b1 100644
--- a/testcases/kernel/fs/ftest/Makefile
+++ b/testcases/kernel/fs/ftest/Makefile
@@ -28,4 +28,4 @@ FILTER_OUT_MAKE_TARGETS		:= libftest
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
 
-$(MAKE_TARGETS): %: %.o libftest.o
+$(MAKE_TARGETS): %: libftest.o
diff --git a/testcases/kernel/input/Makefile b/testcases/kernel/input/Makefile
index 5f1db9328..f4d35ab39 100644
--- a/testcases/kernel/input/Makefile
+++ b/testcases/kernel/input/Makefile
@@ -24,4 +24,4 @@ FILTER_OUT_MAKE_TARGETS		:= input_helper
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
 
-$(MAKE_TARGETS): %: %.o input_helper.o
+$(MAKE_TARGETS): %: input_helper.o
diff --git a/testcases/kernel/io/direct_io/Makefile b/testcases/kernel/io/direct_io/Makefile
index b522136ca..6d26a7ff3 100644
--- a/testcases/kernel/io/direct_io/Makefile
+++ b/testcases/kernel/io/direct_io/Makefile
@@ -30,4 +30,4 @@ INSTALL_TARGETS			:= test_dma_thread_diotest7.sh
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
 
-$(MAKE_TARGETS): %: %.o diotest_routines.o
+$(MAKE_TARGETS): %: diotest_routines.o
diff --git a/testcases/kernel/sched/clisrv/Makefile b/testcases/kernel/sched/clisrv/Makefile
index af43b7efd..3e311b65b 100644
--- a/testcases/kernel/sched/clisrv/Makefile
+++ b/testcases/kernel/sched/clisrv/Makefile
@@ -31,6 +31,6 @@ INSTALL_TARGETS		:= data run_sched_cliserv.sh
 
 MAKE_TARGETS		:= pthcli pthserv
 
-$(MAKE_TARGETS): %: %.o readline.o writen.o
+$(MAKE_TARGETS): %: readline.o writen.o
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/sched/sched_stress/Makefile b/testcases/kernel/sched/sched_stress/Makefile
index 60bdc6936..2303f6950 100644
--- a/testcases/kernel/sched/sched_stress/Makefile
+++ b/testcases/kernel/sched/sched_stress/Makefile
@@ -32,7 +32,7 @@ MAKE_TARGETS		:= $(filter-out sched,$(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(
 
 RM			+= -r
 
-$(filter-out sched_datafile,$(MAKE_TARGETS)): %: %.o sched.o
+$(filter-out sched_datafile,$(MAKE_TARGETS)): %: sched.o
 
 MAKE_TARGETS		+= sched_datafile
 
diff --git a/testcases/kernel/syscalls/memfd_create/Makefile b/testcases/kernel/syscalls/memfd_create/Makefile
index f23b8732c..40ccf7f7f 100644
--- a/testcases/kernel/syscalls/memfd_create/Makefile
+++ b/testcases/kernel/syscalls/memfd_create/Makefile
@@ -20,4 +20,4 @@ FILTER_OUT_MAKE_TARGETS         := memfd_create_common
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
 
-$(MAKE_TARGETS): %: %.o memfd_create_common.o
+$(MAKE_TARGETS): %: memfd_create_common.o
diff --git a/testcases/kernel/syscalls/migrate_pages/Makefile b/testcases/kernel/syscalls/migrate_pages/Makefile
index 46a35d3e0..55174f3b8 100644
--- a/testcases/kernel/syscalls/migrate_pages/Makefile
+++ b/testcases/kernel/syscalls/migrate_pages/Makefile
@@ -21,7 +21,7 @@ top_srcdir		?= ../../../..
 include $(top_srcdir)/include/mk/testcases.mk
 
 MAKE_TARGETS		:= $(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(abs_srcdir)/*[0-9].c))
-$(MAKE_TARGETS): %: %.o migrate_pages_common.o
+$(MAKE_TARGETS): %: migrate_pages_common.o
 
 CPPFLAGS		+= -I$(abs_srcdir)/../utils/
 
diff --git a/testcases/kernel/syscalls/move_pages/Makefile b/testcases/kernel/syscalls/move_pages/Makefile
index 27cf0f7a8..96ff7368f 100644
--- a/testcases/kernel/syscalls/move_pages/Makefile
+++ b/testcases/kernel/syscalls/move_pages/Makefile
@@ -24,7 +24,7 @@ CPPFLAGS		+= -I$(abs_srcdir)/../utils
 
 MAKE_TARGETS		:= $(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(abs_srcdir)/*[0-9].c))
 
-$(MAKE_TARGETS): %: %.o move_pages_support.o
+$(MAKE_TARGETS): %: move_pages_support.o
 
 LDLIBS			+= -lpthread -lrt
 
diff --git a/testcases/kernel/syscalls/swapoff/Makefile b/testcases/kernel/syscalls/swapoff/Makefile
index 536b2dbac..790a2a74e 100644
--- a/testcases/kernel/syscalls/swapoff/Makefile
+++ b/testcases/kernel/syscalls/swapoff/Makefile
@@ -21,4 +21,4 @@ top_srcdir		?= ../../../..
 include $(top_srcdir)/include/mk/testcases.mk
 include $(abs_srcdir)/./Makefile.inc
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
-$(MAKE_TARGETS): %: %.o ../swapon/libswapon.o
+$(MAKE_TARGETS): %: ../swapon/libswapon.o
diff --git a/testcases/kernel/syscalls/swapon/Makefile b/testcases/kernel/syscalls/swapon/Makefile
index a109ecdf8..a9bd8f19f 100644
--- a/testcases/kernel/syscalls/swapon/Makefile
+++ b/testcases/kernel/syscalls/swapon/Makefile
@@ -29,4 +29,4 @@ FILTER_OUT_MAKE_TARGETS         := libswapon
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
 
-$(MAKE_TARGETS): %: %.o libswapon.o
+$(MAKE_TARGETS): %: libswapon.o
diff --git a/testcases/network/nfs/nfslock01/Makefile b/testcases/network/nfs/nfslock01/Makefile
index a07a99ea9..978749a81 100644
--- a/testcases/network/nfs/nfslock01/Makefile
+++ b/testcases/network/nfs/nfslock01/Makefile
@@ -12,4 +12,4 @@ INSTALL_TARGETS			:= nfslock01
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
 
-$(MAKE_TARGETS): %: %.o nfs_flock_func.o
+$(MAKE_TARGETS): %: nfs_flock_func.o
diff --git a/testcases/network/stress/ns-tools/Makefile b/testcases/network/stress/ns-tools/Makefile
index 49a05232f..a288066c8 100644
--- a/testcases/network/stress/ns-tools/Makefile
+++ b/testcases/network/stress/ns-tools/Makefile
@@ -35,4 +35,4 @@ FILTER_OUT_MAKE_TARGETS	:= ns-common
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
 
-$(MAKE_TARGETS): %: %.o ns-common.o
+$(MAKE_TARGETS): %: ns-common.o
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [LTP] [PATCH] cleanup: avoid to generate many redundant obj files
  2020-02-18 11:59 [LTP] [PATCH] cleanup: avoid to generate many redundant obj files Li Wang
@ 2020-02-18 14:05 ` Yang Xu
  2020-02-19  3:57   ` Li Wang
  2020-02-19 11:17 ` Xiao Yang
  1 sibling, 1 reply; 10+ messages in thread
From: Yang Xu @ 2020-02-18 14:05 UTC (permalink / raw)
  To: ltp

Hi Li

This patch looks good to me, feel free to add
Reviewed-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>

Also, I think we can replace GPL with SPDX-License-Identifier in these makefiles(Also for
all ltp makefiles, we have converted SPDX-License-Identifier in few header since commit b288957a88b1 ).

Best Regard
Yang Xu

> Signed-off-by: Li Wang <liwang@redhat.com>
> ---
>
> Notes:
>      Travis: https://travis-ci.com/wangli5665/ltp/builds/149424324
>
>   testcases/kernel/fs/ftest/Makefile               | 2 +-
>   testcases/kernel/input/Makefile                  | 2 +-
>   testcases/kernel/io/direct_io/Makefile           | 2 +-
>   testcases/kernel/sched/clisrv/Makefile           | 2 +-
>   testcases/kernel/sched/sched_stress/Makefile     | 2 +-
>   testcases/kernel/syscalls/memfd_create/Makefile  | 2 +-
>   testcases/kernel/syscalls/migrate_pages/Makefile | 2 +-
>   testcases/kernel/syscalls/move_pages/Makefile    | 2 +-
>   testcases/kernel/syscalls/swapoff/Makefile       | 2 +-
>   testcases/kernel/syscalls/swapon/Makefile        | 2 +-
>   testcases/network/nfs/nfslock01/Makefile         | 2 +-
>   testcases/network/stress/ns-tools/Makefile       | 2 +-
>   12 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/testcases/kernel/fs/ftest/Makefile b/testcases/kernel/fs/ftest/Makefile
> index 1566c5c31..e5672d5b1 100644
> --- a/testcases/kernel/fs/ftest/Makefile
> +++ b/testcases/kernel/fs/ftest/Makefile
> @@ -28,4 +28,4 @@ FILTER_OUT_MAKE_TARGETS		:= libftest
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
>   
> -$(MAKE_TARGETS): %: %.o libftest.o
> +$(MAKE_TARGETS): %: libftest.o
> diff --git a/testcases/kernel/input/Makefile b/testcases/kernel/input/Makefile
> index 5f1db9328..f4d35ab39 100644
> --- a/testcases/kernel/input/Makefile
> +++ b/testcases/kernel/input/Makefile
> @@ -24,4 +24,4 @@ FILTER_OUT_MAKE_TARGETS		:= input_helper
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
>   
> -$(MAKE_TARGETS): %: %.o input_helper.o
> +$(MAKE_TARGETS): %: input_helper.o
> diff --git a/testcases/kernel/io/direct_io/Makefile b/testcases/kernel/io/direct_io/Makefile
> index b522136ca..6d26a7ff3 100644
> --- a/testcases/kernel/io/direct_io/Makefile
> +++ b/testcases/kernel/io/direct_io/Makefile
> @@ -30,4 +30,4 @@ INSTALL_TARGETS			:= test_dma_thread_diotest7.sh
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
>   
> -$(MAKE_TARGETS): %: %.o diotest_routines.o
> +$(MAKE_TARGETS): %: diotest_routines.o
> diff --git a/testcases/kernel/sched/clisrv/Makefile b/testcases/kernel/sched/clisrv/Makefile
> index af43b7efd..3e311b65b 100644
> --- a/testcases/kernel/sched/clisrv/Makefile
> +++ b/testcases/kernel/sched/clisrv/Makefile
> @@ -31,6 +31,6 @@ INSTALL_TARGETS		:= data run_sched_cliserv.sh
>   
>   MAKE_TARGETS		:= pthcli pthserv
>   
> -$(MAKE_TARGETS): %: %.o readline.o writen.o
> +$(MAKE_TARGETS): %: readline.o writen.o
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
> diff --git a/testcases/kernel/sched/sched_stress/Makefile b/testcases/kernel/sched/sched_stress/Makefile
> index 60bdc6936..2303f6950 100644
> --- a/testcases/kernel/sched/sched_stress/Makefile
> +++ b/testcases/kernel/sched/sched_stress/Makefile
> @@ -32,7 +32,7 @@ MAKE_TARGETS		:= $(filter-out sched,$(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(
>   
>   RM			+= -r
>   
> -$(filter-out sched_datafile,$(MAKE_TARGETS)): %: %.o sched.o
> +$(filter-out sched_datafile,$(MAKE_TARGETS)): %: sched.o
>   
>   MAKE_TARGETS		+= sched_datafile
>   
> diff --git a/testcases/kernel/syscalls/memfd_create/Makefile b/testcases/kernel/syscalls/memfd_create/Makefile
> index f23b8732c..40ccf7f7f 100644
> --- a/testcases/kernel/syscalls/memfd_create/Makefile
> +++ b/testcases/kernel/syscalls/memfd_create/Makefile
> @@ -20,4 +20,4 @@ FILTER_OUT_MAKE_TARGETS         := memfd_create_common
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
>   
> -$(MAKE_TARGETS): %: %.o memfd_create_common.o
> +$(MAKE_TARGETS): %: memfd_create_common.o
> diff --git a/testcases/kernel/syscalls/migrate_pages/Makefile b/testcases/kernel/syscalls/migrate_pages/Makefile
> index 46a35d3e0..55174f3b8 100644
> --- a/testcases/kernel/syscalls/migrate_pages/Makefile
> +++ b/testcases/kernel/syscalls/migrate_pages/Makefile
> @@ -21,7 +21,7 @@ top_srcdir		?= ../../../..
>   include $(top_srcdir)/include/mk/testcases.mk
>   
>   MAKE_TARGETS		:= $(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(abs_srcdir)/*[0-9].c))
> -$(MAKE_TARGETS): %: %.o migrate_pages_common.o
> +$(MAKE_TARGETS): %: migrate_pages_common.o
>   
>   CPPFLAGS		+= -I$(abs_srcdir)/../utils/
>   
> diff --git a/testcases/kernel/syscalls/move_pages/Makefile b/testcases/kernel/syscalls/move_pages/Makefile
> index 27cf0f7a8..96ff7368f 100644
> --- a/testcases/kernel/syscalls/move_pages/Makefile
> +++ b/testcases/kernel/syscalls/move_pages/Makefile
> @@ -24,7 +24,7 @@ CPPFLAGS		+= -I$(abs_srcdir)/../utils
>   
>   MAKE_TARGETS		:= $(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(abs_srcdir)/*[0-9].c))
>   
> -$(MAKE_TARGETS): %: %.o move_pages_support.o
> +$(MAKE_TARGETS): %: move_pages_support.o
>   
>   LDLIBS			+= -lpthread -lrt
>   
> diff --git a/testcases/kernel/syscalls/swapoff/Makefile b/testcases/kernel/syscalls/swapoff/Makefile
> index 536b2dbac..790a2a74e 100644
> --- a/testcases/kernel/syscalls/swapoff/Makefile
> +++ b/testcases/kernel/syscalls/swapoff/Makefile
> @@ -21,4 +21,4 @@ top_srcdir		?= ../../../..
>   include $(top_srcdir)/include/mk/testcases.mk
>   include $(abs_srcdir)/./Makefile.inc
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
> -$(MAKE_TARGETS): %: %.o ../swapon/libswapon.o
> +$(MAKE_TARGETS): %: ../swapon/libswapon.o
> diff --git a/testcases/kernel/syscalls/swapon/Makefile b/testcases/kernel/syscalls/swapon/Makefile
> index a109ecdf8..a9bd8f19f 100644
> --- a/testcases/kernel/syscalls/swapon/Makefile
> +++ b/testcases/kernel/syscalls/swapon/Makefile
> @@ -29,4 +29,4 @@ FILTER_OUT_MAKE_TARGETS         := libswapon
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
>   
> -$(MAKE_TARGETS): %: %.o libswapon.o
> +$(MAKE_TARGETS): %: libswapon.o
> diff --git a/testcases/network/nfs/nfslock01/Makefile b/testcases/network/nfs/nfslock01/Makefile
> index a07a99ea9..978749a81 100644
> --- a/testcases/network/nfs/nfslock01/Makefile
> +++ b/testcases/network/nfs/nfslock01/Makefile
> @@ -12,4 +12,4 @@ INSTALL_TARGETS			:= nfslock01
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
>   
> -$(MAKE_TARGETS): %: %.o nfs_flock_func.o
> +$(MAKE_TARGETS): %: nfs_flock_func.o
> diff --git a/testcases/network/stress/ns-tools/Makefile b/testcases/network/stress/ns-tools/Makefile
> index 49a05232f..a288066c8 100644
> --- a/testcases/network/stress/ns-tools/Makefile
> +++ b/testcases/network/stress/ns-tools/Makefile
> @@ -35,4 +35,4 @@ FILTER_OUT_MAKE_TARGETS	:= ns-common
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
>   
> -$(MAKE_TARGETS): %: %.o ns-common.o
> +$(MAKE_TARGETS): %: ns-common.o
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200218/08049e76/attachment.htm>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [LTP] [PATCH] cleanup: avoid to generate many redundant obj files
  2020-02-18 14:05 ` Yang Xu
@ 2020-02-19  3:57   ` Li Wang
  0 siblings, 0 replies; 10+ messages in thread
From: Li Wang @ 2020-02-19  3:57 UTC (permalink / raw)
  To: ltp

Hi Yang,

On Tue, Feb 18, 2020 at 10:21 PM Yang Xu <xuyang_jy_0410@163.com> wrote:

> Hi Li
>
> This patch looks good to me, feel free to add
> Reviewed-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com> <xuyang2018.jy@cn.fujitsu.com>
>
> Also, I think we can replace GPL with SPDX-License-Identifier in these makefiles
>
> Yes, I have fixed that as you suggest and pushed. Thanks!


> (Also for
> all ltp makefiles, we have converted SPDX-License-Identifier in few header since commit b288957a88b1 ).
>
> Good point, but I haven't found a way to do the replacement for whole
files.

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200219/556d1f05/attachment.htm>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [LTP] [PATCH] cleanup: avoid to generate many redundant obj files
  2020-02-18 11:59 [LTP] [PATCH] cleanup: avoid to generate many redundant obj files Li Wang
  2020-02-18 14:05 ` Yang Xu
@ 2020-02-19 11:17 ` Xiao Yang
  2020-02-19 12:20   ` Li Wang
  1 sibling, 1 reply; 10+ messages in thread
From: Xiao Yang @ 2020-02-19 11:17 UTC (permalink / raw)
  To: ltp

Hi Li,

Sorry for my late reply?just one question:

For example(ftest):

Why don't you avoid libftest.o as well if you want to build test by new 
rule?

Thanks,

Xiao Yang

On 2/18/20 7:59 PM, Li Wang wrote:
> Signed-off-by: Li Wang <liwang@redhat.com>
> ---
>
> Notes:
>      Travis: https://travis-ci.com/wangli5665/ltp/builds/149424324
>
>   testcases/kernel/fs/ftest/Makefile               | 2 +-
>   testcases/kernel/input/Makefile                  | 2 +-
>   testcases/kernel/io/direct_io/Makefile           | 2 +-
>   testcases/kernel/sched/clisrv/Makefile           | 2 +-
>   testcases/kernel/sched/sched_stress/Makefile     | 2 +-
>   testcases/kernel/syscalls/memfd_create/Makefile  | 2 +-
>   testcases/kernel/syscalls/migrate_pages/Makefile | 2 +-
>   testcases/kernel/syscalls/move_pages/Makefile    | 2 +-
>   testcases/kernel/syscalls/swapoff/Makefile       | 2 +-
>   testcases/kernel/syscalls/swapon/Makefile        | 2 +-
>   testcases/network/nfs/nfslock01/Makefile         | 2 +-
>   testcases/network/stress/ns-tools/Makefile       | 2 +-
>   12 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/testcases/kernel/fs/ftest/Makefile b/testcases/kernel/fs/ftest/Makefile
> index 1566c5c31..e5672d5b1 100644
> --- a/testcases/kernel/fs/ftest/Makefile
> +++ b/testcases/kernel/fs/ftest/Makefile
> @@ -28,4 +28,4 @@ FILTER_OUT_MAKE_TARGETS		:= libftest
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
>   
> -$(MAKE_TARGETS): %: %.o libftest.o
> +$(MAKE_TARGETS): %: libftest.o
> diff --git a/testcases/kernel/input/Makefile b/testcases/kernel/input/Makefile
> index 5f1db9328..f4d35ab39 100644
> --- a/testcases/kernel/input/Makefile
> +++ b/testcases/kernel/input/Makefile
> @@ -24,4 +24,4 @@ FILTER_OUT_MAKE_TARGETS		:= input_helper
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
>   
> -$(MAKE_TARGETS): %: %.o input_helper.o
> +$(MAKE_TARGETS): %: input_helper.o
> diff --git a/testcases/kernel/io/direct_io/Makefile b/testcases/kernel/io/direct_io/Makefile
> index b522136ca..6d26a7ff3 100644
> --- a/testcases/kernel/io/direct_io/Makefile
> +++ b/testcases/kernel/io/direct_io/Makefile
> @@ -30,4 +30,4 @@ INSTALL_TARGETS			:= test_dma_thread_diotest7.sh
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
>   
> -$(MAKE_TARGETS): %: %.o diotest_routines.o
> +$(MAKE_TARGETS): %: diotest_routines.o
> diff --git a/testcases/kernel/sched/clisrv/Makefile b/testcases/kernel/sched/clisrv/Makefile
> index af43b7efd..3e311b65b 100644
> --- a/testcases/kernel/sched/clisrv/Makefile
> +++ b/testcases/kernel/sched/clisrv/Makefile
> @@ -31,6 +31,6 @@ INSTALL_TARGETS		:= data run_sched_cliserv.sh
>   
>   MAKE_TARGETS		:= pthcli pthserv
>   
> -$(MAKE_TARGETS): %: %.o readline.o writen.o
> +$(MAKE_TARGETS): %: readline.o writen.o
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
> diff --git a/testcases/kernel/sched/sched_stress/Makefile b/testcases/kernel/sched/sched_stress/Makefile
> index 60bdc6936..2303f6950 100644
> --- a/testcases/kernel/sched/sched_stress/Makefile
> +++ b/testcases/kernel/sched/sched_stress/Makefile
> @@ -32,7 +32,7 @@ MAKE_TARGETS		:= $(filter-out sched,$(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(
>   
>   RM			+= -r
>   
> -$(filter-out sched_datafile,$(MAKE_TARGETS)): %: %.o sched.o
> +$(filter-out sched_datafile,$(MAKE_TARGETS)): %: sched.o
>   
>   MAKE_TARGETS		+= sched_datafile
>   
> diff --git a/testcases/kernel/syscalls/memfd_create/Makefile b/testcases/kernel/syscalls/memfd_create/Makefile
> index f23b8732c..40ccf7f7f 100644
> --- a/testcases/kernel/syscalls/memfd_create/Makefile
> +++ b/testcases/kernel/syscalls/memfd_create/Makefile
> @@ -20,4 +20,4 @@ FILTER_OUT_MAKE_TARGETS         := memfd_create_common
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
>   
> -$(MAKE_TARGETS): %: %.o memfd_create_common.o
> +$(MAKE_TARGETS): %: memfd_create_common.o
> diff --git a/testcases/kernel/syscalls/migrate_pages/Makefile b/testcases/kernel/syscalls/migrate_pages/Makefile
> index 46a35d3e0..55174f3b8 100644
> --- a/testcases/kernel/syscalls/migrate_pages/Makefile
> +++ b/testcases/kernel/syscalls/migrate_pages/Makefile
> @@ -21,7 +21,7 @@ top_srcdir		?= ../../../..
>   include $(top_srcdir)/include/mk/testcases.mk
>   
>   MAKE_TARGETS		:= $(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(abs_srcdir)/*[0-9].c))
> -$(MAKE_TARGETS): %: %.o migrate_pages_common.o
> +$(MAKE_TARGETS): %: migrate_pages_common.o
>   
>   CPPFLAGS		+= -I$(abs_srcdir)/../utils/
>   
> diff --git a/testcases/kernel/syscalls/move_pages/Makefile b/testcases/kernel/syscalls/move_pages/Makefile
> index 27cf0f7a8..96ff7368f 100644
> --- a/testcases/kernel/syscalls/move_pages/Makefile
> +++ b/testcases/kernel/syscalls/move_pages/Makefile
> @@ -24,7 +24,7 @@ CPPFLAGS		+= -I$(abs_srcdir)/../utils
>   
>   MAKE_TARGETS		:= $(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(abs_srcdir)/*[0-9].c))
>   
> -$(MAKE_TARGETS): %: %.o move_pages_support.o
> +$(MAKE_TARGETS): %: move_pages_support.o
>   
>   LDLIBS			+= -lpthread -lrt
>   
> diff --git a/testcases/kernel/syscalls/swapoff/Makefile b/testcases/kernel/syscalls/swapoff/Makefile
> index 536b2dbac..790a2a74e 100644
> --- a/testcases/kernel/syscalls/swapoff/Makefile
> +++ b/testcases/kernel/syscalls/swapoff/Makefile
> @@ -21,4 +21,4 @@ top_srcdir		?= ../../../..
>   include $(top_srcdir)/include/mk/testcases.mk
>   include $(abs_srcdir)/./Makefile.inc
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
> -$(MAKE_TARGETS): %: %.o ../swapon/libswapon.o
> +$(MAKE_TARGETS): %: ../swapon/libswapon.o
> diff --git a/testcases/kernel/syscalls/swapon/Makefile b/testcases/kernel/syscalls/swapon/Makefile
> index a109ecdf8..a9bd8f19f 100644
> --- a/testcases/kernel/syscalls/swapon/Makefile
> +++ b/testcases/kernel/syscalls/swapon/Makefile
> @@ -29,4 +29,4 @@ FILTER_OUT_MAKE_TARGETS         := libswapon
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
>   
> -$(MAKE_TARGETS): %: %.o libswapon.o
> +$(MAKE_TARGETS): %: libswapon.o
> diff --git a/testcases/network/nfs/nfslock01/Makefile b/testcases/network/nfs/nfslock01/Makefile
> index a07a99ea9..978749a81 100644
> --- a/testcases/network/nfs/nfslock01/Makefile
> +++ b/testcases/network/nfs/nfslock01/Makefile
> @@ -12,4 +12,4 @@ INSTALL_TARGETS			:= nfslock01
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
>   
> -$(MAKE_TARGETS): %: %.o nfs_flock_func.o
> +$(MAKE_TARGETS): %: nfs_flock_func.o
> diff --git a/testcases/network/stress/ns-tools/Makefile b/testcases/network/stress/ns-tools/Makefile
> index 49a05232f..a288066c8 100644
> --- a/testcases/network/stress/ns-tools/Makefile
> +++ b/testcases/network/stress/ns-tools/Makefile
> @@ -35,4 +35,4 @@ FILTER_OUT_MAKE_TARGETS	:= ns-common
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk
>   
> -$(MAKE_TARGETS): %: %.o ns-common.o
> +$(MAKE_TARGETS): %: ns-common.o


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [LTP] [PATCH] cleanup: avoid to generate many redundant obj files
  2020-02-19 11:17 ` Xiao Yang
@ 2020-02-19 12:20   ` Li Wang
  2020-02-19 13:07     ` Xiao Yang
  0 siblings, 1 reply; 10+ messages in thread
From: Li Wang @ 2020-02-19 12:20 UTC (permalink / raw)
  To: ltp

Hi Xiao,

Why don't you avoid libftest.o as well if you want to build test by new
> rule?


That should be generated because it is the local library. In LTP Makefile,
the sequencing is to build the library first then compile&link to the
testcase. We can avoid dumping the testname.o since it only exists in the
last phase.

And, I don't want to change too much for LTP build rule(I think it works
correctly), especially in the case directory some of the local libraries
are reused.  e.g The swapoff test needs linking to ../swapon/libswapon.o,
that requires libswapon.o is in the correct path.

Or, did I misunderstand your words? if yes, please correct me.

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200219/f2185e4b/attachment.htm>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [LTP] [PATCH] cleanup: avoid to generate many redundant obj files
  2020-02-19 12:20   ` Li Wang
@ 2020-02-19 13:07     ` Xiao Yang
  2020-02-19 13:35       ` Xiao Yang
  2020-02-19 13:40       ` Li Wang
  0 siblings, 2 replies; 10+ messages in thread
From: Xiao Yang @ 2020-02-19 13:07 UTC (permalink / raw)
  To: ltp

On 2/19/20 8:20 PM, Li Wang wrote:
> Hi Xiao,
>
>     Why don't you avoid libftest.o as well if you want to build test
>     by new rule?
>
>
> That should be generated?because it is the local library. In LTP 
> Makefile, the sequencing is to build the library first then 
> compile&link?to?the testcase. We can avoid dumping the testname.o 
> since it only exists in the last phase.

Hi Li,

Thanks for your detailed explanation.

I think you try to change the building rule, as below:

Previous rule: generate all object files and then link them at the last 
phase.

---------------------------------------------

gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -W 
-Wold-style-definition -D_FORTIFY_SOURCE=2 
-I/root/ltp/testcases/kernel/syscalls/swapoff/../swapon/ 
-I../../../../include -I../../../../include -I../../../../include/old/? 
-c -o swapoff01.o swapoff01.c
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -W 
-Wold-style-definition -D_FORTIFY_SOURCE=2 
-I/root/ltp/testcases/kernel/syscalls/swapoff/../swapon/ 
-I../../../../include -I../../../../include -I../../../../include/old/? 
-c -o ../swapon/libswapon.o ../swapon/libswapon.c
gcc?? -L/root/ltp/testcases/kernel/syscalls/swapoff/../swapon/ 
-L../../../../lib? swapoff01.o ../swapon/libswapon.o?? -lltp -o swapoff01

---------------------------------------------

Current rule: just generate some common object files(e.g. library) and 
then mix building and link at the last phase.

---------------------------------------------

gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -W 
-Wold-style-definition -D_FORTIFY_SOURCE=2 
-I/root/ltp/testcases/kernel/syscalls/swapoff/../swapon/ 
-I../../../../include -I../../../../include -I../../../../include/old/? 
-c -o ../swapon/libswapon.o ../swapon/libswapon.c
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -W 
-Wold-style-definition -D_FORTIFY_SOURCE=2 
-I/root/ltp/testcases/kernel/syscalls/swapoff/../swapon/ 
-I../../../../include -I../../../../include -I../../../../include/old/ 
-L/root/ltp/testcases/kernel/syscalls/swapoff/../swapon/ 
-L../../../../lib? swapoff01.c ../swapon/libswapon.o?? -lltp -o swapoff01

---------------------------------------------

Why don't you remove all object files and mix building and link at the 
last phase?

---------------------------------------------

gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -W 
-Wold-style-definition -D_FORTIFY_SOURCE=2 
-I/root/ltp/testcases/kernel/syscalls/swapoff/../swapon/ 
-I../../../../include -I../../../../include -I../../../../include/old/ 
-L/root/ltp/testcases/kernel/syscalls/swapoff/../swapon/ 
-L../../../../lib? swapoff01.c ../swapon/libswapon.c?? -lltp -o swapoff01

---------------------------------------------

>
> And, I don't want to change too much for LTP build rule(I think it 
> works correctly), especially in the case directory some of the local 
> libraries are reused.? e.g The swapoff test needs linking to 
> ../swapon/libswapon.o, that requires?libswapon.o?is in the correct path.

You can build and link libswapon.c directly, as below:

---------------------------------

# grep MAKE_TARGETS Makefile
$(MAKE_TARGETS): %: ../swapon/libswapon.c

---------------------------------

Sorry, I am not sure if your improvement is the best way.

Thanks,

Xiao Yang

>
> Or, did I misunderstand your words? if yes, please correct me.
>
> -- 
> Regards,
> Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200219/6a4c8f15/attachment-0001.htm>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [LTP] [PATCH] cleanup: avoid to generate many redundant obj files
  2020-02-19 13:07     ` Xiao Yang
@ 2020-02-19 13:35       ` Xiao Yang
  2020-02-19 13:40         ` Cyril Hrubis
  2020-02-19 13:40       ` Li Wang
  1 sibling, 1 reply; 10+ messages in thread
From: Xiao Yang @ 2020-02-19 13:35 UTC (permalink / raw)
  To: ltp

On 2/19/20 9:07 PM, Xiao Yang wrote:
>
> You can build and link libswapon.c directly, as below:
>
> ---------------------------------
>
> # grep MAKE_TARGETS Makefile
> $(MAKE_TARGETS): %: ../swapon/libswapon.c
>
> ---------------------------------
>
> Sorry, I am not sure if your improvement is the best way.
>
Hi Li,

The root cause is that libswapon.c is built as an object 
file(libswapon.o) instead of a library file(libswapon.so/libswapon.a).

Sorry, I just feel strange about the left *.o files.

Thanks,

Xiao Yang


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [LTP] [PATCH] cleanup: avoid to generate many redundant obj files
  2020-02-19 13:07     ` Xiao Yang
  2020-02-19 13:35       ` Xiao Yang
@ 2020-02-19 13:40       ` Li Wang
  1 sibling, 0 replies; 10+ messages in thread
From: Li Wang @ 2020-02-19 13:40 UTC (permalink / raw)
  To: ltp

Xiao Yang <ice_yangxiao@163.com> wrote:

> Why don't you remove all object files and mix building and link at the
> last phase?
>
As I mentioned the library file shouldn't be deleted.

> And, I don't want to change too much for LTP build rule(I think it works
> correctly), especially in the case directory some of the local libraries
> are reused.  e.g The swapoff test needs linking to ../swapon/libswapon.o,
> that requires libswapon.o is in the correct path.
>
> You can build and link libswapon.c directly, as below:
>
> ---------------------------------
>
> # grep MAKE_TARGETS Makefile
> $(MAKE_TARGETS): %: ../swapon/libswapon.c
>
FWIK, It breaks up the principle of the library design in C compilation, it
just regards the library as a general C file, I think it's a horrible idea.

> ---------------------------------
>
> Sorry, I am not sure if your improvement is the best way.
>
I have never say that's an improvement, that's just a cleanup patch. I just
want the code directory to be cleaner even after compilation.

But if you give a performance evaluation, you will find my build way is a
little faster than previous:).

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200219/37e9425c/attachment.htm>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [LTP] [PATCH] cleanup: avoid to generate many redundant obj files
  2020-02-19 13:35       ` Xiao Yang
@ 2020-02-19 13:40         ` Cyril Hrubis
  2020-02-20  0:45           ` Xiao Yang
  0 siblings, 1 reply; 10+ messages in thread
From: Cyril Hrubis @ 2020-02-19 13:40 UTC (permalink / raw)
  To: ltp

Hi!
> The root cause is that libswapon.c is built as an object 
> file(libswapon.o) instead of a library file(libswapon.so/libswapon.a).
> 
> Sorry, I just feel strange about the left *.o files.

Given that the library is used in both swapon and swapoff tests we may
as well move it to the toplevel libs/ directory as libltpswap, which
would simplify the Makefiles a bit.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [LTP] [PATCH] cleanup: avoid to generate many redundant obj files
  2020-02-19 13:40         ` Cyril Hrubis
@ 2020-02-20  0:45           ` Xiao Yang
  0 siblings, 0 replies; 10+ messages in thread
From: Xiao Yang @ 2020-02-20  0:45 UTC (permalink / raw)
  To: ltp

On 2020/2/19 21:40, Cyril Hrubis wrote:
> Hi!
>> The root cause is that libswapon.c is built as an object
>> file(libswapon.o) instead of a library file(libswapon.so/libswapon.a).
>>
>> Sorry, I just feel strange about the left *.o files.
> Given that the library is used in both swapon and swapoff tests we may
> as well move it to the toplevel libs/ directory as libltpswap, which
> would simplify the Makefiles a bit.
Hi Cyril,

Thanks, and I will look into it as you suggested. :-)

Best Regards,
Xiao Yang




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-02-20  0:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18 11:59 [LTP] [PATCH] cleanup: avoid to generate many redundant obj files Li Wang
2020-02-18 14:05 ` Yang Xu
2020-02-19  3:57   ` Li Wang
2020-02-19 11:17 ` Xiao Yang
2020-02-19 12:20   ` Li Wang
2020-02-19 13:07     ` Xiao Yang
2020-02-19 13:35       ` Xiao Yang
2020-02-19 13:40         ` Cyril Hrubis
2020-02-20  0:45           ` Xiao Yang
2020-02-19 13:40       ` Li Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.