From 644b348bcb2669a60e50fa200efc56ba6f432a62 Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Thu, 16 Feb 2023 16:47:01 -0800 Subject: [PATCH] minor Makefile changes Changes #! lines in Makefiles to "#!/usr/bin/env make". Set SHELL in Makefiles to the basename of the shell. --- CHANGES | 4 ++++ Makefile | 20 +++++++++++--------- Makefile.local | 1 + Makefile.simple | 30 ++++++++++++++++++++++++------ cal/Makefile | 15 ++++++++------- cscript/Makefile | 14 ++++++++------ custom/Makefile | 17 +++++++++-------- custom/Makefile.simple | 14 +++++++------- help/Makefile | 15 ++++++++------- rpm.mk | 7 +++---- 10 files changed, 83 insertions(+), 54 deletions(-) diff --git a/CHANGES b/CHANGES index c41e6b6..0d77919 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,10 @@ The following are the changes from calc version 2.14.2.3 to date: build calc RPMs on a reference RHEL8.7 platform (formerly a RHEL7.9 platform). + Changes #! lines in Makefiles to "#!/usr/bin/env make". + + Set SHELL in Makefiles to the basename of the shell. + The following are the changes from calc version 2.14.2.0 to 2.14.1.2: diff --git a/Makefile b/Makefile index e9a7506..ad899f7 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ -#!/bin/make +#!/usr/bin/env make # # calc - arbitrary precision calculator # -# Copyright (C) 1999-2018,2021,2022 Landon Curt Noll +# Copyright (C) 1999-2018,2021-2023 Landon Curt Noll # # SRC: Makefile - top level Makefile # @@ -49,6 +49,7 @@ ifndef EXCLUDE_FROM_CUSTOM_MAKEFILE # The section continues until the next line that # # starts with a '# End skipping ..' comment line. # ################################################### +#endif /* end of skip for non-Gnu makefiles */ # Unfortunately due to the complex dependency issues between # Makefile, Makefile.ship and custom/Makefile, parallel GNU make @@ -65,7 +66,8 @@ ifndef EXCLUDE_FROM_CUSTOM_MAKEFILE # NOTE: You can force a target value by defining target as in: # # make ...__optional_arguments_... target=value - +# +#if 0 /* start of skip for non-Gnu makefiles */ # Try uname -s if the target was not already set on the make command line # ifeq ($(target),) @@ -80,9 +82,8 @@ endif ifeq ($(MINGW),) MINGW=$(shell uname -o 2>/dev/null) endif -# #endif /* end of skip for non-Gnu makefiles */ -# + # The shell used by this Makefile # # On some systems, /bin/sh is a rather reduced shell with @@ -91,17 +92,17 @@ endif # If your system has a up to date, bash shell, then # you may wish to use: # -# SHELL= /bin/bash +# SHELL= bash # # On some systems such as macOS, the bash shell is very # far behind to the point where is cannot be depended on. # On such systems, the sh may be a much better alternative # shell for this Makefile to use: # -# SHELL= /bin/sh +# SHELL= sh # -SHELL= /bin/bash -#SHELL= /bin/sh +SHELL= bash +#SHELL= sh #if 0 /* start of skip for non-Gnu makefiles */ # ifeq ($(target),Darwin) @@ -118,6 +119,7 @@ endif # #endif /* end of skip for non-Gnu makefiles */ + ############################################################################## #-=-=-=-=-=-=-=-=- You may want to change some values below -=-=-=-=-=-=-=-=-# ############################################################################## diff --git a/Makefile.local b/Makefile.local index e6f8b3d..281f417 100644 --- a/Makefile.local +++ b/Makefile.local @@ -1,3 +1,4 @@ +#!/usr/bin/env make # # Makefile.local - local Makefile variables # diff --git a/Makefile.simple b/Makefile.simple index cf7a3ea..ef55f76 100644 --- a/Makefile.simple +++ b/Makefile.simple @@ -1,8 +1,8 @@ -#!/bin/make +#!/usr/bin/env make # # calc - arbitrary precision calculator # -# Copyright (C) 1999-2018,2021,2022 Landon Curt Noll +# Copyright (C) 1999-2018,2021-2023 Landon Curt Noll # # SRC: Makefile.simple - non-GNU version # @@ -37,7 +37,24 @@ # + +# Unfortunately due to the complex dependency issues between +# Makefile, Makefile.ship and custom/Makefile, parallel GNU make +# is NOT recommended. Sorry. # +# XXX - fix this - XXX +# +.NOTPARALLEL: + +############################################################################## +#-=-=-=-=-=-=-=-=- Identify the target machine, if possible -=-=-=-=-=-=-=-=-# +############################################################################## + +# NOTE: You can force a target value by defining target as in: +# +# make ...__optional_arguments_... target=value +# + # The shell used by this Makefile # # On some systems, /bin/sh is a rather reduced shell with @@ -46,17 +63,18 @@ # If your system has a up to date, bash shell, then # you may wish to use: # -# SHELL= /bin/bash +# SHELL= bash # # On some systems such as macOS, the bash shell is very # far behind to the point where is cannot be depended on. # On such systems, the sh may be a much better alternative # shell for this Makefile to use: # -# SHELL= /bin/sh +# SHELL= sh # -SHELL= /bin/bash -#SHELL= /bin/sh +SHELL= bash +#SHELL= sh + ############################################################################## #-=-=-=-=-=-=-=-=- You may want to change some values below -=-=-=-=-=-=-=-=-# diff --git a/cal/Makefile b/cal/Makefile index 4bdff7f..e093bc4 100644 --- a/cal/Makefile +++ b/cal/Makefile @@ -1,8 +1,8 @@ -#!/bin/make +#!/usr/bin/env make # # cal - makefile for calc standard resource files # -# Copyright (C) 1999-2006,2017,2021,2022 Landon Curt Noll +# Copyright (C) 1999-2006,2017,2021-2023 Landon Curt Noll # # SRC: cal/Makefile # @@ -44,20 +44,21 @@ # If your system has a up to date, bash shell, then # you may wish to use: # -# SHELL= /bin/bash +# SHELL= bash # # On some systems such as macOS, the bash shell is very # far behind to the point where is cannot be depended on. # On such systems, the sh may be a much better alternative # shell for this Makefile to use: # -# SHELL= /bin/sh +# SHELL= sh # -SHELL= /bin/bash -#SHELL= /bin/sh +SHELL= bash +#SHELL= sh #if 0 /* start of skip for non-Gnu makefiles */ +# ifeq ($(target),Darwin) -SHELL:= /bin/zsh +SHELL:= /bin/sh endif #endif /* end of skip for non-Gnu makefiles */ diff --git a/cscript/Makefile b/cscript/Makefile index fd750e7..54cbe24 100644 --- a/cscript/Makefile +++ b/cscript/Makefile @@ -1,7 +1,8 @@ +#!/usr/bin/env make # # cscript - makefile for calc shell script files # -# Copyright (C) 1999-2006,2014,2017,2021,2022 Landon Curt Noll +# Copyright (C) 1999-2006,2014,2017,2021-2023 Landon Curt Noll # # SRC: cscript/Makefile # @@ -43,20 +44,21 @@ # If your system has a up to date, bash shell, then # you may wish to use: # -# SHELL= /bin/bash +# SHELL= bash # # On some systems such as macOS, the bash shell is very # far behind to the point where is cannot be depended on. # On such systems, the sh may be a much better alternative # shell for this Makefile to use: # -# SHELL= /bin/sh +# SHELL= sh # -SHELL= /bin/bash -#SHELL= /bin/sh +SHELL= bash +#SHELL= sh #if 0 /* start of skip for non-Gnu makefiles */ +# ifeq ($(target),Darwin) -SHELL:= /bin/zsh +SHELL:= /bin/sh endif #endif /* end of skip for non-Gnu makefiles */ diff --git a/custom/Makefile b/custom/Makefile index 630a641..feaa721 100644 --- a/custom/Makefile +++ b/custom/Makefile @@ -1,8 +1,8 @@ -#!/bin/make +#!/usr/bin/env make # # custom - makefile for calc custom routines # -# Copyright (C) 1999-2006,2014,2017-2018,2021 Landon Curt Noll +# Copyright (C) 1999-2006,2014,2017-2018,2021,2023 Landon Curt Noll # # SRC: custom/Makefile # @@ -44,20 +44,21 @@ # If your system has a up to date, bash shell, then # you may wish to use: # -# SHELL= /bin/bash +# SHELL= bash # # On some systems such as macOS, the bash shell is very # far behind to the point where is cannot be depended on. -# On such systems, the zsh may be a much better alternative +# On such systems, the sh may be a much better alternative # shell for this Makefile to use: # -# SHELL= /bin/zsh +# SHELL= sh # -SHELL= /bin/bash -#SHELL= /bin/sh +SHELL= bash +#SHELL= sh #if 0 /* start of skip for non-Gnu makefiles */ +# ifeq ($(target),Darwin) -SHELL:= /bin/zsh +SHELL:= /bin/sh endif #endif /* end of skip for non-Gnu makefiles */ diff --git a/custom/Makefile.simple b/custom/Makefile.simple index 6298aa2..4f08262 100644 --- a/custom/Makefile.simple +++ b/custom/Makefile.simple @@ -1,8 +1,8 @@ -#!/bin/make +#!/usr/bin/env make # # custom - makefile for calc custom routines # -# Copyright (C) 1999-2006,2014,2017-2018,2021 Landon Curt Noll +# Copyright (C) 1999-2006,2014,2017-2018,2021,2023 Landon Curt Noll # # SRC: custom/Makefile.simple - non-GNU version # @@ -44,17 +44,17 @@ # If your system has a up to date, bash shell, then # you may wish to use: # -# SHELL= /bin/bash +# SHELL= bash # # On some systems such as macOS, the bash shell is very # far behind to the point where is cannot be depended on. -# On such systems, the zsh may be a much better alternative +# On such systems, the sh may be a much better alternative # shell for this Makefile to use: # -# SHELL= /bin/zsh +# SHELL= sh # -SHELL= /bin/bash -#SHELL= /bin/sh +SHELL= bash +#SHELL= sh # PREFIX - Top level location for calc diff --git a/help/Makefile b/help/Makefile index 2c5e729..e436fc6 100644 --- a/help/Makefile +++ b/help/Makefile @@ -1,8 +1,8 @@ -#!/bin/make +#!/usr/bin/env make # # help - makefile for calc help files # -# Copyright (C) 1999-2006,2017,2021,2022 Landon Curt Noll +# Copyright (C) 1999-2006,2017,2021-2023 Landon Curt Noll # # SRC: help/Makefile # @@ -44,20 +44,21 @@ # If your system has a up to date, bash shell, then # you may wish to use: # -# SHELL= /bin/bash +# SHELL= bash # # On some systems such as macOS, the bash shell is very # far behind to the point where is cannot be depended on. # On such systems, the sh may be a much better alternative # shell for this Makefile to use: # -# SHELL= /bin/sh +# SHELL= sh # -SHELL= /bin/bash -#SHELL= /bin/sh +SHELL= bash +#SHELL= sh #if 0 /* start of skip for non-Gnu makefiles */ +# ifeq ($(target),Darwin) -SHELL:= /bin/zsh +SHELL:= /bin/sh endif #endif /* end of skip for non-Gnu makefiles */ diff --git a/rpm.mk b/rpm.mk index ebbd25c..feae47f 100644 --- a/rpm.mk +++ b/rpm.mk @@ -1,9 +1,8 @@ -#!/bin/make -#****h* calc/rpm.mk +#!/usr/bin/env make # # rpm.mk - Makefile for building rpm packages for calc # -# Copyright (C) 2003,2014,2021 Petteri Kettunen and Landon Curt Noll +# Copyright (C) 2003,2014,2021,2023 Petteri Kettunen and Landon Curt Noll # # Calc is open software; you can redistribute it and/or modify it under # the terms of the version 2.1 of the GNU Lesser General Public License @@ -63,7 +62,7 @@ # setup # -SHELL= /bin/sh +SHELL= bash RPMBUILD_TOOL= rpmbuild TARCH= x86_64 RPMBUILD_OPTION= -ba --target=$(TARCH) --buildroot=${RPM_BUILD_ROOT}