aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/mk
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2024-05-03 22:45:05 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2024-05-03 22:48:32 +0000
commit548bfc56eb0b2cefa0fb8dc2478240bfef610309 (patch)
tree3c1c164f0f32c5a7fda2c35cfbfc5da21d00c8b7 /contrib/bmake/mk
parent6faf65670edda1b567baa9d50bb74ecf90946082 (diff)
parent507951f55039f9d1ceae507d510f8cb68225fbc5 (diff)
Diffstat (limited to 'contrib/bmake/mk')
-rw-r--r--contrib/bmake/mk/ChangeLog36
-rw-r--r--contrib/bmake/mk/FILES1
-rw-r--r--contrib/bmake/mk/init.mk4
-rwxr-xr-xcontrib/bmake/mk/install-mk6
-rw-r--r--contrib/bmake/mk/meta.autodep.mk4
-rw-r--r--contrib/bmake/mk/meta.subdir.mk3
-rw-r--r--contrib/bmake/mk/own.mk5
-rw-r--r--contrib/bmake/mk/progs.mk22
-rw-r--r--contrib/bmake/mk/subdir.mk6
-rw-r--r--contrib/bmake/mk/sys.dirdeps.mk15
-rw-r--r--contrib/bmake/mk/sys/Cygwin.mk21
11 files changed, 94 insertions, 29 deletions
diff --git a/contrib/bmake/mk/ChangeLog b/contrib/bmake/mk/ChangeLog
index c37feedf4353..ee65ea0fadc1 100644
--- a/contrib/bmake/mk/ChangeLog
+++ b/contrib/bmake/mk/ChangeLog
@@ -1,3 +1,39 @@
+2024-04-24 Simon J Gerraty <sjg@beast.crufty.net>
+
+ * meta.autodep.mk: do not override start_utc
+
+2024-04-18 Simon J Gerraty <sjg@beast.crufty.net>
+
+ * sys.dirdeps.mk: set defaults for DEP_* at level 0 too.
+ These help when first include of Makefile.depend happens in a leaf
+ dir.
+
+ * install-mk (MK_VERSION): 20240414
+
+2024-04-09 Simon J Gerraty <sjg@beast.crufty.net>
+
+ * install-mk (MK_VERSION): 20240408
+
+ * init.mk: allow for _ as well as . to join V
+ and Q from QUALIFIED_VAR_LIST and VAR_QUALIFIER_LIST.
+
+ * progs.mk: avoid overlap between PROG_VARS and
+ init.mk's QUALIFIED_VAR_LIST since PROG would also
+ match its VAR_QUALIFIER_LIST,
+ libs.mk does not have the same issue.
+
+ * subdir.mk: _SUBDIRUSE for realinstall should run install
+ remove include of ${.CURDIR}/Makefile.inc that can be done via
+ local.subdir.mk where needed
+
+ * own.mk: do not conflict with man.mk
+
+2024-03-19 Simon J Gerraty <sjg@beast.crufty.net>
+
+ * install-mk (MK_VERSION): 20240314
+
+ * add sys/Cygwin.mk from Christian Franke
+
2024-03-09 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20240309
diff --git a/contrib/bmake/mk/FILES b/contrib/bmake/mk/FILES
index efe9691ffe58..39ac101d36f4 100644
--- a/contrib/bmake/mk/FILES
+++ b/contrib/bmake/mk/FILES
@@ -54,6 +54,7 @@ sys.dependfile.mk
sys.dirdeps.mk
sys.vars.mk
sys/AIX.mk
+sys/Cygwin.mk
sys/Darwin.mk
sys/Generic.mk
sys/HP-UX.mk
diff --git a/contrib/bmake/mk/init.mk b/contrib/bmake/mk/init.mk
index 86dc577371cb..b6619721c943 100644
--- a/contrib/bmake/mk/init.mk
+++ b/contrib/bmake/mk/init.mk
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-2-Clause
#
-# $Id: init.mk,v 1.37 2024/02/25 19:12:13 sjg Exp $
+# $Id: init.mk,v 1.38 2024/04/09 17:18:24 sjg Exp $
#
# @(#) Copyright (c) 2002-2024, Simon J. Gerraty
#
@@ -72,7 +72,7 @@ QUALIFIED_VAR_LIST += \
# a final :U avoids errors if someone uses :=
.for V in ${QUALIFIED_VAR_LIST:O:u:@q@$q $q_LAST@}
.for Q in ${VAR_QUALIFIER_LIST:u}
-$V += ${$V.$Q:U} ${$V.$Q.${COMPILER_TYPE}:U}
+$V += ${$V_$Q:U${$V.$Q:U}} ${V_$Q_${COMPILER_TYPE}:U${$V.$Q.${COMPILER_TYPE}:U}}
.endfor
.endfor
diff --git a/contrib/bmake/mk/install-mk b/contrib/bmake/mk/install-mk
index c9941bb4247e..97874ac49016 100755
--- a/contrib/bmake/mk/install-mk
+++ b/contrib/bmake/mk/install-mk
@@ -59,9 +59,9 @@
# Simon J. Gerraty <sjg@crufty.net>
# RCSid:
-# $Id: install-mk,v 1.250 2024/03/10 02:57:17 sjg Exp $
+# $Id: install-mk,v 1.253 2024/04/18 17:18:31 sjg Exp $
#
-# @(#) Copyright (c) 1994-2023 Simon J. Gerraty
+# @(#) Copyright (c) 1994-2024 Simon J. Gerraty
#
# This file is provided in the hope that it will
# be of use. There is absolutely NO WARRANTY.
@@ -74,7 +74,7 @@
# sjg@crufty.net
#
-MK_VERSION=20240309
+MK_VERSION=20240414
OWNER=
GROUP=
MODE=444
diff --git a/contrib/bmake/mk/meta.autodep.mk b/contrib/bmake/mk/meta.autodep.mk
index 9824570ecc43..55f2d66e56aa 100644
--- a/contrib/bmake/mk/meta.autodep.mk
+++ b/contrib/bmake/mk/meta.autodep.mk
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-2-Clause
#
-# $Id: meta.autodep.mk,v 1.62 2024/02/17 17:26:57 sjg Exp $
+# $Id: meta.autodep.mk,v 1.63 2024/04/24 18:56:41 sjg Exp $
#
# @(#) Copyright (c) 2010, Simon J. Gerraty
@@ -308,7 +308,9 @@ CLEANFILES += *.meta filemon.* *.db
# these make it easy to gather some stats
now_utc ?= ${%s:L:localtime}
+.if !defined(start_utc)
start_utc := ${now_utc}
+.endif
meta_stats= meta=${empty(.MAKE.META.FILES):?0:${.MAKE.META.FILES:[#]}} \
created=${empty(.MAKE.META.CREATED):?0:${.MAKE.META.CREATED:[#]}}
diff --git a/contrib/bmake/mk/meta.subdir.mk b/contrib/bmake/mk/meta.subdir.mk
index e2ece24515a4..aee8a1a9a39b 100644
--- a/contrib/bmake/mk/meta.subdir.mk
+++ b/contrib/bmake/mk/meta.subdir.mk
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-2-Clause
#
-# $Id: meta.subdir.mk,v 1.14 2024/02/17 17:26:57 sjg Exp $
+# $Id: meta.subdir.mk,v 1.15 2024/04/19 15:10:22 sjg Exp $
#
# @(#) Copyright (c) 2010, Simon J. Gerraty
@@ -70,7 +70,6 @@ DIRDEPS := ${DIRDEPS:S,^./,,:S,/./,/,g:${SUBDIRDEPS_FILTER:Uu}}
# dirdeps.mk will compute some interesting combinations.
.undef ALL_MACHINES
-DEP_RELDIR = ${RELDIR}
.include <dirdeps.mk>
.endif
.endif
diff --git a/contrib/bmake/mk/own.mk b/contrib/bmake/mk/own.mk
index efadd3469a8d..72b2f70d4bbe 100644
--- a/contrib/bmake/mk/own.mk
+++ b/contrib/bmake/mk/own.mk
@@ -1,4 +1,4 @@
-# $Id: own.mk,v 1.47 2024/02/19 00:06:19 sjg Exp $
+# $Id: own.mk,v 1.48 2024/04/09 21:52:52 sjg Exp $
# should be set properly in sys.mk
_this ?= ${.PARSEFILE:S,bsd.,,}
@@ -136,8 +136,7 @@ INCDIR?= ${INCLUDEDIR}
# Define MANZ to have the man pages compressed (gzip)
#MANZ= 1
-MANTARGET?= cat
-MANDIR?= ${prefix}/share/man/${MANTARGET}
+MANDIR?= ${prefix}/share/man
MANGRP?= ${BINGRP}
MANOWN?= ${BINOWN}
MANMODE?= ${NONBINMODE}
diff --git a/contrib/bmake/mk/progs.mk b/contrib/bmake/mk/progs.mk
index 815449f331b5..ada942db8621 100644
--- a/contrib/bmake/mk/progs.mk
+++ b/contrib/bmake/mk/progs.mk
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-2-Clause
#
-# $Id: progs.mk,v 1.17 2024/02/17 17:26:57 sjg Exp $
+# $Id: progs.mk,v 1.18 2024/04/09 17:18:24 sjg Exp $
#
# @(#) Copyright (c) 2006, Simon J. Gerraty
#
@@ -39,16 +39,26 @@ PROG ?= $t
# just one of many
PROG_VARS += \
BINDIR \
- CFLAGS \
- COPTS \
- CPPFLAGS \
CXXFLAGS \
DPADD \
DPLIBS \
LDADD \
- LDFLAGS \
MAN \
- SRCS
+
+.ifndef SYS_OS_MK
+# assume we are not using init.mk, otherwise
+# we need to avoid overlap with its
+# QUALIFIED_VAR_LIST which includes these and its
+# VAR_QUALIFIER_LIST includes .TARGET which
+# would match PROG
+PROG_VARS += \
+ CFLAGS \
+ COPTS \
+ CPPFLAGS \
+ LDFLAGS \
+ SRCS \
+
+.endif
.for v in ${PROG_VARS:O:u}
.if defined(${v}.${PROG}) || defined(${v}_${PROG})
diff --git a/contrib/bmake/mk/subdir.mk b/contrib/bmake/mk/subdir.mk
index 4ae21065c865..0feb63af44d2 100644
--- a/contrib/bmake/mk/subdir.mk
+++ b/contrib/bmake/mk/subdir.mk
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-2-Clause
#
-# $Id: subdir.mk,v 1.22 2024/02/19 00:06:19 sjg Exp $
+# $Id: subdir.mk,v 1.24 2024/04/10 01:47:23 sjg Exp $
#
# @(#) Copyright (c) 2002-2024, Simon J. Gerraty
#
@@ -37,7 +37,6 @@ __${_this}__: .NOTMAIN
_SUBDIRUSE:
.elif !commands(_SUBDIRUSE) && !defined(NO_SUBDIR) && !defined(NOSUBDIR)
.-include <local.subdir.mk>
-.-include <${.CURDIR}/Makefile.inc>
.if !target(.MAIN)
.MAIN: all
.endif
@@ -82,7 +81,7 @@ realinstall: beforeinstall _SUBDIRUSE
# the interface from others
# this may require additions to SUBDIR_TAREGTS
-_SUBDIRUSE: .USE subdir-${.TARGET}
+_SUBDIRUSE: .USE subdir-${.TARGET:C/-.*//:S/real//:S/.depend/depend/}
SUBDIR_TARGETS += \
all \
@@ -93,7 +92,6 @@ SUBDIR_TARGETS += \
depend \
lint \
obj \
- realinstall \
tags \
etags
diff --git a/contrib/bmake/mk/sys.dirdeps.mk b/contrib/bmake/mk/sys.dirdeps.mk
index 1e3363c22339..4d2dfa8416fa 100644
--- a/contrib/bmake/mk/sys.dirdeps.mk
+++ b/contrib/bmake/mk/sys.dirdeps.mk
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-2-Clause
#
-# $Id: sys.dirdeps.mk,v 1.14 2024/02/25 19:12:13 sjg Exp $
+# $Id: sys.dirdeps.mk,v 1.15 2024/04/18 17:18:31 sjg Exp $
#
# @(#) Copyright (c) 2012-2023, Simon J. Gerraty
#
@@ -196,11 +196,10 @@ RELSRCTOP?= ${RELTOP}
# just in case
.MAKE.DEPENDFILE ?= Makefile.depend
-.if ${.MAKE.LEVEL} > 0
-# Makefile.depend* also get read at level 1+
-# and often refer to DEP_MACHINE etc,
-# so ensure DEP_* (for TARGET_SPEC_VARS anyway) are set
-.for V in ${TARGET_SPEC_VARS}
-DEP_$V = ${$V}
+# Makefile.depend* often refer to DEP_MACHINE etc,
+# we need defaults for both first include in a leaf dir
+# and when level > 0
+# so ensure DEP_* for TARGET_SPEC_VARS and RELDIR are set
+.for V in ${TARGET_SPEC_VARS} RELDIR
+DEP_$V ?= ${$V}
.endfor
-.endif
diff --git a/contrib/bmake/mk/sys/Cygwin.mk b/contrib/bmake/mk/sys/Cygwin.mk
new file mode 100644
index 000000000000..ffc479ad9ef3
--- /dev/null
+++ b/contrib/bmake/mk/sys/Cygwin.mk
@@ -0,0 +1,21 @@
+# Minimal adjustments for Cygwin
+# SPDX-License-Identifier: BSD-2-Clause
+
+OS ?= Cygwin
+unix ?= We run ${OS}.
+
+.ifndef ROOT_GROUP
+# Cygwin maps local admin SID S-1-5-32-544 to GID 544.
+# /etc/group does no longer exist in a base installation.
+ROOT_GROUP != /usr/bin/getent group 544 2>/dev/null
+ROOT_GROUP := ${ROOT_GROUP:C,:.*$,,}
+.endif
+
+.LIBS: .a
+
+AR ?= ar
+RANLIB ?= ranlib
+TSORT ?= tsort -q
+
+# egrep is deprecated
+EGREP ?= grep -E