Whamcloud - gitweb
LU-8837 lustre: make ldlm and target file lists 67/41767/11
authorMr NeilBrown <neilb@suse.de>
Thu, 27 Oct 2022 19:15:00 +0000 (15:15 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 8 Nov 2022 08:51:40 +0000 (08:51 +0000)
Instead of listing files for ldlm and target in ptlrpc,
list them in Makefile.in in the respective directories.

This requires that Makefile.am be moved to autoMakefile.am to preserve
MOSTLYCLEANFILES.

This simplifies the makefiles in preparation for changes in what is
included on the client.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I9f937e9460f1fe2ef436f8f7ace8999dd510885e
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/41767
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/Makefile.in
lustre/autoconf/lustre-core.m4
lustre/ldlm/.gitignore [deleted file]
lustre/ldlm/Makefile.in [new file with mode: 0644]
lustre/ldlm/autoMakefile.am [moved from lustre/ldlm/Makefile.am with 80% similarity]
lustre/ptlrpc/Makefile.in
lustre/target/.gitignore [deleted file]
lustre/target/Makefile.in [new file with mode: 0644]
lustre/target/autoMakefile.am [moved from lustre/target/Makefile.am with 58% similarity]

index c5a0f67..1cde69a 100644 (file)
@@ -1,12 +1,13 @@
 obj-m += fid/
 obj-m += obdclass/
 obj-m += ptlrpc/
+obj-m += ldlm/
 obj-m += obdecho/
 obj-m += mgc/
 obj-m += ec/
 obj-m += tests/kernel/
 
-@SERVER_TRUE@obj-m += ost/ mgs/ mdt/ mdd/ ofd/ quota/ osp/ lod/ lfsck/
+@SERVER_TRUE@obj-m += ost/ mgs/ mdt/ mdd/ ofd/ quota/ osp/ lod/ lfsck/ target/
 @CLIENT_TRUE@obj-m += lov/ osc/ mdc/ lmv/ llite/ fld/
 @LDISKFS_ENABLED_TRUE@obj-m += osd-ldiskfs/
 @ZFS_ENABLED_TRUE@obj-m += osd-zfs/
index 7de9350..3948f0c 100644 (file)
@@ -3339,6 +3339,7 @@ lustre/kernel_patches/targets/5.3-sles15sp3.target
 lustre/kernel_patches/targets/5.14-sles15sp4.target
 lustre/kernel_patches/targets/3.x-fc18.target
 lustre/ldlm/Makefile
+lustre/ldlm/autoMakefile
 lustre/ec/autoMakefile
 lustre/ec/Makefile
 lustre/fid/Makefile
@@ -3378,6 +3379,7 @@ lustre/mgc/autoMakefile
 lustre/mgs/Makefile
 lustre/mgs/autoMakefile
 lustre/target/Makefile
+lustre/target/autoMakefile
 lustre/ptlrpc/Makefile
 lustre/ptlrpc/autoMakefile
 lustre/ptlrpc/gss/Makefile
diff --git a/lustre/ldlm/.gitignore b/lustre/ldlm/.gitignore
deleted file mode 100644 (file)
index 10a7e8d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/Makefile.in
diff --git a/lustre/ldlm/Makefile.in b/lustre/ldlm/Makefile.in
new file mode 100644 (file)
index 0000000..580ed1e
--- /dev/null
@@ -0,0 +1,14 @@
+# This is included by ptlrpc
+
+ldlm_objs := l_lock.o ldlm_lock.o
+ldlm_objs += ldlm_resource.o ldlm_lib.o
+ldlm_objs += ldlm_plain.o ldlm_extent.o
+ldlm_objs += ldlm_request.o ldlm_lockd.o
+ldlm_objs += ldlm_flock.o ldlm_inodebits.o
+ldlm_objs += ldlm_pool.o ldlm_reclaim.o
+
+EXTRA_DIST = $(ldlm_objs:.o=.c) $(ldlm_server_objs:.o=.c) ldlm_internal.h
+
+ifneq "$(MODULES)" "ptlrpc"
+@INCLUDE_RULES@
+endif
similarity index 80%
rename from lustre/ldlm/Makefile.am
rename to lustre/ldlm/autoMakefile.am
index 8d89d0a..12157cb 100644 (file)
@@ -35,8 +35,4 @@
 # ldlm is built into ptlrpc
 #
 
-MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ 
-EXTRA_DIST = ldlm_extent.c ldlm_flock.c ldlm_internal.h ldlm_lib.c \
-       ldlm_lock.c ldlm_lockd.c ldlm_plain.c ldlm_request.c         \
-       ldlm_resource.c l_lock.c ldlm_inodebits.c ldlm_pool.c        \
-       ldlm_reclaim.c
+MOSTLYCLEANFILES := @MOSTLYCLEANFILES@
index 82f2e10..470941a 100644 (file)
@@ -1,21 +1,8 @@
 MODULES := ptlrpc
+ptlrpc_dir := $(dir $(lastword $(MAKEFILE_LIST)))
 LDLM := @top_srcdir@/lustre/ldlm/
 TARGET := @top_srcdir@/lustre/target/
 
-ldlm_objs := $(LDLM)l_lock.o $(LDLM)ldlm_lock.o
-ldlm_objs += $(LDLM)ldlm_resource.o $(LDLM)ldlm_lib.o
-ldlm_objs += $(LDLM)ldlm_plain.o $(LDLM)ldlm_extent.o
-ldlm_objs += $(LDLM)ldlm_request.o $(LDLM)ldlm_lockd.o
-ldlm_objs += $(LDLM)ldlm_flock.o $(LDLM)ldlm_inodebits.o
-ldlm_objs += $(LDLM)ldlm_pool.o $(LDLM)ldlm_reclaim.o
-
-target_objs := $(TARGET)tgt_main.o $(TARGET)tgt_lastrcvd.o
-target_objs += $(TARGET)tgt_handler.o $(TARGET)out_handler.o
-target_objs += $(TARGET)out_lib.o $(TARGET)update_trans.o
-target_objs += $(TARGET)update_records.o $(TARGET)update_recovery.o
-target_objs += $(TARGET)tgt_grant.o $(TARGET)tgt_fmd.o
-target_objs += $(TARGET)tgt_mount.o $(TARGET)barrier.o
-
 ptlrpc_objs := client.o recover.o connection.o niobuf.o pack_generic.o
 ptlrpc_objs += events.o ptlrpc_module.o service.o pinger.o
 ptlrpc_objs += llog_net.o llog_client.o import.o ptlrpcd.o
@@ -30,29 +17,19 @@ nodemap_objs := nodemap_handler.o nodemap_lproc.o nodemap_range.o
 nodemap_objs += nodemap_idmap.o nodemap_rbtree.o nodemap_member.o
 nodemap_objs += nodemap_storage.o
 
-ptlrpc-objs := $(ldlm_objs) $(ptlrpc_objs)
-@SERVER_TRUE@ptlrpc-objs += $(target_objs) $(nodemap_objs) $(nrs_server_objs)
+include $(ptlrpc_dir)/../ldlm/Makefile
+include $(ptlrpc_dir)/../target/Makefile
+
+ptlrpc-objs := $(ptlrpc_objs)
+ptlrpc-objs += $(patsubst %,$(LDLM)%,$(ldlm_objs))
+@SERVER_TRUE@ptlrpc-objs += $(nodemap_objs) $(nrs_server_objs)
 @SERVER_TRUE@ptlrpc-objs += pack_server.o llog_server.o
+@SERVER_TRUE@ptlrpc-objs += $(patsubst %,$(TARGET)%,$(target_objs))
 
 @GSS_TRUE@obj-m += gss/
 
 default: all
 
-ldlm_%.c: @LUSTRE@/ldlm/ldlm_%.c
-       ln -sf $< $@
-
-l_lock.c: @LUSTRE@/ldlm/l_lock.c
-       ln -sf $< $@
-
-tgt_%.c: @LUSTRE@/target/tgt_%.c
-       ln -sf $< $@
-
-out_%.c: @LUSTRE@/target/out_%.c
-       ln -sf $< $@
-
-barrier.c: @LUSTRE@/target/barrier.c
-       ln -sf $< $@
-
 EXTRA_DIST := $(ptlrpc_objs:.o=.c) ptlrpc_internal.h
 EXTRA_DIST += $(nodemap_objs:.o=.c) nodemap_internal.h heap.h
 EXTRA_DIST += $(nrs_server_objs:.o=.c)
diff --git a/lustre/target/.gitignore b/lustre/target/.gitignore
deleted file mode 100644 (file)
index 10a7e8d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/Makefile.in
diff --git a/lustre/target/Makefile.in b/lustre/target/Makefile.in
new file mode 100644 (file)
index 0000000..5093f11
--- /dev/null
@@ -0,0 +1,14 @@
+# This is included by ptlrpc
+
+target_objs := tgt_main.o tgt_lastrcvd.o
+target_objs += tgt_handler.o out_handler.o
+target_objs += out_lib.o update_trans.o
+target_objs += update_records.o update_recovery.o
+target_objs += tgt_grant.o tgt_fmd.o barrier.o
+target_objs += tgt_mount.o
+
+EXTRA_DIST = $(target_objs:.o=.c) tgt_internal.h
+
+ifneq "$(MODULES)" "ptlrpc"
+@INCLUDE_RULES@
+endif
similarity index 58%
rename from lustre/target/Makefile.am
rename to lustre/target/autoMakefile.am
index 2dedb56..9207e44 100644 (file)
 # in the LICENSE file that accompanied this code).
 #
 # You should have received a copy of the GNU General Public License
-# version 2 along with this program; if not, write to the
-# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 021110-1307, USA
+# version 2 along with this program; If not, see
+# http://www.gnu.org/licenses/gpl-2.0.html
 #
 # GPL HEADER END
 #
 
-#
-# Copyright (c) 2012, 2017, Intel Corporation.
-# Use is subject to license terms.
-#
-
-#
-# target is built into ptlrpc
-#
-
 MOSTLYCLEANFILES := @MOSTLYCLEANFILES@
-EXTRA_DIST = tgt_main.c tgt_lastrcvd.c tgt_handler.c tgt_internal.h \
-            tgt_grant.c out_handler.c out_lib.c barrier.c tgt_fmd.c \
-            tgt_mount.c
-EXTRA_DIST += update_trans.c
-EXTRA_DIST += update_records.c
-EXTRA_DIST += update_recovery.c