summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2022-04-18 18:58:59 -0500
committerDan McDonald <danmcd@mnx.io>2022-05-01 23:01:58 -0400
commit9a40d9026ff9960124e614a13d26ea46b6322e33 (patch)
treef12bf901ea784faa5838e06e53c53effea13a019
parentaef4408962df0a4e5c94b9f2c6c5b23683c6f565 (diff)
downloadillumos-joyent-9a40d9026ff9960124e614a13d26ea46b6322e33.tar.gz
XXXXX BUILD.SO rules shouldn't change search paths, should be consistent
-rw-r--r--usr/src/cmd/perl/Makefile.perl18
-rw-r--r--usr/src/cmd/perl/Makefile.perl.6428
-rw-r--r--usr/src/cmd/perl/Makefile.targ59
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/BSM/Makefile8
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/Makefile27
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/Makefile.com22
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/amd64/Makefile20
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/i386/Makefile19
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/sparc/Makefile19
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/sparcv9/Makefile20
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Makefile36
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Makefile.com30
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/amd64/Makefile20
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/i386/Makefile19
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/sparc/Makefile19
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/sparcv9/Makefile20
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/Makefile33
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/Makefile.com26
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/amd64/Makefile20
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/i386/Makefile19
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/sparc/Makefile19
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/sparcv9/Makefile20
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Pg/Makefile9
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Project/Makefile31
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Project/Makefile.com26
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Project/amd64/Makefile20
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Project/i386/Makefile19
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Project/sparc/Makefile19
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Project/sparcv9/Makefile20
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Task/Makefile27
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Task/Makefile.com22
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Task/amd64/Makefile20
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Task/i386/Makefile19
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Task/sparc/Makefile19
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Task/sparcv9/Makefile20
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Utils/Makefile27
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Utils/Makefile.com22
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Utils/amd64/Makefile20
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Utils/i386/Makefile19
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Utils/sparc/Makefile19
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Utils/sparcv9/Makefile20
-rw-r--r--usr/src/lib/Makefile.lib4
42 files changed, 756 insertions, 167 deletions
diff --git a/usr/src/cmd/perl/Makefile.perl b/usr/src/cmd/perl/Makefile.perl
index 007eca5ba4..fe6d37c226 100644
--- a/usr/src/cmd/perl/Makefile.perl
+++ b/usr/src/cmd/perl/Makefile.perl
@@ -15,10 +15,6 @@
include $(SRC)/lib/Makefile.lib
-# PERL_VERSION and PERL_ARCH used to be set here,
-# but as they were also needed in usr/src/pkg/Makefile,
-# the definition was moved to usr/src/Makefile.master
-
PERLDIR = $(ADJUNCT_PROTO)/usr/perl5/$(PERL_VERSION)
PERLLIBDIR = $(PERLDIR)/lib/$(PERL_ARCH)
PERLINCDIR = $(PERLLIBDIR)/CORE
@@ -30,9 +26,9 @@ PERLBINDIR64 = $(PERLDIR)/bin
$(BUILDPERL64)PERLBINDIR = $(PERLDIR)/bin/$(MACH)
$(BUILDPERL32)PERLBINDIR64 = $(PERLDIR)/bin/$(MACH64)
-PERLMOD = $(MODULE).pm
-PERLEXT = $(MACH)/$(MODULE).so
-PERLEXT64 = $(MACH64)/$(MODULE).so
+PERLMOD = ../$(MODULE).pm
+PERLEXT = $(MODULE).so
+PERLXS = ../$(MODULE).xs
ROOTPERLDIR = $(ROOT)/usr/perl5/$(PERL_VERSION)
ROOTPERLLIBDIR = $(ROOTPERLDIR)/lib/$(PERL_ARCH)
@@ -52,6 +48,14 @@ XSUBPP = $(PERLBINDIR)/perl $(PERLDIR)/lib/ExtUtils/xsubpp \
XSUBPP64 = $(PERLBINDIR64)/perl $(PERLDIR)/lib/ExtUtils/xsubpp \
-typemap $(PERLDIR)/lib/ExtUtils/typemap
+# CFLAGS for perl, specifically.
+PCFLAGS= -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
+ -DPERL_USE_SAFE_PUTENV -D_TS_ERRNO
+PCFLAGS64= -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE_SOURCE64 \
+ -DPERL_USE_SAFE_PUTENV -D_TS_ERRNO
+
CSTD = $(CSTD_GNU99)
ZGUIDANCE =
SONAME = $(PERLEXT)
+
+CLEANFILES += $(PERLEXT) $(MODULE).o $(MODULE).c
diff --git a/usr/src/cmd/perl/Makefile.perl.64 b/usr/src/cmd/perl/Makefile.perl.64
new file mode 100644
index 0000000000..089166ea13
--- /dev/null
+++ b/usr/src/cmd/perl/Makefile.perl.64
@@ -0,0 +1,28 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022 Richard Lowe.
+
+include $(SRC)/lib/Makefile.lib.64
+
+PERLLIBDIR = $(PERLLIBDIR64)
+PERLINCDIR = $(PERLINCDIR64)
+
+ROOTPERLLIBDIR = $(ROOTPERLLIBDIR64)
+ROOTPERLMODDIR = $(ROOTPERLMODDIR64)
+ROOTPERLEXTDIR = $(ROOTPERLEXTDIR64)
+
+ROOTPERLMOD = $(ROOTPERLMOD64)
+ROOTPERLEXT = $(ROOTPERLEXT64)
+
+XSUBPP = $(XSUBPP64)
+
+PCFLAGS = $(PCFLAGS64)
diff --git a/usr/src/cmd/perl/Makefile.targ b/usr/src/cmd/perl/Makefile.targ
index eec6742e0d..a7ef6b9854 100644
--- a/usr/src/cmd/perl/Makefile.targ
+++ b/usr/src/cmd/perl/Makefile.targ
@@ -14,63 +14,40 @@
# Copyright (c) 2018, Joyent, Inc.
# Link against libc as per solaris specs
-$(PERLEXT):= PICS = $(MACH)/$(MODULE).o
-$(PERLEXT):= LDLIBS += -lc
-$(PERLEXT64):= PICS = $(MACH64)/$(MODULE).o
-$(PERLEXT64):= LDLIBS += -lc
-
+PICS = $(MODULE).o
+LDLIBS += -lc
# Allow for undefined symbols satisfied by perl
-$(PERLEXT):= ZDEFS =
-$(PERLEXT64):= ZDEFS =
+ZDEFS =
$(ROOTPERLEXT) := FILEMODE = 0555
$(ROOTPERLMOD) := FILEMODE = 0444
-$(ROOTPERLEXT64) := FILEMODE = 0555
-$(ROOTPERLMOD64) := FILEMODE = 0444
-
-# CFLAGS for perl, specifically.
-PCFLAGS= -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
- -DPERL_USE_SAFE_PUTENV -D_TS_ERRNO
-PCFLAGS64= -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE_SOURCE64 \
- -DPERL_USE_SAFE_PUTENV -D_TS_ERRNO
SMATCH=off
-$(MACH) $(MACH64):
- $(INS.dir)
+.KEEP_STATE:
-$(PERLEXT): $(MACH)/$(MODULE).o
+$(PERLEXT): $(MODULE).o
$(BUILD.SO)
-$(PERLEXT64): $(MACH64)/$(MODULE).o
- $(BUILD64.SO)
-
-$(MACH)/$(MODULE).o: $(MACH)/$(MODULE).c
+$(MODULE).o: $(MODULE).c
$(COMPILE.c) $(PCFLAGS) $(C_PICFLAGS) -I$(PERLINCDIR) $< -o $@
-$(MACH64)/$(MODULE).o: $(MACH64)/$(MODULE).c
- $(COMPILE64.c) $(PCFLAGS64) $(C_PICFLAGS) -I$(PERLINCDIR64) $< -o $@
+$(MODULE).c: $(PERLXS)
+ $(XSUBPP) $(XSUBPPFLAGS) $(PERLXS) -output $@
-$(MACH)/$(MODULE).c: $(MACH) $(MODULE).xs
- $(XSUBPP) $(XSUBPPFLAGS) $(MODULE).xs >$@
-
-$(MACH64)/$(MODULE).c: $(MACH64) $(MODULE).xs
- $(XSUBPP64) $(XSUBPPFLAGS64) $(MODULE).xs >$@
-
-$(ROOTPERLMODDIR) $(ROOTPERLMODDIR64):
+$(ROOTPERLMODDIR):
$(INS.dir)
-$(ROOTPERLMOD): $(ROOTPERLMODDIR) $(MODULE).pm
- $(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
+$(ROOTPERLMOD): $(PERLMOD) $(ROOTPERLMODDIR)
+ $(RM) $@; $(INS) -s -m $(FILEMODE) -f $(@D) $(PERLMOD)
-$(ROOTPERLMOD64): $(ROOTPERLMODDIR64) $(MODULE).pm
- $(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
-
-$(ROOTPERLEXTDIR) $(ROOTPERLEXTDIR64):
+$(ROOTPERLEXTDIR):
$(INS.dir)
-$(ROOTPERLEXT): $(ROOTPERLEXTDIR) $(MACH)/$(MODULE).so
- $(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
+$(ROOTPERLEXT): $(PERLEXT) $(ROOTPERLEXTDIR)
+ $(RM) $@; $(INS) -s -m $(FILEMODE) -f $(@D) $(PERLEXT)
+
+clean:
+ $(RM) $(CLEANFILES)
-$(ROOTPERLEXT64): $(ROOTPERLEXTDIR64) $(MACH64)/$(MODULE).so
- $(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
+clobber: clean
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/BSM/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/BSM/Makefile
index df94b776a6..8e99de801f 100644
--- a/usr/src/cmd/perl/contrib/Sun/Solaris/BSM/Makefile
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/BSM/Makefile
@@ -17,15 +17,15 @@ MODULE = _BSMparse
include $(SRC)/cmd/perl/Makefile.perl
+PERLMOD = $(MODULE).pm
+
# Install module into arch independent directory
ROOTPERLMODDIR = $(ROOTPERLDIR)/lib/Sun/Solaris/BSM
-include $(SRC)/cmd/perl/Makefile.targ
-
.KEEP_STATE:
-all: $(PERLMOD)
+all:
install: $(ROOTPERLMOD)
-clean clobber:
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/Makefile
index b23fb528fb..04d118ed1d 100644
--- a/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/Makefile
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/Makefile
@@ -13,23 +13,20 @@
# Copyright 2016 RackTop Systems.
#
-MODULE = Intrs
+include $(SRC)/Makefile.master
-include $(SRC)/cmd/perl/Makefile.perl
+SUBDIRS=
+$(BUILDPERL32)SUBDIRS += $(MACH)
+$(BUILDPERL64)SUBDIRS += $(MACH64)
-CERRWARN += -_gcc=-Wno-unused-variable
+all := TARGET = all
+install := TARGET = install
+clean := TARGET = clean
+clobber := TARGET = clobber
-MAPFILES = mapfile-vers
+all install clean clobber: $(SUBDIRS)
-include $(SRC)/cmd/perl/Makefile.targ
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
-.KEEP_STATE:
-
-$(BUILDPERL32)all: $(PERLEXT) $(PERLMOD)
-$(BUILDPERL64)all: $(PERLEXT64) $(PERLMOD)
-
-$(BUILDPERL32)install: $(ROOTPERLEXT) $(ROOTPERLMOD)
-$(BUILDPERL64)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
-
-clean clobber:
- $(RM) -r $(MACH) $(MACH64)
+FRC:
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/Makefile.com b/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/Makefile.com
new file mode 100644
index 0000000000..4beae076e5
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/Makefile.com
@@ -0,0 +1,22 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+#
+# Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
+#
+
+MODULE = Intrs
+
+include $(SRC)/cmd/perl/Makefile.perl
+
+CERRWARN += -_gcc=-Wno-unused-variable
+
+MAPFILES = ../mapfile-vers
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/amd64/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/amd64/Makefile
new file mode 100644
index 0000000000..2a5ec9bfb9
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/amd64/Makefile
@@ -0,0 +1,20 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+include $(SRC)/cmd/perl/Makefile.perl.64
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/i386/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/i386/Makefile
new file mode 100644
index 0000000000..3ea2660523
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/i386/Makefile
@@ -0,0 +1,19 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/sparc/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/sparc/Makefile
new file mode 100644
index 0000000000..3ea2660523
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/sparc/Makefile
@@ -0,0 +1,19 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/sparcv9/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/sparcv9/Makefile
new file mode 100644
index 0000000000..2a5ec9bfb9
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/sparcv9/Makefile
@@ -0,0 +1,20 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+include $(SRC)/cmd/perl/Makefile.perl.64
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Makefile
index 49a63b172a..04d118ed1d 100644
--- a/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Makefile
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Makefile
@@ -8,37 +8,25 @@
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
-# Copyright 2014 Gary Mills
#
# Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
# Copyright 2016 RackTop Systems.
#
-MODULE = Kstat
+include $(SRC)/Makefile.master
-include $(SRC)/cmd/perl/Makefile.perl
+SUBDIRS=
+$(BUILDPERL32)SUBDIRS += $(MACH)
+$(BUILDPERL64)SUBDIRS += $(MACH64)
-LDLIBS += -lkstat
+all := TARGET = all
+install := TARGET = install
+clean := TARGET = clean
+clobber := TARGET = clobber
-CERRWARN += -_gcc=-Wno-unused-value
-CERRWARN += -_gcc=-Wno-unused-variable
+all install clean clobber: $(SUBDIRS)
-# Additional include directories only needed for the SPARC platform
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
-$(SPARC_BLD) CPPFLAGS += -I$(ROOT)/usr/platform/sun4u/include \
- -I$(ROOT)/usr/platform/sun4v/include
-
-MAPFILES = mapfile-vers
-
-include $(SRC)/cmd/perl/Makefile.targ
-
-.KEEP_STATE:
-
-$(BUILDPERL32)all: $(PERLEXT) $(PERLMOD)
-$(BUILDPERL64)all: $(PERLEXT64) $(PERLMOD)
-
-$(BUILDPERL32)install: $(ROOTPERLEXT) $(ROOTPERLMOD)
-$(BUILDPERL64)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
-
-clean clobber:
- $(RM) -r $(MACH) $(MACH64)
+FRC:
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Makefile.com b/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Makefile.com
new file mode 100644
index 0000000000..ecc91b096e
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Makefile.com
@@ -0,0 +1,30 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+# Copyright 2014 Gary Mills
+#
+# Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
+#
+
+MODULE = Kstat
+
+include $(SRC)/cmd/perl/Makefile.perl
+
+LDLIBS += -lkstat
+
+CERRWARN += -_gcc=-Wno-unused-value
+CERRWARN += -_gcc=-Wno-unused-variable
+
+# Additional include directories only needed for the SPARC platform
+$(SPARC_BLD)CPPFLAGS += -I$(ROOT)/usr/platform/sun4u/include \
+ -I$(ROOT)/usr/platform/sun4v/include
+
+MAPFILES = ../mapfile-vers
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/amd64/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/amd64/Makefile
new file mode 100644
index 0000000000..2a5ec9bfb9
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/amd64/Makefile
@@ -0,0 +1,20 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+include $(SRC)/cmd/perl/Makefile.perl.64
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/i386/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/i386/Makefile
new file mode 100644
index 0000000000..3ea2660523
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/i386/Makefile
@@ -0,0 +1,19 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/sparc/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/sparc/Makefile
new file mode 100644
index 0000000000..3ea2660523
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/sparc/Makefile
@@ -0,0 +1,19 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/sparcv9/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/sparcv9/Makefile
new file mode 100644
index 0000000000..2a5ec9bfb9
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/sparcv9/Makefile
@@ -0,0 +1,20 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+include $(SRC)/cmd/perl/Makefile.perl.64
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/Makefile
index e2d641dbd8..04d118ed1d 100644
--- a/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/Makefile
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/Makefile
@@ -9,31 +9,24 @@
# http://www.illumos.org/license/CDDL.
#
#
-# Copyright 2014, OmniTI Computer Consulting. All rights reserved.
+# Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
# Copyright 2016 RackTop Systems.
#
-MODULE = Lgrp
+include $(SRC)/Makefile.master
-include $(SRC)/cmd/perl/Makefile.perl
+SUBDIRS=
+$(BUILDPERL32)SUBDIRS += $(MACH)
+$(BUILDPERL64)SUBDIRS += $(MACH64)
-LDLIBS += -llgrp
+all := TARGET = all
+install := TARGET = install
+clean := TARGET = clean
+clobber := TARGET = clobber
-CERRWARN += -_gcc=-Wno-type-limits
+all install clean clobber: $(SUBDIRS)
-XSUBPPFLAGS = -typemap typemap
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
-MAPFILES = mapfile-vers
-
-include $(SRC)/cmd/perl/Makefile.targ
-
-.KEEP_STATE:
-
-$(BUILDPERL32)all: $(PERLEXT) $(PERLMOD)
-$(BUILDPERL64)all: $(PERLEXT64) $(PERLMOD)
-
-$(BUILDPERL32)install: $(ROOTPERLEXT) $(ROOTPERLMOD)
-$(BUILDPERL64)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
-
-clean clobber:
- $(RM) -r $(MACH) $(MACH64)
+FRC:
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/Makefile.com b/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/Makefile.com
new file mode 100644
index 0000000000..734412bd29
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/Makefile.com
@@ -0,0 +1,26 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+#
+# Copyright 2014, OmniTI Computer Consulting. All rights reserved.
+# Copyright 2016 RackTop Systems.
+#
+
+MODULE = Lgrp
+
+include $(SRC)/cmd/perl/Makefile.perl
+
+LDLIBS += -llgrp
+
+CERRWARN += -_gcc=-Wno-type-limits
+
+XSUBPPFLAGS = -typemap typemap
+
+MAPFILES = ../mapfile-vers
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/amd64/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/amd64/Makefile
new file mode 100644
index 0000000000..2a5ec9bfb9
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/amd64/Makefile
@@ -0,0 +1,20 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+include $(SRC)/cmd/perl/Makefile.perl.64
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/i386/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/i386/Makefile
new file mode 100644
index 0000000000..3ea2660523
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/i386/Makefile
@@ -0,0 +1,19 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/sparc/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/sparc/Makefile
new file mode 100644
index 0000000000..3ea2660523
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/sparc/Makefile
@@ -0,0 +1,19 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/sparcv9/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/sparcv9/Makefile
new file mode 100644
index 0000000000..2a5ec9bfb9
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/sparcv9/Makefile
@@ -0,0 +1,20 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+include $(SRC)/cmd/perl/Makefile.perl.64
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Pg/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Pg/Makefile
index 0491584ea7..6d5be48d41 100644
--- a/usr/src/cmd/perl/contrib/Sun/Solaris/Pg/Makefile
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Pg/Makefile
@@ -17,15 +17,14 @@ MODULE = Pg
include $(SRC)/cmd/perl/Makefile.perl
+PERLMOD = $(MODULE).pm
+
# Install module into arch independent directory
ROOTPERLMODDIR = $(ROOTPERLDIR)/lib/Sun/Solaris
-include $(SRC)/cmd/perl/Makefile.targ
-
.KEEP_STATE:
-all: $(PERLMOD)
-
+all:
install: $(ROOTPERLMOD)
-clean clobber:
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Project/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Project/Makefile
index 56e93da14a..04d118ed1d 100644
--- a/usr/src/cmd/perl/contrib/Sun/Solaris/Project/Makefile
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Project/Makefile
@@ -13,27 +13,20 @@
# Copyright 2016 RackTop Systems.
#
-MODULE = Project
+include $(SRC)/Makefile.master
-include $(SRC)/cmd/perl/Makefile.perl
+SUBDIRS=
+$(BUILDPERL32)SUBDIRS += $(MACH)
+$(BUILDPERL64)SUBDIRS += $(MACH64)
-LDLIBS += -lproject -lgen
+all := TARGET = all
+install := TARGET = install
+clean := TARGET = clean
+clobber := TARGET = clobber
-CERRWARN += -_gcc=-Wno-unused-variable
+all install clean clobber: $(SUBDIRS)
-XSUBPPFLAGS = -typemap typemap
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
-MAPFILES = mapfile-vers
-
-include $(SRC)/cmd/perl/Makefile.targ
-
-.KEEP_STATE:
-
-$(BUILDPERL32)all: $(PERLEXT) $(PERLMOD)
-$(BUILDPERL64)all: $(PERLEXT64) $(PERLMOD)
-
-$(BUILDPERL32)install: $(ROOTPERLEXT) $(ROOTPERLMOD)
-$(BUILDPERL64)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
-
-clean clobber:
- $(RM) -r $(MACH) $(MACH64)
+FRC:
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Project/Makefile.com b/usr/src/cmd/perl/contrib/Sun/Solaris/Project/Makefile.com
new file mode 100644
index 0000000000..4f0641238d
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Project/Makefile.com
@@ -0,0 +1,26 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+#
+# Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
+#
+
+MODULE = Project
+
+include $(SRC)/cmd/perl/Makefile.perl
+
+LDLIBS += -lproject -lgen
+
+CERRWARN += -_gcc=-Wno-unused-variable
+
+XSUBPPFLAGS = -typemap typemap
+
+MAPFILES = ../mapfile-vers
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Project/amd64/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Project/amd64/Makefile
new file mode 100644
index 0000000000..2a5ec9bfb9
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Project/amd64/Makefile
@@ -0,0 +1,20 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+include $(SRC)/cmd/perl/Makefile.perl.64
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Project/i386/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Project/i386/Makefile
new file mode 100644
index 0000000000..3ea2660523
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Project/i386/Makefile
@@ -0,0 +1,19 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Project/sparc/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Project/sparc/Makefile
new file mode 100644
index 0000000000..3ea2660523
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Project/sparc/Makefile
@@ -0,0 +1,19 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Project/sparcv9/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Project/sparcv9/Makefile
new file mode 100644
index 0000000000..2a5ec9bfb9
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Project/sparcv9/Makefile
@@ -0,0 +1,20 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+include $(SRC)/cmd/perl/Makefile.perl.64
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Task/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Task/Makefile
index 0d4bed08ce..04d118ed1d 100644
--- a/usr/src/cmd/perl/contrib/Sun/Solaris/Task/Makefile
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Task/Makefile
@@ -13,23 +13,20 @@
# Copyright 2016 RackTop Systems.
#
-MODULE = Task
+include $(SRC)/Makefile.master
-include $(SRC)/cmd/perl/Makefile.perl
+SUBDIRS=
+$(BUILDPERL32)SUBDIRS += $(MACH)
+$(BUILDPERL64)SUBDIRS += $(MACH64)
-XSUBPPFLAGS = -typemap typemap
+all := TARGET = all
+install := TARGET = install
+clean := TARGET = clean
+clobber := TARGET = clobber
-MAPFILES = mapfile-vers
+all install clean clobber: $(SUBDIRS)
-include $(SRC)/cmd/perl/Makefile.targ
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
-.KEEP_STATE:
-
-$(BUILDPERL32)all: $(PERLEXT) $(PERLMOD)
-$(BUILDPERL64)all: $(PERLEXT64) $(PERLMOD)
-
-$(BUILDPERL32)install: $(ROOTPERLEXT) $(ROOTPERLMOD)
-$(BUILDPERL64)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
-
-clean clobber:
- $(RM) -r $(MACH) $(MACH64)
+FRC:
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Task/Makefile.com b/usr/src/cmd/perl/contrib/Sun/Solaris/Task/Makefile.com
new file mode 100644
index 0000000000..f0e6b8b5fa
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Task/Makefile.com
@@ -0,0 +1,22 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+#
+# Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
+#
+
+MODULE = Task
+
+include $(SRC)/cmd/perl/Makefile.perl
+
+XSUBPPFLAGS = -typemap typemap
+
+MAPFILES = ../mapfile-vers
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Task/amd64/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Task/amd64/Makefile
new file mode 100644
index 0000000000..2a5ec9bfb9
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Task/amd64/Makefile
@@ -0,0 +1,20 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+include $(SRC)/cmd/perl/Makefile.perl.64
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Task/i386/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Task/i386/Makefile
new file mode 100644
index 0000000000..3ea2660523
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Task/i386/Makefile
@@ -0,0 +1,19 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Task/sparc/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Task/sparc/Makefile
new file mode 100644
index 0000000000..3ea2660523
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Task/sparc/Makefile
@@ -0,0 +1,19 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Task/sparcv9/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Task/sparcv9/Makefile
new file mode 100644
index 0000000000..2a5ec9bfb9
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Task/sparcv9/Makefile
@@ -0,0 +1,20 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+include $(SRC)/cmd/perl/Makefile.perl.64
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/Makefile
index d64b4bc9c6..04d118ed1d 100644
--- a/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/Makefile
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/Makefile
@@ -13,23 +13,20 @@
# Copyright 2016 RackTop Systems.
#
-MODULE = Utils
+include $(SRC)/Makefile.master
-include $(SRC)/cmd/perl/Makefile.perl
+SUBDIRS=
+$(BUILDPERL32)SUBDIRS += $(MACH)
+$(BUILDPERL64)SUBDIRS += $(MACH64)
-LDLIBS += -lgen -lintl
+all := TARGET = all
+install := TARGET = install
+clean := TARGET = clean
+clobber := TARGET = clobber
-MAPFILES = mapfile-vers
+all install clean clobber: $(SUBDIRS)
-include $(SRC)/cmd/perl/Makefile.targ
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
-.KEEP_STATE:
-
-$(BUILDPERL32)all: $(PERLEXT) $(PERLMOD)
-$(BUILDPERL64)all: $(PERLEXT64) $(PERLMOD)
-
-$(BUILDPERL32)install: $(ROOTPERLEXT) $(ROOTPERLMOD)
-$(BUILDPERL64)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
-
-clean clobber:
- $(RM) -r $(MACH) $(MACH64)
+FRC:
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/Makefile.com b/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/Makefile.com
new file mode 100644
index 0000000000..722b815ac2
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/Makefile.com
@@ -0,0 +1,22 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+#
+# Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
+#
+
+MODULE = Utils
+
+include $(SRC)/cmd/perl/Makefile.perl
+
+LDLIBS += -lgen -lintl
+
+MAPFILES = ../mapfile-vers
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/amd64/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/amd64/Makefile
new file mode 100644
index 0000000000..2a5ec9bfb9
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/amd64/Makefile
@@ -0,0 +1,20 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+include $(SRC)/cmd/perl/Makefile.perl.64
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/i386/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/i386/Makefile
new file mode 100644
index 0000000000..3ea2660523
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/i386/Makefile
@@ -0,0 +1,19 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/sparc/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/sparc/Makefile
new file mode 100644
index 0000000000..3ea2660523
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/sparc/Makefile
@@ -0,0 +1,19 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/sparcv9/Makefile b/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/sparcv9/Makefile
new file mode 100644
index 0000000000..2a5ec9bfb9
--- /dev/null
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/sparcv9/Makefile
@@ -0,0 +1,20 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2022, Richard Lowe.
+
+include ../Makefile.com
+include $(SRC)/cmd/perl/Makefile.perl.64
+
+all: $(PERLEXT)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+
+include $(SRC)/cmd/perl/Makefile.targ
diff --git a/usr/src/lib/Makefile.lib b/usr/src/lib/Makefile.lib
index 43a32f2009..bbd5120309 100644
--- a/usr/src/lib/Makefile.lib
+++ b/usr/src/lib/Makefile.lib
@@ -167,9 +167,9 @@ BUILD.AR= $(AR) $(ARFLAGS) $@ $(AROBJS)
BUILD.SO= $(CC) $(CFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
$(PICS) $(EXTPICS) $(USDT_PICS) $(LDLIBS)
BUILD64.SO= $(CC64) $(CFLAGS64) -o $@ $(GSHARED) $(DYNFLAGS) \
- $(PICS) $(EXTPICS) -L $(ROOTLIBDIR64) $(LDLIBS)
-BUILDCCC.SO= $(CCC) $(CCFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
$(PICS) $(EXTPICS) $(LDLIBS)
+BUILDCCC.SO= $(CCC) $(CCFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
+ $(PICS) $(EXTPICS) $(LDLIBS) $(CCNEEDED)
BUILDCCC64.SO= $(CCC64) $(CCFLAGS64) -o $@ $(GSHARED) $(DYNFLAGS) \
$(PICS) $(EXTPICS) $(LDLIBS) $(CCNEEDED64)