diff --git a/CHANGES b/CHANGES index d6634a4..b176dd9 100644 --- a/CHANGES +++ b/CHANGES @@ -31,18 +31,46 @@ The following are the changes from calc version 2.14.3.1 to date: ALLOW_CUSTOM="-UCUSTOM" - Added comments in Makefile.local for how to reduce dependency chains - under macOS. XXX - this doesn't yet work so don't uncomment - XXX. - Dropped support of Makefile.simple and custom/Makefile.simple. The calc version 2.14.3.0 is the last release that supported the Makefile.simple and custom/Makefile.simple files. Now, a make that supports makefile conditional syntax is required. - The platform target section from the old Makefile has been moved - to a new file, Makefile.target. The Makefile.target is shared - by both Makefile and custom/Makefile. The custom/Makefile no - longer includes Makefile (instead it includes ../Makefile.target). + Moved makefile variables that configure calc and configure how to + compile calc from Makefile into a new Makefile.config file. + + The Makeifle includes the Makefile.config file. + The cal/Makeifle includes the Makefile.config file. + The cscript/Makeifle includes the Makefile.config file. + The custom/Makeifle includes the Makefile.config file. + The help/Makeifle includes the Makefile.config file. + + Now, the Makefile.config file will consistently configure + calc and how calc is compiled and built by all calc Makefiles. + + The platform target section from the old Makefile has been moved to + a new file, Makefile.target. The custom/Makefile no longer includes + Makefile. + + The Makeifle includes the Makefile.target file. + The cal/Makeifle includes the Makefile.target file. + The cscript/Makeifle includes the Makefile.target file. + The custom/Makeifle includes the Makefile.target file. + The help/Makeifle includes the Makefile.target file. + + Now, the Makefile.target file will consistently set + target information for all calc Makefiles. + + The cal/Makeifle includes the Makefile.local file. + The cscript/Makeifle includes the Makefile.local file. + The custom/Makeifle includes the Makefile.local file. + The help/Makeifle includes the Makefile.local file. + + Thus, one may modify or append many Makefile variables + in all calc Makefiles. + + Added comments in Makefile.local for how to reduce dependency chains + under macOS. XXX - this doesn't yet work so don't uncomment - XXX. The following are the changes from calc version 2.14.2.1 to 2.14.3.0: diff --git a/HOWTO.INSTALL b/HOWTO.INSTALL index fc4f9f6..f030d25 100644 --- a/HOWTO.INSTALL +++ b/HOWTO.INSTALL @@ -9,6 +9,7 @@ and see if there is a pre-compiled version of calc that you may install. Open up the 'Assets' tag below a given release and download these RPMs: * calc*.rpm + - all that is needed if you just want to use calc If your platform supports rpm and matches one of the "calc*.rpm" files, you @@ -23,6 +24,7 @@ In addition, if your platform supports rpm and matches one of the files for use in other programs: * calc-devel-*.rpm + - calc *.h header and *.a lib files for use in other programs Alternately to the above github link, you might try looking at the RPMs under: @@ -81,9 +83,6 @@ than the top of the master branch. ## Step 1: Makefile considerations -Look at Makefile, and adjust it to suit your needs. - - ### IMPORTANT: Make support of conditional syntax required: @@ -100,21 +99,48 @@ The Gnu Make is not required per-se, just a modern make tool that supports "Conditional syntax". +### Review Makefiles -### Suggestion: Modify Makefile.local instead of Makefile: +Review Makefile.config and Makefile.target. + +If you are curious, review Makefile as well, although +there may be little in the main Makefile that you may +want to change. + +Consider modifying Makefile.local by replace values or +appending values found in Makefile.config and Makefile.target. + +If you are adding custom functions, review custom/Makefile +and modify custom/Makefile as needed. + + + +### Suggestion: Modify Makefile.local + +All Makefiles include Makefile.local just before the +first and default all rule. So Makefile.local may be +used to modify, replace or append values to Makefile variables. In most cases, to change the way that calc is made, consider -adding lines to Makefile.local instead of modifying Makefile. +adding lines to Makefile.local instead of modifying other Makefiles. -A recommened way to adjust it is to add lines to: Makefile.local +A recommended way to adjust it is to add lines to: Makefile.local using the := syntax to replace values such as: DEBUG:= -O0 -g or by using the += syntax to append to values such as: - CFLAGS+= -UCUSTOM + DEBUG+= -ipa +You can, of course, modify other Makefiles. We only +suggest using Makefile.local to minimize the number +of source files you modify. + +And finally, you can always just add arguments to your +make command line instead of modifying a Makefile. For example: + + make clobber all DEBUG="-O0 -g" ## readline package assumed by default: @@ -167,6 +193,8 @@ or add to Makefile.local, these lines: READLINE_INCLUDE= READLINE_LIB= +See the "Suggestion: Modify Makefile.local" section above for +information on the Makefile.local file. ### Windows or a Windows-like environments: @@ -230,6 +258,8 @@ instead of Makefile" above. For example: T:= /var/tmp/testing +See the "Suggestion: Modify Makefile.local" section above for +information on the Makefile.local file. ### platform target section @@ -286,11 +316,11 @@ See the BUGS file if you find any compiler warning or errors. You may run the calc regression test suite, after successfully compiling, by: - make check + make check For a more quiet check which only prints if something goes wrong, use: - make chk + make chk diff --git a/Makefile b/Makefile index efaef60..df40887 100644 --- a/Makefile +++ b/Makefile @@ -30,1212 +30,9 @@ # Makefile by Landon Curt Noll -# We do not support parallel make of calc. We have found most -# parallel make systems do not get the rule dependency order -# correct, resulting in a failed attempt to compile calc. -# -# If you believe you have a way to get a parallel make of calc -# to work, consider submitting a pull request with a -# proposed change. -# -.NOTPARALLEL: - -############################################################################## -#-=-=-=-=-=-=-=-=- Identify the target machine, if possible -=-=-=-=-=-=-=-=-# -############################################################################## - -# NOTE: You can force a target value by defining target as in: -# -# make ...__optional_arguments_... target=value -# -# Try uname -s if the target was not already set on the make command line -# -ifeq ($(target),) -target=$(shell uname -s 2>/dev/null) -endif # ($(target),) -ifeq ($(arch),) -arch=$(shell uname -p 2>/dev/null) -endif # ($(arch),) -ifeq ($(hardware),) -hardware=$(shell uname -m 2>/dev/null) -endif # ($(hardware),) -ifeq ($(OSNAME),) -OSNAME=$(shell uname -o 2>/dev/null) -endif # ($(OSNAME),) - -# The shell used by this Makefile -# -# On some systems, /bin/sh is a rather reduced shell with -# deprecated behavior. -# -# If your system has a up to date, bash shell, then -# you may wish to use: -# -# 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= sh -# -SHELL= bash -#SHELL= sh - -# Darwin shell default -# -ifeq ($(target),Darwin) -SHELL:= /bin/sh -endif # ($(target),Darwin) - -# If you are using Cygwin with MinGW64 packages -# then we will also need to use the Cygwin runtime enviroment -# and the calc Cygwin make target. -## -ifeq ($(OSNAME),Cygwin) -target:= Cygwin -endif # ($(OSNAME),Cygwin) - - -############################################################################## -#-=-=-=-=-=-=-=-=- You may want to change some values below -=-=-=-=-=-=-=-=-# -############################################################################## - -# PREFIX - Top level location for calc -# -# The PREFIX is often prepended to paths within calc and calc Makefiles. -# -# Starting with calc v2.13.0.1, nearly all Makefile places that used -# /usr/local now use ${PREFIX}. An exception is the olduninstall rule -# and, of course, this section. :-) -# -# NOTE: The ${PREFIX} is not the same as ${T}. The ${T} specifies -# a top level directory under which calc installs things. -# While usually ${T} is empty, it can be specific path -# as if calc where "chrooted" during an install. -# The ${PREFIX} value, during install, is a path between -# the top level ${T} install directory and the object -# such as an include file. -# -# NOTE: See also, ${T}, below. -# -# There are some paths that do NOT call under ${PREFIX}, such as -# ${CALCPATH}, that include paths not under ${PREFIX}, but those -# too are exceptions to this general rule. -# -# When in doubt, try: -# -# PREFIX= /usr/local -# -PREFIX= /usr/local -#PREFIX= /usr -#PREFIX= /usr/global - -# CCBAN is given to ${CC} in order to control if banned.h is in effect. -# -# The banned.h attempts to ban the use of certain dangerous functions -# that, if improperly used, could compromise the computational integrity -# if calculations. -# -# In the case of calc, we are motivated in part by the desire for calc -# to correctly calculate: even during extremely long calculations. -# -# If UNBAN is NOT defined, then calling certain functions -# will result in a call to a non-existent function (link error). -# -# While we do NOT encourage defining UNBAN, there may be -# a system / compiler environment where re-defining a -# function may lead to a fatal compiler complication. -# If that happens, consider compiling as: -# -# make clobber all chk CCBAN=-DUNBAN -# -# as see if this is a work-a-round. -# -# If YOU discover a need for the -DUNBAN work-a-round, PLEASE tell us! -# Please send us a bug report. See the file: -# -# BUGS -# -# or the URL: -# -# http://www.isthe.com/chongo/tech/comp/calc/calc-bugrept.html -# -# for how to send us such a bug report. -# -CCBAN= -UUNBAN -#CCBAN= -DUNBAN - -# Determine the type of terminal controls that you want to use -# -# value meaning -# -------- ------- -# (nothing) let the Makefile guess at what you need -# -DUSE_TERMIOS use struct termios from -# -DUSE_TERMIO use struct termios from -# -DUSE_SGTTY use struct sgttyb from -# -DUSE_NOTHING Windows system, don't use any of them -# -# Select TERMCONTROL= -DUSE_TERMIOS for DJGPP. -# -# If in doubt, leave TERMCONTROL empty. -# -TERMCONTROL= -#TERMCONTROL= -DUSE_TERMIOS -#TERMCONTROL= -DUSE_TERMIO -#TERMCONTROL= -DUSE_SGTTY -#TERMCONTROL= -DUSE_WIN32 - -# If your system does not have a vsnprintf() function, you could be in trouble. -# -# vsnprintf(string, size, format, ap) -# -# This function works like spnrintf except that the 4th arg is a va_list -# strarg (or varargs) list. Some old systems do not have vsnprintf(). -# If you do not have vsnprintf(), then calc will try snprintf() and hope -# for the best. -# -# A similar problem occurs if your system does not have a vsnprintf() -# function. This function is like the vsnprintf() function except that -# there is an extra second argument that controls the maximum size -# string that is produced. -# -# If HAVE_VSNPRINTF is empty, this Makefile will run the have_stdvs.c and/or -# have_varvs.c program to determine if vsnprintf() is supported. If -# HAVE_VSNPRINTF is set to -DDONT_HAVE_VSNPRINTF then calc will hope that -# snprintf() will work. -# -# If in doubt, leave HAVE_VSNPRINTF empty. -# -HAVE_VSNPRINTF= -#HAVE_VSNPRINTF= -DDONT_HAVE_VSNPRINTF - -# Determine the byte order of your machine -# -# Big Endian: Amdahl, 68k, Pyramid, Mips, Sparc, ... -# Little Endian: Vax, 32k, Spim (Dec Mips), i386, i486, ... -# -# If in doubt, leave CALC_BYTE_ORDER empty. This Makefile will attempt to -# use BYTE_ORDER in or it will attempt to run -# the endian program. If you get syntax errors when you compile, -# try forcing the value to be -DBIG_ENDIAN and run the calc regression -# tests. (see the README.FIRST file) If the calc regression tests fail, do -# a make clobber and try -DCALC_LITTLE_ENDIAN. If that fails, ask a wizard -# for help. -# -# Select CALC_BYTE_ORDER= -DCALC_LITTLE_ENDIAN for DJGPP. -# -CALC_BYTE_ORDER= -#CALC_BYTE_ORDER= -DBIG_ENDIAN -#CALC_BYTE_ORDER= -DLITTLE_ENDIAN - -# Determine the number of bits in a byte -# -# If in doubt, leave CALC_CHARBIT empty. This Makefile will run -# the charbits program to determine the length. -# -# In order to avoid make brain damage in some systems, we avoid placing -# a space after the ='s below. -# -# Select CALC_CHARBIT= 8 for DJGPP. -# -CALC_CHARBIT= -#CALC_CHARBIT= 8 - -# Determine the number of bits in a long -# -# If in doubt, leave LONG_BITS empty. This Makefile will run -# the longbits program to determine the length. -# -# In order to avoid make brain damage in some systems, we avoid placing -# a space after the ='s below. -# -# Select LONG_BITS= 32 for DJGPP. -# -LONG_BITS= -#LONG_BITS= 32 -#LONG_BITS= 64 - -# Determine if we have the ANSI C fgetpos and fsetpos alternate interface -# to the ftell() and fseek() (with whence set to SEEK_SET) functions. -# -# If HAVE_FGETSETPOS is empty, this Makefile will run the have_fpos program -# to determine if there is are fgetpos and fsetpos functions. If HAVE_FGETSETPOS -# is set to -DHAVE_NO_FGETSETPOS, then calc will use ftell() and fseek(). -# -# If in doubt, leave HAVE_FGETSETPOS empty and this Makefile will figure it out. -# -HAVE_FGETSETPOS= -#HAVE_FGETSETPOS= -DHAVE_NO_FGETSETPOS - -# Determine if we have an __pos element of a file position (fpos_t) structure. -# -# If HAVE_FPOS_POS is empty, this Makefile will run the have_fpos_pos program -# to determine if fpos_t has a __pos structure element. If HAVE_FPOS_POS -# is set to -DHAVE_NO_FPOS_POS, then calc assume there is no __pos element. -# -# Select HAVE_FPOS_POS= -DHAVE_NO_FPOS_POS for DJGPP. -# -# If in doubt, leave HAVE_FPOS_POS empty and this Makefile will figure it out. -# -HAVE_FPOS_POS= -#HAVE_FPOS_POS= -DHAVE_NO_FPOS_POS - -# Determine the size of the __pos element in fpos_t, if it exists. -# -# If FPOS_POS_BITS is empty, then the Makefile will determine the size of -# the file position value of the __pos element. -# -# If there is no __pos element in fpos_t (say because fpos_t is a scalar), -# leave FPOS_POS_BITS blank. -# -# If in doubt, leave FPOS_POS_BITS empty and this Makefile will figure it out. -# -FPOS_POS_BITS= -#FPOS_POS_BITS= 32 -#FPOS_POS_BITS= 64 - -# Determine the size of a file position value. -# -# If FPOS_BITS is empty, then the Makefile will determine the size of -# the file position value. -# -# Select FPOS_BITS= 32 for DJGPP. -# -# If in doubt, leave FPOS_BITS empty and this Makefile will figure it out. -# -FPOS_BITS= -#FPOS_BITS= 32 -#FPOS_BITS= 64 - -# Determine the size of the off_t file offset element -# -# If OFF_T_BITS is empty, then the Makefile will determine the size of -# the file offset value. -# -# Select OFF_T_BITS= 32 for DJGPP. -# -# If in doubt, leave OFF_T_BITS empty and this Makefile will figure it out. -# -OFF_T_BITS= -#OFF_T_BITS= 32 -#OFF_T_BITS= 64 - -# Determine the size of the dev_t device value -# -# If DEV_BITS is empty, then the Makefile will determine the size of -# the dev_t device value -# -# Select DEV_BITS= 32 for DJGPP. -# -# If in doubt, leave DEV_BITS empty and this Makefile will figure it out. -# -DEV_BITS= -#DEV_BITS= 16 -#DEV_BITS= 32 -#DEV_BITS= 64 - -# Determine the size of the ino_t device value -# -# If INODE_BITS is empty, then the Makefile will determine the size of -# the ino_t inode value -# -# Select INODE_BITS= 32 for DJGPP. -# -# If in doubt, leave INODE_BITS empty and this Makefile will figure it out. -# -INODE_BITS= -#INODE_BITS= 16 -#INODE_BITS= 32 -#INODE_BITS= 64 - -# Determine if we have an off_t which one can perform arithmetic operations, -# assignments and comparisons. On some systems off_t is some sort of union -# or struct. -# -# If HAVE_OFFSCL is empty, this Makefile will run the have_offscl program -# to determine if off_t is a scalar. If HAVE_OFFSCL is set to the value -# -DOFF_T_NON_SCALAR when calc will assume that off_t some sort of -# union or struct. -# -# If in doubt, leave HAVE_OFFSCL empty and this Makefile will figure it out. -# -HAVE_OFFSCL= -#HAVE_OFFSCL= -DOFF_T_NON_SCALAR - -# Determine if we have an fpos_t which one can perform arithmetic operations, -# assignments and comparisons. On some systems fpos_t is some sort of union -# or struct. Some systems do not have an fpos_t and long is as a file -# offset instead. -# -# If HAVE_POSSCL is empty, this Makefile will run the have_offscl program -# to determine if off_t is a scalar, or if there is no off_t and long -# (a scalar) should be used instead. If HAVE_POSSCL is set to the value -# -DFILEPOS_NON_SCALAR when calc will assume that fpos_t exists and is -# some sort of union or struct. -# -# If in doubt, leave HAVE_POSSCL empty and this Makefile will figure it out. -# -HAVE_POSSCL= -#HAVE_POSSCL= -DFILEPOS_NON_SCALAR - -# Determine if we have ANSI C const. -# -# If HAVE_CONST is empty, this Makefile will run the have_const program -# to determine if const is supported. If HAVE_CONST is set to -DHAVE_NO_CONST, -# then calc will not use const. -# -# If in doubt, leave HAVE_CONST empty and this Makefile will figure it out. -# -HAVE_CONST= -#HAVE_CONST= -DHAVE_NO_CONST - -# Determine if we have uid_t -# -# If HAVE_UID_T is empty, this Makefile will run the have_uid_t program -# to determine if uid_t is supported. If HAVE_UID_T is set to -DHAVE_NO_UID_T, -# then calc will treat uid_t as an unsigned short. This only matters if -# $HOME is not set and calc must look up the home directory in /etc/passwd. -# -# If in doubt, leave HAVE_UID_T empty and this Makefile will figure it out. -# -HAVE_UID_T= -#HAVE_UID_T= -DHAVE_NO_UID_T - -# Determine if we have a non-NULL user environment external: -# -# extern char **environ; /* user environment */ -# -# If HAVE_ENVIRON is empty, this Makefile will run the have_environ program -# to determine if environ exists and is non-NULL. If HAVE_ENVIRON is set -# to -DHAVE_NO_ENVIRON, then calc will assume there is no external environ -# symbol. -# -# If in doubt, leave HAVE_ENVIRON empty and this Makefile will figure it out. -# -HAVE_ENVIRON= -#HAVE_ENVIRON= -DHAVE_NO_ENVIRON - -# Determine if we have the arc4random_buf() function -# -# If HAVE_ARC4RANDOM is empty, this Makefile will run the have_arc4random -# program to determine if arc4random_buf() function exists. If -# HAVE_ARC4RANDOM is set to -DHAVE_NO_ARC4RANDOM, then calc will assume -# there is no arc4random_buf() function. -# -# If in doubt, leave HAVE_ARC4RANDOM empty and this Makefile will figure it out. -# -HAVE_ARC4RANDOM= -#HAVE_ARC4RANDOM= -DHAVE_NO_ARC4RANDOM - -# Determine if we have memcpy(), memset() and strchr() -# -# If HAVE_NEWSTR is empty, this Makefile will run the have_newstr program -# to determine if memcpy(), memset() and strchr() are supported. If -# HAVE_NEWSTR is set to -DHAVE_NO_NEWSTR, then calc will use bcopy() instead -# of memcpy(), use bfill() instead of memset(), and use index() instead of -# strchr(). -# -# If in doubt, leave HAVE_NEWSTR empty and this Makefile will figure it out. -# -HAVE_NEWSTR= -#HAVE_NEWSTR= -DHAVE_NO_NEWSTR - -# Determine if we have memmove() -# -# If HAVE_MEMMOVE is empty, this Makefile will run the have_memmv program -# to determine if memmove() is supported. If HAVE_MEMMOVE is set to -# -DHAVE_NO_MEMMOVE, then calc will use internal functions to simulate -# the memory move function that does correct overlapping memory moves. -# -# If in doubt, leave HAVE_MEMMOVE empty and this Makefile will figure it out. -# -HAVE_MEMMOVE= -#HAVE_MEMMOVE= -DHAVE_NO_MEMMOVE - -# Determine if we have ustat() -# -# If HAVE_USTAT is empty, this Makefile will run the have_ustat program -# to determine if ustat() is supported. If HAVE_USTAT is set to -# -DHAVE_NO_USTAT, then calc will use internal functions to simulate -# the ustat() function that gets file system statistics. -# -# Select HAVE_USTAT= -DHAVE_NO_USTAT for DJGPP. -# -# If in doubt, leave HAVE_USTAT empty and this Makefile will figure it out. -# -HAVE_USTAT= -#HAVE_USTAT= -DHAVE_NO_USTAT - -# Determine if we have statfs() -# -# If HAVE_STATFS is empty, this Makefile will run the have_statfs program -# to determine if statfs() is supported. If HAVE_STATFS is set to -# -DHAVE_NO_STATFS, then calc will use internal functions to simulate -# the statfs() function that gets file system statistics. -# -# Select HAVE_STATFS= -DHAVE_NO_STATFS for DJGPP. -# -# If in doubt, leave HAVE_STATFS empty and this Makefile will figure it out. -# -HAVE_STATFS= -#HAVE_STATFS= -DHAVE_NO_STATFS - -# Determine if we have the include file. -# -# HAVE_SYS_VFS_H= let the Makefile look for the include file -# HAVE_SYS_VFS_H= YES assume that the include file exists -# HAVE_SYS_VFS_H= NO assume that the include file does not exist -# -# Select HAVE_SYS_VFS_H= NO for DJGPP. -# -# When in doubt, leave HAVE_SYS_VFS_H empty. -# -HAVE_SYS_VFS_H= -#HAVE_SYS_VFS_H= YES -#HAVE_SYS_VFS_H= NO - -# Determine if we have the include file. -# -# HAVE_SYS_PARAM_H= let the Makefile look for the include file -# HAVE_SYS_PARAM_H= YES assume that the include file exists -# HAVE_SYS_PARAM_H= NO assume that the include file does not exist -# -# Select HAVE_SYS_PARAM_H= NO for DJGPP. -# -# When in doubt, leave HAVE_SYS_PARAM_H empty. -# -HAVE_SYS_PARAM_H= -#HAVE_SYS_PARAM_H= YES -#HAVE_SYS_PARAM_H= NO - -# Determine if we have the include file. -# -# HAVE_SYS_MOUNT_H= let the Makefile look for the include file -# HAVE_SYS_MOUNT_H= YES assume that the include file exists -# HAVE_SYS_MOUNT_H= NO assume that the include file does not exist -# -# Select HAVE_SYS_MOUNT_H= NO for DJGPP. -# -# When in doubt, leave HAVE_SYS_MOUNT_H empty. -# -HAVE_SYS_MOUNT_H= -#HAVE_SYS_MOUNT_H= YES -#HAVE_SYS_MOUNT_H= NO - -# Determine if we have getsid() -# -# If HAVE_GETSID is empty, this Makefile will run the have_getsid program -# to determine if getsid() is supported. If HAVE_GETSID is set to -# -DHAVE_NO_GETSID, then calc will use internal functions to simulate -# the getsid() function that gets session ID. -# -# Select HAVE_GETSID= -DHAVE_NO_GETSID for DJGPP. -# -# If in doubt, leave HAVE_GETSID empty and this Makefile will figure it out. -# -HAVE_GETSID= -#HAVE_GETSID= -DHAVE_NO_GETSID - -# Determine if we have getpgid() -# -# If HAVE_GETPGID is empty, this Makefile will run the have_getpgid program -# to determine if getpgid() is supported. If HAVE_GETPGID is set to -# -DHAVE_NO_GETPGID, then calc will use internal functions to simulate -# the getpgid() function that sets the process group ID. -# -# Select HAVE_GETPGID= -DHAVE_NO_GETPGID for DJGPP. -# -# If in doubt, leave HAVE_GETPGID empty and this Makefile will figure it out. -# -HAVE_GETPGID= -#HAVE_GETPGID= -DHAVE_NO_GETPGID - -# Determine if we have clock_gettime() -# -# If HAVE_GETTIME is empty, this Makefile will run the have_gettime program -# to determine if clock_gettime() is supported. If HAVE_GETTIME is set to -# -DHAVE_NO_GETTIME, then calc will use internal functions to simulate -# the clock_gettime() function. -# -# Select HAVE_GETTIME= -DHAVE_NO_GETTIME for DJGPP. -# -# If in doubt, leave HAVE_GETTIME empty and this Makefile will figure it out. -# -HAVE_GETTIME= -#HAVE_GETTIME= -DHAVE_NO_GETTIME - -# Determine if we have getprid() -# -# If HAVE_GETPRID is empty, this Makefile will run the have_getprid program -# to determine if getprid() is supported. If HAVE_GETPRID is set to -# -DHAVE_NO_GETPRID, then calc will use internal functions to simulate -# the getprid() function. -# -# Select HAVE_GETPRID= -DHAVE_NO_GETPRID for DJGPP. -# -# If in doubt, leave HAVE_GETPRID empty and this Makefile will figure it out. -# -HAVE_GETPRID= -#HAVE_GETPRID= -DHAVE_NO_GETPRID - -# Determine if we have the /dev/urandom -# -# HAVE_URANDOM_H= let the Makefile look for /dev/urandom -# HAVE_URANDOM_H= YES assume that /dev/urandom exists -# HAVE_URANDOM_H= NO assume that /dev/urandom does not exist -# -# Select HAVE_URANDOM_H= NO for DJGPP. -# -# When in doubt, leave HAVE_URANDOM_H empty. -# -HAVE_URANDOM_H= -#HAVE_URANDOM_H= YES -#HAVE_URANDOM_H= NO - -# Determine if we have getrusage() -# -# If HAVE_GETRUSAGE is empty, this Makefile will run the have_rusage program -# to determine if getrusage() is supported. If HAVE_GETRUSAGE is set to -# -DHAVE_NO_GETRUSAGE, then calc will use internal functions to simulate -# the getrusage() function. -# -# If in doubt, leave HAVE_GETRUSAGE empty and this Makefile will figure it out. -# -HAVE_GETRUSAGE= -#HAVE_GETRUSAGE= -DHAVE_NO_GETRUSAGE - -# Determine if we have strdup() -# -# If HAVE_STRDUP is empty, this Makefile will run the have_strdup program -# to determine if strdup() is supported. If HAVE_STRDUP is set to -# -DHAVE_NO_STRDUP, then calc will use internal functions to simulate -# the strdup() function. -# -# If in doubt, leave HAVE_STRDUP empty and this Makefile will figure it out. -# -HAVE_STRDUP= -#HAVE_STRDUP= -DHAVE_NO_STRDUP - -# Some architectures such as Sparc do not allow one to access 32 bit values -# that are not aligned on a 32 bit boundary. -# -# The Dec Alpha running OSF/1 will produce alignment error messages when -# align32.c tries to figure out if alignment is needed. Use the -# ALIGN32= -DMUST_ALIGN32 to force alignment and avoid such error messages. -# -# ALIGN32= let align32.c figure out if alignment is needed -# ALIGN32= -DMUST_ALIGN32 force 32 bit alignment -# ALIGN32= -UMUST_ALIGN32 allow non-alignment of 32 bit accesses -# -# Select ALIGN32= -UMUST_ALIGN32 for DJGPP. -# -# When in doubt, be safe and pick ALIGN32=-DMUST_ALIGN32. -# -ALIGN32= -#ALIGN32= -DMUST_ALIGN32 -#ALIGN32= -UMUST_ALIGN32 - -# Determine if we have the include file. -# -# HAVE_STDLIB_H= let the Makefile look for the include file -# HAVE_STDLIB_H= YES assume that the include file exists -# HAVE_STDLIB_H= NO assume that the include file does not exist -# -# Select HAVE_STDLIB_H= YES for DJGPP. -# -# When in doubt, leave HAVE_STDLIB_H empty. -# -HAVE_STDLIB_H= -#HAVE_STDLIB_H= YES -#HAVE_STDLIB_H= NO - -# Determine if we have the include file. -# -# HAVE_STRING_H= let the Makefile look for the include file -# HAVE_STRING_H= YES assume that the include file exists -# HAVE_STRING_H= NO assume that the include file does not exist -# -# Select HAVE_STRING_H= YES for DJGPP. -# -# When in doubt, leave HAVE_STRING_H empty. -# -HAVE_STRING_H= -#HAVE_STRING_H= YES -#HAVE_STRING_H= NO - -# Determine if we have the include file. -# -# HAVE_TIMES_H= let the Makefile look for the include file -# HAVE_TIMES_H= YES assume that the include file exists -# HAVE_TIMES_H= NO assume that the include file does not exist -# -# Select HAVE_TIMES_H= NO for DJGPP. -# -# When in doubt, leave HAVE_TIMES_H empty. -# -HAVE_TIMES_H= -#HAVE_TIMES_H= YES -#HAVE_TIMES_H= NO - -# Determine if we have the include file. -# -# HAVE_SYS_TIMES_H= let the Makefile look for the include file -# HAVE_SYS_TIMES_H= YES assume that the include file exists -# HAVE_SYS_TIMES_H= NO assume that the include file does not exist -# -# Select HAVE_SYS_TIMES_H= YES for DJGPP. -# -# When in doubt, leave HAVE_SYS_TIMES_H empty. -# -HAVE_SYS_TIMES_H= -#HAVE_SYS_TIMES_H= YES -#HAVE_SYS_TIMES_H= NO - -# Determine if we have the include file. -# -# HAVE_TIME_H= let the Makefile look for the include file -# HAVE_TIME_H= YES assume that the include file exists -# HAVE_TIME_H= NO assume that the include file does not exist -# -# Select HAVE_TIME_H= YES for DJGPP. -# -# When in doubt, leave HAVE_TIME_H empty. -# -HAVE_TIME_H= -#HAVE_TIME_H= YES -#HAVE_TIME_H= NO - -# Determine if we have the include file. -# -# HAVE_SYS_TIME_H= let the Makefile look for the include file -# HAVE_SYS_TIME_H= YES assume that the include file exists -# HAVE_SYS_TIME_H= NO assume that the include file does not exist -# -# Select HAVE_SYS_TIME_H= YES for DJGPP. -# -# When in doubt, leave HAVE_SYS_TIME_H empty. -# -HAVE_SYS_TIME_H= -#HAVE_SYS_TIME_H= YES -#HAVE_SYS_TIME_H= NO - -# Determine if we have the include file. -# -# HAVE_UNISTD_H= let the Makefile look for the include file -# HAVE_UNISTD_H= YES assume that the include file exists -# HAVE_UNISTD_H= NO assume that the include file does not exist -# -# Select HAVE_UNISTD_H= YES for DJGPP. -# -# When in doubt, leave HAVE_UNISTD_H empty. -# -HAVE_UNISTD_H= -#HAVE_UNISTD_H= YES -#HAVE_UNISTD_H= NO - -# Determine if we have the include file. -# -# HAVE_LIMITS_H= let the Makefile look for the include file -# HAVE_LIMITS_H= YES assume that the include file exists -# HAVE_LIMITS_H= NO assume that the include file does not exist -# -# Select HAVE_LIMITS_H= YES for DJGPP. -# -# When in doubt, leave HAVE_LIMITS_H empty. -# -HAVE_LIMITS_H= -#HAVE_LIMITS_H= YES -#HAVE_LIMITS_H= NO - -# Determine if our compiler allows the unused attribute -# -# If HAVE_UNUSED is empty, this Makefile will run the have_unused program -# to determine if the unused attribute is supported. If HAVE_UNUSED is set to -# -DHAVE_NO_UNUSED, then the unused attribute will not be used. -# -# Select HAVE_UNUSED= for DJGPP. -# -# If in doubt, leave HAVE_UNUSED empty and this Makefile will figure it out. -# -HAVE_UNUSED= -#HAVE_UNUSED= -DHAVE_NO_UNUSED - -# Determine if we allow use of "#pragma GCC poison func_name" -# -# If HAVE_PRAGMA_GCC_POSION is empty, then Makefile will run the -# have_bprag program to determine if the "#pragma GCC poison func_name" -# is supported. If HAVE_PRAGMA_GCC_POSION is set to -# -DHAVE_NO_PRAGMA_GCC_POSION. then the "#pragma GCC poison func_name" -# is not used. -# -# If in doubt, leave HAVE_PRAGMA_GCC_POSION empty and this Makefile -# will figure it out. -# -HAVE_PRAGMA_GCC_POSION= -#HAVE_PRAGMA_GCC_POSION= -DHAVE_NO_PRAGMA_GCC_POSION - -# Determine if we have strlcpy() -# -# If HAVE_STRLCPY is empty, this Makefile will run the have_strlcpy program -# to determine if strlcpy() is supported. If HAVE_STRLCPY is set to -# -DHAVE_NO_STRLCPY, then calc will use internal functions to simulate -# the strlcpy() function. -# -# If in doubt, leave HAVE_STRLCPY empty and this Makefile will figure it out. -# -HAVE_STRLCPY= -#HAVE_STRLCPY= -DHAVE_NO_STRLCPY - -# Determine if we have strlcat() -# -# If HAVE_STRLCAT is empty, this Makefile will run the have_strlcat program -# to determine if strlcat() is supported. If HAVE_STRLCAT is set to -# -DHAVE_NO_STRLCAT, then calc will use internal functions to simulate -# the strlcat() function. -# -# If in doubt, leave HAVE_STRLCAT empty and this Makefile will figure it out. -# -HAVE_STRLCAT= -#HAVE_STRLCAT= -DHAVE_NO_STRLCAT - -# System include files -# -# ${INCDIR} where the system include (.h) files are kept -# -# For DJGPP, select: -# -# INCDIR= /dev/env/DJDIR/include -# -# If in doubt, for non-macOS hosts set: -# -# INCDIR= /usr/include -# -# However, if you are on macOS then set: -# -# INCDIR= ${PREFIX}/include -ifeq ($(target),Darwin) - -# determine default INCDIR for macOS -# -ifeq ($(arch),powerpc) -# Default location for old systems such as Mac OS X 10.6 Snow Leopard -INCDIR= /usr/include -else # ($(arch),powerpc) -# Modern macOS such as macOS 10.11.6 and later -INCDIR= $(shell xcrun --sdk macosx --show-sdk-path 2>/dev/null)/usr/include -endif # ($(arch),powerpc) - -# default INCDIR for non-macOS -# -else # ($(target),Darwin) - -INCDIR= /usr/include -#INCDIR= ${PREFIX}/include -#INCDIR= /dev/env/DJDIR/include - -endif # ($(target),Darwin) - -# Where to install calc related things -# -# ${BINDIR} where to install calc binary files -# ${LIBDIR} where calc link library (*.a) files are installed -# ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files -# ${CALC_INCDIR} where the calc include files are installed -# -# NOTE: The install rule prepends installation paths with ${T}, which -# by default is empty. If ${T} is non-empty, then installation -# locations will be relative to the ${T} directory. -# -# NOTE: If you change LIBDIR to a non-standard location, you will need -# to make changes to your execution environment so that executables -# will search LIBDIR when they are resolving dynamic shared libraries. -# -# On OS X, this means you need to export $DYLD_LIBRARY_PATH -# to include the LIBDIR path in the value. -# -# On Linux and BSD, this means you need to export $LD_LIBRARY_PATH -# to include the LIBDIR path in the value. -# -# You might be better off not changing LIBDIR in the first place. -# -# For DJGPP, select: -# -# BINDIR= /dev/env/DJDIR/bin -# LIBDIR= /dev/env/DJDIR/lib -# CALC_SHAREDIR= /dev/env/DJDIR/share/calc -# -# If in doubt, for non-macOS hosts set: -# -# BINDIR= /usr/bin -# LIBDIR= /usr/lib -# CALC_SHAREDIR= /usr/share/calc -# -# However, if you are on macOS then set: -# -# BINDIR= ${PREFIX}/bin -# LIBDIR= ${PREFIX}/lib -# CALC_SHAREDIR= ${PREFIX}/share/calc -# -# NOTE: Starting with macOS El Capitan OS X 10.11, root by default -# could not mkdir under system locations, so macOS must now -# use the ${PREFIX} tree. - -# defaults for macOS -ifeq ($(target),Darwin) -BINDIR= ${PREFIX}/bin -LIBDIR= ${PREFIX}/lib -CALC_SHAREDIR= ${PREFIX}/share/calc - -# defaults for non-macOS -else # ($(target),Darwin) -# default BINDIR for non-macOS -BINDIR= /usr/bin -#BINDIR= ${PREFIX}/bin -#BINDIR= /dev/env/DJDIR/bin -# default LIBDIR for non-macOS -LIBDIR= /usr/lib -#LIBDIR= ${PREFIX}/lib -#LIBDIR= /dev/env/DJDIR/lib -# default CALC_SHAREDIR for non-macOS -CALC_SHAREDIR= /usr/share/calc -#CALC_SHAREDIR= ${PREFIX}/lib/calc -#CALC_SHAREDIR= /dev/env/DJDIR/share/calc -endif # ($(target),Darwin) - -# NOTE: Do not set CALC_INCDIR to /usr/include or ${PREFIX}/include!!! -# Always be sure that the CALC_INCDIR path ends in /calc to avoid -# conflicts with system or other application include files!!! -# -#CALC_INCDIR= ${PREFIX}/include/calc -#CALC_INCDIR= /dev/env/DJDIR/include/calc -CALC_INCDIR= ${INCDIR}/calc - -# By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR -# --------------------------------------------------------------- -# ${HELPDIR} where the help directory is installed -# ${CUSTOMCALDIR} where custom *.cal files are installed -# ${CUSTOMHELPDIR} where custom help files are installed -# ${CUSTOMINCDIR} where custom .h files are installed -# ${SCRIPTDIR} where calc shell scripts are installed -# -# NOTE: The install rule prepends installation paths with ${T}, which -# by default is empty. If ${T} is non-empty, then installation -# locations will be relative to the ${T} directory. -# -# If in doubt, set: -# -# HELPDIR= ${CALC_SHAREDIR}/help -# CALC_INCDIR= ${INCDIR}/calc -# CUSTOMCALDIR= ${CALC_SHAREDIR}/custom -# CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp -# CUSTOMINCDIR= ${CALC_INCDIR}/custom -# SCRIPTDIR= ${BINDIR}/cscript -# -HELPDIR= ${CALC_SHAREDIR}/help -CUSTOMCALDIR= ${CALC_SHAREDIR}/custom -CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp -CUSTOMINCDIR= ${CALC_INCDIR}/custom -SCRIPTDIR= ${BINDIR}/cscript - -# T - top level directory under which calc will be installed -# -# The calc install is performed under ${T}, the calc build is -# performed under /. The purpose for ${T} is to allow someone -# to install calc somewhere other than into the system area. -# -# For example, if: -# -# BINDIR= /usr/bin -# LIBDIR= /usr/lib -# CALC_SHAREDIR= /usr/share/calc -# -# and if: -# -# T= /var/tmp/testing -# -# Then the installation locations will be: -# -# calc binary files: /var/tmp/testing/usr/bin -# calc link library: /var/tmp/testing/usr/lib -# calc help, .cal ...: /var/tmp/testing/usr/share/calc -# ... etc ... /var/tmp/testing/... -# -# If ${T} is empty, calc is installed under /, which is the same -# top of tree for which it was built. If ${T} is non-empty, then -# calc is installed under ${T}, as if one had to chroot under -# ${T} for calc to operate. -# -# NOTE: The ${PREFIX} is not the same as ${T}. The ${T} specifies -# a top level directory under which calc installs things. -# While usually ${T} is empty, it can be specific path -# as if calc where "chrooted" during an install. -# The ${PREFIX} value, during install, is a path between -# the top level ${T} install directory and the object -# such as an include file. -# -# See ${PREFIX} above. -# -# If in doubt, use T= -# -T= - -# where man section 1 pages are installed -# -# Select MANDIR= /dev/env/DJDIR/man/man1 for DJGPP. -# -# Use MANDIR= to disable installation of the calc man (source) page. -# -# NOTE: man pages not installed by macOS must go under, -# (according to MANPATH as found in /private/etc/man.conf): -# -# MANDIR= ${PREFIX}/share/man/man1 -# -#MANDIR= -#MANDIR= ${PREFIX}/man/man1 -#MANDIR= /usr/man/man1 -# -ifeq ($(target),Darwin) -MANDIR= ${PREFIX}/share/man/man1 -else # ($(target),Darwin) -MANDIR= /usr/share/man/man1 -endif # ($(target),Darwin) -#MANDIR= /dev/env/DJDIR/man/man1 -#MANDIR= /usr/man/u_man/man1 -#MANDIR= /usr/contrib/man/man1 - -# where cat (formatted man) pages are installed -# -# Select CATDIR= /dev/env/DJDIR/man/cat1 for DJGPP. -# -# Use CATDIR= to disable installation of the calc cat (formatted) page. -# -# NOTE: If CATDIR is non-empty, then one should have either the -# ${NROFF} executable and/or the ${MANMAKE} executable. -# -CATDIR= -#CATDIR= ${PREFIX}/man/cat1 -#CATDIR= ${PREFIX}/catman/cat1 -#CATDIR= /usr/man/cat1 -#CATDIR= /usr/share/man/cat1 -#CATDIR= /dev/env/DJDIR/man/cat1 -#CATDIR= /var/cache/man/cat1 -#CATDIR= /usr/man/u_man/cat1 -#CATDIR= /usr/contrib/man/cat1 - -# extension to add on to the calc man page filename -# -# This is ignored if CATDIR is empty. -# -MANEXT= 1 -#MANEXT= l - -# extension to add on to the calc man page filename -# -# This is ignored if CATDIR is empty. -# -CATEXT= 1 -#CATEXT= 1.gz -#CATEXT= 0 -#CATEXT= l - -# how to format a man page -# -# If CATDIR is non-empty, then -# -# If NROFF is non-empty, then -# -# ${NROFF} ${NROFF_ARG} calc.1 > ${CATDIR}/calc.${CATEXT} -# is used to build and install the cat page -# -# else (NROFF is empty) -# -# ${MANMAKE} calc.1 ${CATDIR} -# is used to build and install the cat page -# else -# -# The cat page is not built or installed -# -# Select NROFF= groff for DJGPP. -# -# If in doubt and you don't want to fool with man pages, set MANDIR -# and CATDIR to empty and ignore the NROFF, NROFF_ARG and MANMAKE -# lines below. -# -#NROFF= nroff -NROFF= -#NROFF= groff -NROFF_ARG= -man -#NROFF_ARG= -mandoc -MANMAKE= ${PREFIX}/bin/manmake -#MANMAKE= manmake -MANMODE= 0444 -CATMODE= 0444 - -# By default, custom builtin functions may only be executed if calc -# is given the -C option. This is because custom builtin functions -# may invoke non-standard or non-portable code. One may completely -# disable custom builtin functions by not compiling any custom code -# -# ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given -# ALLOW_CUSTOM= -UCUSTOM # disable custom even if -C is given -# -# If in doubt, use ALLOW_CUSTOM= -DCUSTOM -# -ALLOW_CUSTOM= -DCUSTOM -#ALLOW_CUSTOM= -UCUSTOM - -# If the $CALCPATH environment variable is not defined, then the following -# path will be searched for calc resource file routines. -# -# Select CALCPATH= .;./cal;~/.cal;${CALC_SHAREDIR};${CUSTOMCALDIR} for DJGPP. -# -ifeq ($(ALLOW_CUSTOM),-DCUSTOM) -CALCPATH= .:./cal:~/.cal:${T}${CALC_SHAREDIR}:${T}${CUSTOMCALDIR} -else # ($(ALLOW_CUSTOM),-DCUSTOM) -CALCPATH= .:./cal:~/.cal:${T}${CALC_SHAREDIR} -endif # ($(ALLOW_CUSTOM),-DCUSTOM) - -# When RPM_TOP is defined, we do not use ${T} -# -ifdef RPM_TOP -ifeq ($(ALLOW_CUSTOM),-DCUSTOM) -CALCPATH:= .:./cal:~/.cal:${CALC_SHAREDIR}:${CUSTOMCALDIR} -else # ($(ALLOW_CUSTOM),-DCUSTOM) -CALCPATH:= .:./cal:~/.cal:${CALC_SHAREDIR} -endif # ($(ALLOW_CUSTOM),-DCUSTOM) -endif # RPM_TOP - -# If the $CALCRC environment variable is not defined, then the following -# path will be searched for calc resource files. -# -# Select CALCRC= ./.calcinit:~/.calcrc:${CALC_SHAREDIR}/startup for DJGPP. -# -CALCRC= ./.calcinit:~/.calcrc:${CALC_SHAREDIR}/startup -#CALCRC= ./.calcinit;~/.calcrc;${CALC_SHAREDIR}/startup - -# Determine of the GNU-readline facility will be used instead of the -# builtin calc binding method. -# -# USE_READLINE= Do not use GNU-readline, use calc bindings -# USE_READLINE= -DUSE_READLINE Use GNU-readline, do not use calc bindings -# -# NOTE: If you select the 'USE_READLINE= -DUSE_READLINE' mode, you must set: -# -# READLINE_LIB The flags needed to link in the readline -# and history link libraries -# READLINE_EXTRAS Flags and libs needed to use the readline -# and history link libraries -# READLINE_INCLUDE Where the readline include files reside -# (leave blank if they are /usr/include/readline) -# -# NOTE: If you select the 'USE_READLINE=' mode, then we recommend you set: -# -# READLINE_EXTRAS= -# READLINE_INCLUDE= -# READLINE_LIB= -# -# NOTE: The GNU-readline code is not shipped with calc. You must have -# the appropriate headers and link libs installed on your system in -# order to use it. -# -# To disable the use of the GNU-readline facility (as well as ncurses), set: -# -# USE_READLINE= -# READLINE_EXTRAS= -# READLINE_INCLUDE= -# READLINE_LIB= -# -# If in doubt, set USE_READLINE, READLINE_EXTRAS, READLINE_INCLUDE, and -# READLINE_LIB to nothing. -# -#USE_READLINE= -USE_READLINE= -DUSE_READLINE -# -#READLINE_LIB= -#READLINE_EXTRAS= -# -READLINE_LIB= -lreadline -READLINE_EXTRAS= -lhistory -lncurses -# -#READLINE_LIB= -L/usr/gnu/lib -lreadline -#READLINE_EXTRAS= -lhistory -lncurses -# -#READLINE_LIB= -L${PREFIX}/lib -lreadline -#READLINE_EXTRAS= -lhistory -lncurses -# -# For Apple OS X: install fink from http://fink.sourceforge.net -# and then do a 'fink install readline' and then use: -# -#READLINE_LIB= -L/sw/lib -lreadline -#READLINE_EXTRAS= -lhistory -lncurses -# -# For Apple OS X: install HomeBrew and then: -# -# brew install readline -# -# and use: -# -#READLINE_LIB= -L${PREFIX}/opt/readline/lib -lreadline -#READLINE_EXTRAS= -lhistory -lncurses -# -READLINE_INCLUDE= -#READLINE_INCLUDE= -I/usr/gnu/include -#READLINE_INCLUDE= -I${PREFIX}/include - -# Handle the case where macOS is being used with HomeBrew -# # and using the readline, history, and ncurses libraries. -# # -ifneq ($(HOMEBREW_PREFIX),) -READLINE_LIB:= -L${HOMEBREW_PREFIX}/opt/readline/lib -lreadline -READLINE_INCLUDE:= -I${HOMEBREW_PREFIX}/opt/readline/include -endif # ($(HOMEBREW_PREFIX),) - -# If $PAGER is not set, use this program to display a help file -# -# Select CALCPAGER= less.exe -ci for DJGPP. -# -#CALCPAGER= more -#CALCPAGER= pg -#CALCPAGER= cat -CALCPAGER= less -#CALCPAGER= less.exe -ci - -# Debug/Optimize options for ${CC} and ${LCC} -# -# Select DEBUG= -O2 -gstabs+ -DWINDOZ for DJGPP. -# -#DEBUG= -#DEBUG= -g -#DEBUG= -g3 -# -#DEBUG= -O -#DEBUG= -O -g -#DEBUG= -O -g3 -# -#DEBUG= -O1 -#DEBUG= -O1 -g -#DEBUG= -O1 -g3 -# -#DEBUG= -O2 -#DEBUG= -O2 -g -#DEBUG= -O2 -g3 -#DEBUG= -O2 -ipa -#DEBUG= -O2 -g3 -ipa -# -#DEBUG= -O3 -#DEBUG= -O3 -g -DEBUG= -O3 -g3 -#DEBUG= -O3 -ipa -#DEBUG= -O3 -g3 -ipa - -# Some systems require one to use ranlib to add a symbol table to -# a *.a link library. Set RANLIB to the utility that performs this -# action. Set RANLIB to : if your system does not need such a utility. -# -RANLIB=ranlib -#RANLIB=: +########################################### +# Files used or included by this Makefile # +########################################### # Normally certain files depend on the Makefile. If the Makefile is # changed, then certain steps should be redone. If MAKE_FILE is @@ -1246,6 +43,10 @@ RANLIB=ranlib # MAKE_FILE= Makefile +# Calc configuration and compile configuration values +# +CONFIG_MKF= Makefile.config + # Host targets that are shared in common with both Makefile # and custom/Makefile. # @@ -1254,169 +55,17 @@ TARGET_MKF= Makefile.target # Local file that is included just prior to the first rule, # that allows one to override any values set in this Makefile. # -LOC_MKF= Makefile.local +LOCAL_MKF= Makefile.local # The set of Makefiles # -MK_SET= ${MAKE_FILE} ${TARGET_MKF} ${LOC_MKF} +MK_SET= ${MAKE_FILE} ${CONFIG_MKF} ${TARGET_MKF} ${LOCAL_MKF} -# If you do not wish to use purify, set PURIFY to an empty string. -# -# If in doubt, use PURIFY= -# -#PURIFY= purify -#PURIFY= purify -m71-engine -#PURIFY= purify -logfile=pure.out -#PURIFY= purify -m71-engine -logfile=pure.out -PURIFY= -# If you want to use a debugging link library such as a malloc debug link -# library, or need to add special ld flags after the calc link libraries -# are included, set ${LD_DEBUG} below. -# -# If in doubt, set LD_DEBUG to empty. -# -#LD_DEBUG= -lmalloc_cv -LD_DEBUG= - -# When doing a: -# -# make check -# make chk -# make debug -# -# the ${CALC_ENV} is used to supply the proper environment variables -# to calc. Most people will simply need 'CALCPATH=./cal' to ensure -# that these debug rules will only use calc resource files under the -# local source directory. -# -# If in doubt, use: -# -# CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.:./custom DYLD_LIBRARY_PATH=. -# -ifeq ($(ALLOW_CUSTOM),-DCUSTOM) -CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=. DYLD_LIBRARY_PATH=. CALCHELP=./help \ - CALCCUSTOMHELP=./custom -else # ($(ALLOW_CUSTOM),-DCUSTOM) -CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=. DYLD_LIBRARY_PATH=. CALCHELP=./help -endif # ($(ALLOW_CUSTOM),-DCUSTOM) - -# Some out of date operating systems require/want an executable to -# end with a certain file extension. Some compiler systems such as -# Windows build calc as calc.exe. The EXT variable is used to denote -# the extension required by such. Note that Cygwin requires EXT to be -# the same as Linux/Un*x/GNU, even though it runs under Windows. -# -# EXT= # normal Un*x / Linux / GNU/Linux / Cygwin -# EXT=.exe # Windows -# -# If in doubt, use EXT= -# -EXT= -#EXT=.exe - -# The default calc versions -# -VERSION= 2.14.3.1 - -# Names of shared libraries with versions -# -LIB_EXT= .so -LIB_EXT_VERSION= ${LIB_EXT}.${VERSION} - -# standard utilities used during make -# -AR= ar -AWK= awk -CAT= cat -CHMOD= chmod -CMP= cmp -CO= co -COL= col -CP= cp -CTAGS= ctags -DATE= date -DIFF= diff -FMT= fmt -GREP= grep -HOSTNAME= hostname -LANG= C -LDCONFIG= ldconfig -LN= ln -LS= ls -MAKE= make -MAKEDEPEND= makedepend -MKDIR= mkdir -MV= mv -PWDCMD= pwd -RM= rm -RMDIR= rmdir -SED= sed -SORT= sort -SPLINT= splint -SPLINT_OPTS= -STRIP= strip -TEE= tee -TAIL= tail -TOUCH= touch -TRUE= true -UNAME= uname -XARGS= xargs - -# NOTE: On some shells, echo is a builtin that does -# not understand -n, so we call /bin/echo -n -# directly to get around such shells. -# -ECHON= /bin/echo -n - -# Extra compiling and linking flags -# -# EXTRA_CFLAGS are flags given to ${CC} when compiling C files -# EXTRA_LDFLAGS are flags given to ${CC} when linking programs -# -# Both CFLAGS and LDFLAGS are left blank in this Makefile by -# default so that users may use them on the make command line -# to always set the way that C is compiled and files are linked -# respectively. For example: -# -# make all EXTRA_CFLAGS="-DMAGIC" EXTRA_LDFLAGS="-lmagic" -# -# NOTE: These should be left blank in this Makefile to make it -# easier to add stuff on the command line. If you want to -# to change the way calc is compiled by this Makefile, change -# the appropriate host target section below or a flag above. -# -EXTRA_CFLAGS= -EXTRA_LDFLAGS= - -# Architecture compile flags -# -# The ARCH_CFLAGS are ${CC} when compiling C files. They follow -# CCMISC and precede EXTRA_CFLAGS. -# -# When ARCH_CFLAGS is empty, the native binary architecture is assumed. -# -ARCH_CFLAGS= -# ARCH_CFLAGS= -arch i386 # old Intel binary -# ARCH_CFLAGS= -arch ppc # Power PC binary -# ARCH_CFLAGS= -arch x86_64 # Intel 64-bit binary -# ARCH_CFLAGS= -arch arm64 # Apple Silicon binary -# ARCH_CFLAGS= -arch arm64 -arch x86_64 # Apple Silicon and Intel 64-bit binary -# ARCH_CFLAGS= -arch i386 -arch ppc # old Intel and Power PC binary - -# COMMON_CFLAGS are the common ${CC} flags used for all programs, both -# intermediate and final calc and calc related programs -# -ifeq ($(ALLOW_CUSTOM),-DCUSTOM) -COMMON_CFLAGS= -DCALC_SRC ${ALLOW_CUSTOM} ${CCWARN} ${CCMISC} ${ARCH_CFLAGS} ${EXTRA_CFLAGS} -else # ($(ALLOW_CUSTOM),-DCUSTOM) -COMMON_CFLAGS= -DCALC_SRC -UCUSTOM ${CCWARN} ${CCMISC} ${ARCH_CFLAGS} ${EXTRA_CFLAGS} -endif # ($(ALLOW_CUSTOM),-DCUSTOM) - -# COMMON_LDFLAGS are the common flags used for linking all programs, both -# intermediate and final calc and calc related programs -# -COMMON_LDFLAGS= ${EXTRA_LDFLAGS} +####################################################### +# Calc configuration and compile configuration values # +####################################################### +include ${CONFIG_MKF} ############################### @@ -1886,21 +535,23 @@ PHONY= all calcliblist calc_version check chk clobber debug depend distdir \ distlist hsrc install inst_files mkdebug rpm sample splint tags \ uninstall win32_hsrc -### -# -# Allow Makefile.local to override any of the above settings -# -### -include ${LOC_MKF} +############################################################ +# Allow Makefile.local to change any of the above settings # +############################################################ +include ${LOCAL_MKF} -### -# -# The main reason for this Makefile :-) -# -### + +########################################### +# all - First and default Makefile target # +########################################### all: check_include ${BLD_TYPE} CHANGES + +############################### +# additional Makefile targets # +############################### + .PHONY: ${PHONY} check_include: @@ -4260,6 +2911,7 @@ env: @echo 'ALIGN32=${ALIGN32}'; echo '' @echo 'ALLOW_CUSTOM=${ALLOW_CUSTOM}'; echo '' @echo 'AR=${AR}'; echo '' + @echo 'arch=${arch}'; echo '' @echo 'ARCH_CFLAGS=${ARCH_CFLAGS}'; echo '' @echo 'AWK=${AWK}'; echo '' @echo 'BINDIR=${BINDIR}'; echo '' @@ -4267,16 +2919,16 @@ env: @echo 'BUILD_C_SRC=${BUILD_C_SRC}'; echo '' @echo 'BUILD_H_SRC=${BUILD_H_SRC}'; echo '' @echo 'BYTE_ORDER=${BYTE_ORDER}'; echo '' + @echo 'CALC_DYNAMIC_LIBS=${CALC_DYNAMIC_LIBS}'; echo '' + @echo 'CALC_ENV=${CALC_ENV}'; echo '' + @echo 'CALC_INCDIR=${CALC_INCDIR}'; echo '' @echo 'CALCLIBLIST=${CALCLIBLIST}'; echo '' @echo 'CALCOBJS=${CALCOBJS}'; echo '' @echo 'CALCPAGER=${CALCPAGER}'; echo '' @echo 'CALCPATH=${CALCPATH}'; echo '' @echo 'CALCRC=${CALCRC}'; echo '' - @echo 'CALCSRC=${CALCSRC}'; echo '' - @echo 'CALC_DYNAMIC_LIBS=${CALC_DYNAMIC_LIBS}'; echo '' - @echo 'CALC_ENV=${CALC_ENV}'; echo '' - @echo 'CALC_INCDIR=${CALC_INCDIR}'; echo '' @echo 'CALC_SHAREDIR=${CALC_SHAREDIR}'; echo '' + @echo 'CALCSRC=${CALCSRC}'; echo '' @echo 'CALC_STATIC_LIBS=${CALC_STATIC_LIBS}'; echo '' @echo 'CAL_PASSDOWN=${CAL_PASSDOWN}'; echo '' @echo 'CAT=${CAT}'; echo '' @@ -4297,15 +2949,16 @@ env: @echo 'COMMON_ADD=${COMMON_ADD}'; echo '' @echo 'COMMON_CFLAGS=${COMMON_CFLAGS}'; echo '' @echo 'COMMON_LDFLAGS=${COMMON_LDFLAGS}'; echo '' + @echo 'CONFIG_MKF=${CONFIG_MKF}'; echo '' @echo 'CP=${CP}'; echo '' @echo 'CSCRIPT_PASSDOWN=${CSCRIPT_PASSDOWN}'; echo '' @echo 'CSCRIPT_TARGETS=${CSCRIPT_TARGETS}'; echo '' + @echo 'C_SRC=${C_SRC}'; echo '' @echo 'CTAGS=${CTAGS}'; echo '' @echo 'CUSTOMCALDIR=${CUSTOMCALDIR}'; echo '' @echo 'CUSTOMHELPDIR=${CUSTOMHELPDIR}'; echo '' @echo 'CUSTOMINCDIR=${CUSTOMINCDIR}'; echo '' @echo 'CUSTOM_PASSDOWN=${CUSTOM_PASSDOWN}'; echo '' - @echo 'C_SRC=${C_SRC}'; echo '' @echo 'DATE=${DATE}'; echo '' @echo 'DEBUG=${DEBUG}'; echo '' @echo 'DEFAULT_LIB_INSTALL_PATH=${DEFAULT_LIB_INSTALL_PATH}'; echo '' @@ -4320,6 +2973,7 @@ env: @echo 'FPOS_POS_BITS=${FPOS_POS_BITS}'; echo '' @echo 'GREP=${GREP}'; echo '' @echo 'H=${H}'; echo '' + @echo 'hardware=${hardware}'; echo '' @echo 'HAVE_ARC4RANDOM=${HAVE_ARC4RANDOM}'; echo '' @echo 'HAVE_CONST=${HAVE_CONST}'; echo '' @echo 'HAVE_ENVIRON=${HAVE_ENVIRON}'; echo '' @@ -4344,11 +2998,11 @@ env: @echo 'HAVE_STRLCPY=${HAVE_STRLCPY}'; echo '' @echo 'HAVE_SYS_MOUNT_H=${HAVE_SYS_MOUNT_H}'; echo '' @echo 'HAVE_SYS_PARAM_H=${HAVE_SYS_PARAM_H}'; echo '' - @echo 'HAVE_SYS_TIMES_H=${HAVE_SYS_TIMES_H}'; echo '' @echo 'HAVE_SYS_TIME_H=${HAVE_SYS_TIME_H}'; echo '' + @echo 'HAVE_SYS_TIMES_H=${HAVE_SYS_TIMES_H}'; echo '' @echo 'HAVE_SYS_VFS_H=${HAVE_SYS_VFS_H}'; echo '' - @echo 'HAVE_TIMES_H=${HAVE_TIMES_H}'; echo '' @echo 'HAVE_TIME_H=${HAVE_TIME_H}'; echo '' + @echo 'HAVE_TIMES_H=${HAVE_TIMES_H}'; echo '' @echo 'HAVE_UID_T=${HAVE_UID_T}'; echo '' @echo 'HAVE_UNISTD_H=${HAVE_UNISTD_H}'; echo '' @echo 'HAVE_UNUSED=${HAVE_UNUSED}'; echo '' @@ -4367,18 +3021,18 @@ env: @echo 'LATE_TARGETS=${LATE_TARGETS}'; echo '' @echo 'LCC=${LCC}'; echo '' @echo 'LDCONFIG=${LDCONFIG}'; echo '' - @echo 'LDFLAGS=${LDFLAGS}'; echo '' @echo 'LD_DEBUG=${LD_DEBUG}'; echo '' + @echo 'LDFLAGS=${LDFLAGS}'; echo '' @echo 'LD_SHARE=${LD_SHARE}'; echo '' @echo 'LIBCALC_SHLIB=${LIBCALC_SHLIB}'; echo '' @echo 'LIBCUSTCALC_SHLIB=${LIBCUSTCALC_SHLIB}'; echo '' @echo 'LIBDIR=${LIBDIR}'; echo '' + @echo 'LIB_H_SRC=${LIB_H_SRC}'; echo '' @echo 'LIBOBJS=${LIBOBJS}'; echo '' @echo 'LIBSRC=${LIBSRC}'; echo '' - @echo 'LIB_H_SRC=${LIB_H_SRC}'; echo '' @echo 'LICENSE=${LICENSE}'; echo '' @echo 'LN=${LN}'; echo '' - @echo 'LOC_MKF=${LOC_MKF}'; echo '' + @echo 'LOCAL_MKF=${LOCAL_MKF}'; echo '' @echo 'LONG_BITS=${LONG_BITS}'; echo '' @echo 'MAKE=${MAKE}'; echo '' @echo 'MAKEDEPEND=${MAKEDEPEND}'; echo '' @@ -4420,8 +3074,9 @@ env: @echo 'SPLINT_OPTS=${SPLINT_OPTS}'; echo '' @echo 'SYM_DYNAMIC_LIBS=${SYM_DYNAMIC_LIBS}'; echo '' @echo 'T=${T}'; echo '' - @echo 'TARGETS=${TARGETS}'; echo '' + @echo 'target=${target}'; echo '' @echo 'TARGET_MKF=${TARGET_MKF}'; echo '' + @echo 'TARGETS=${TARGETS}'; echo '' @echo 'TEE=${TEE}'; echo '' @echo 'TERMCONTROL=${TERMCONTROL}'; echo '' @echo 'TOUCH=${TOUCH}'; echo '' @@ -4440,16 +3095,16 @@ env: @echo 'WNO_IMPLICT=${WNO_IMPLICT};' echo '' @echo 'WNO_LONG_LONG=${WNO_LONG_LONG}'; echo '' @echo 'XARGS=${XARGS}'; echo '' - @echo 'arch=${arch}'; echo '' - @echo 'hardware=${hardware}'; echo '' - @echo 'target=${target}'; echo '' @echo '=-=-=-=-= ${MAKE_FILE} end of major make variable dump =-=-=-=-=' mkdebug: env version.c @echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' - @echo '=-=-=-= Contents of ${LOC_MKF} follows =-=-=-=' - -@${CAT} ${LOC_MKF} - @echo '=-=-=-= End of contents of ${LOC_MKF} =-=-=-=' + @echo '=-=-=-= Contents of ${LOCAL_MKF} follows =-=-=-=' + -@${CAT} ${LOCAL_MKF} + @echo '=-=-=-= End of contents of ${LOCAL_MKF} =-=-=-=' + @echo '=-=-=-= Contents of ${CONFIG_MKF} follows =-=-=-=' + -@${CAT} ${CONFIG_MKF} + @echo '=-=-=-= End of contents of ${CONFIG_MKF} =-=-=-=' @echo '=-=-=-= Contents of ${TARGET_MKF} follows =-=-=-=' -@${CAT} ${TARGET_MKF} @echo '=-=-=-= End of contents of ${TARGET_MKF} =-=-=-=' @@ -4466,9 +3121,12 @@ mkdebug: env version.c full_debug: calcinfo env @echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' - @echo '=-=-=-= Contents of ${LOC_MKF} follows =-=-=-=' - -@${CAT} ${LOC_MKF} - @echo '=-=-=-= End of contents of ${LOC_MKF} =-=-=-=' + @echo '=-=-=-= Contents of ${LOCAL_MKF} follows =-=-=-=' + -@${CAT} ${LOCAL_MKF} + @echo '=-=-=-= End of contents of ${LOCAL_MKF} =-=-=-=' + @echo '=-=-=-= Contents of ${CONFIG_MKF} follows =-=-=-=' + -@${CAT} ${CONFIG_MKF} + @echo '=-=-=-= End of contents of ${CONFIG_MKF} =-=-=-=' @echo '=-=-=-= Contents of ${TARGET_MKF} follows =-=-=-=' -@${CAT} ${TARGET_MKF} @echo '=-=-=-= End of contents of ${TARGET_MKF} =-=-=-=' @@ -4594,7 +3252,7 @@ rpm-clean-static: # Form the installed file list # -inst_files: ${MAKE_FILE} ${LOC_MKF} ${TARGET_MKF} help/Makefile cal/Makefile \ +inst_files: ${MK_SET} help/Makefile cal/Makefile \ cscript/Makefile ver_calc${EXT} custom/Makefile ${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' ${Q} ${RM} -f inst_files diff --git a/Makefile.config b/Makefile.config new file mode 100644 index 0000000..a43f057 --- /dev/null +++ b/Makefile.config @@ -0,0 +1,1396 @@ +#!/usr/bin/env make +# +# Makefile.config - Calc configuration and compile configuration values +# +# Copyright (C) 2023 Landon Curt Noll +# +# Suggestion: Read the HOWTO.INSTALL file. +# +# Calc is open software; you can redistribute it and/or modify it under +# the terms of version 2.1 of the GNU Lesser General Public License +# as published by the Free Software Foundation. +# +# Calc is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General +# Public License for more details. +# +# A copy of version 2.1 of the GNU Lesser General Public License is +# distributed with calc under the filename COPYING-LGPL. You should have +# received a copy with calc; if not, write to Free Software Foundation, Inc. +# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + + + +# We do not support parallel make of calc. We have found most +# parallel make systems do not get the rule dependency order +# correct, resulting in a failed attempt to compile calc. +# +# If you believe you have a way to get a parallel make of calc +# to work, consider submitting a pull request with a +# proposed change. +# +.NOTPARALLEL: + + +############################## +# Set the target information # +############################## + +# NOTE: You can force a target value by defining target as in: +# +# make ...__optional_arguments_... target=value +# +# Try uname -s if the target was not already set on the make command line +# +ifeq ($(target),) +target=$(shell uname -s 2>/dev/null) +endif # ($(target),) +ifeq ($(arch),) +arch=$(shell uname -p 2>/dev/null) +endif # ($(arch),) +ifeq ($(hardware),) +hardware=$(shell uname -m 2>/dev/null) +endif # ($(hardware),) +ifeq ($(OSNAME),) +OSNAME=$(shell uname -o 2>/dev/null) +endif # ($(OSNAME),) + + +################################### +# Set the shell used in Makefiles # +################################### + +# The shell used by this Makefile +# +# On some systems, /bin/sh is a rather reduced shell with +# deprecated behavior. +# +# If your system has a up to date, bash shell, then +# you may wish to use: +# +# 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= sh +# +SHELL= bash +#SHELL= sh + +# Darwin shell default +# +ifeq ($(target),Darwin) +SHELL:= /bin/sh +endif # ($(target),Darwin) + +# If you are using Cygwin with MinGW64 packages +# then we will also need to use the Cygwin runtime enviroment +# and the calc Cygwin make target. +## +ifeq ($(OSNAME),Cygwin) +target:= Cygwin +endif # ($(OSNAME),Cygwin) + + +############################################################################## +#-=-=-=-=-=-=-=-=- You may want to change some values below -=-=-=-=-=-=-=-=-# +############################################################################## + +# PREFIX - Top level location for calc +# +# The PREFIX is often prepended to paths within calc and calc Makefiles. +# +# Starting with calc v2.13.0.1, nearly all Makefile places that used +# /usr/local now use ${PREFIX}. An exception is the olduninstall rule +# and, of course, this section. :-) +# +# NOTE: The ${PREFIX} is not the same as ${T}. The ${T} specifies +# a top level directory under which calc installs things. +# While usually ${T} is empty, it can be specific path +# as if calc where "chrooted" during an install. +# The ${PREFIX} value, during install, is a path between +# the top level ${T} install directory and the object +# such as an include file. +# +# NOTE: See also, ${T}, below. +# +# There are some paths that do NOT call under ${PREFIX}, such as +# ${CALCPATH}, that include paths not under ${PREFIX}, but those +# too are exceptions to this general rule. +# +# When in doubt, try: +# +# PREFIX= /usr/local +# +PREFIX= /usr/local +#PREFIX= /usr +#PREFIX= /usr/global + +# CCBAN is given to ${CC} in order to control if banned.h is in effect. +# +# The banned.h attempts to ban the use of certain dangerous functions +# that, if improperly used, could compromise the computational integrity +# if calculations. +# +# In the case of calc, we are motivated in part by the desire for calc +# to correctly calculate: even during extremely long calculations. +# +# If UNBAN is NOT defined, then calling certain functions +# will result in a call to a non-existent function (link error). +# +# While we do NOT encourage defining UNBAN, there may be +# a system / compiler environment where re-defining a +# function may lead to a fatal compiler complication. +# If that happens, consider compiling as: +# +# make clobber all chk CCBAN=-DUNBAN +# +# as see if this is a work-a-round. +# +# If YOU discover a need for the -DUNBAN work-a-round, PLEASE tell us! +# Please send us a bug report. See the file: +# +# BUGS +# +# or the URL: +# +# http://www.isthe.com/chongo/tech/comp/calc/calc-bugrept.html +# +# for how to send us such a bug report. +# +CCBAN= -UUNBAN +#CCBAN= -DUNBAN + +# Determine the type of terminal controls that you want to use +# +# value meaning +# -------- ------- +# (nothing) let the Makefile guess at what you need +# -DUSE_TERMIOS use struct termios from +# -DUSE_TERMIO use struct termios from +# -DUSE_SGTTY use struct sgttyb from +# -DUSE_NOTHING Windows system, don't use any of them +# +# Select TERMCONTROL= -DUSE_TERMIOS for DJGPP. +# +# If in doubt, leave TERMCONTROL empty. +# +TERMCONTROL= +#TERMCONTROL= -DUSE_TERMIOS +#TERMCONTROL= -DUSE_TERMIO +#TERMCONTROL= -DUSE_SGTTY +#TERMCONTROL= -DUSE_WIN32 + +# If your system does not have a vsnprintf() function, you could be in trouble. +# +# vsnprintf(string, size, format, ap) +# +# This function works like spnrintf except that the 4th arg is a va_list +# strarg (or varargs) list. Some old systems do not have vsnprintf(). +# If you do not have vsnprintf(), then calc will try snprintf() and hope +# for the best. +# +# A similar problem occurs if your system does not have a vsnprintf() +# function. This function is like the vsnprintf() function except that +# there is an extra second argument that controls the maximum size +# string that is produced. +# +# If HAVE_VSNPRINTF is empty, this Makefile will run the have_stdvs.c and/or +# have_varvs.c program to determine if vsnprintf() is supported. If +# HAVE_VSNPRINTF is set to -DDONT_HAVE_VSNPRINTF then calc will hope that +# snprintf() will work. +# +# If in doubt, leave HAVE_VSNPRINTF empty. +# +HAVE_VSNPRINTF= +#HAVE_VSNPRINTF= -DDONT_HAVE_VSNPRINTF + +# Determine the byte order of your machine +# +# Big Endian: Amdahl, 68k, Pyramid, Mips, Sparc, ... +# Little Endian: Vax, 32k, Spim (Dec Mips), i386, i486, ... +# +# If in doubt, leave CALC_BYTE_ORDER empty. This Makefile will attempt to +# use BYTE_ORDER in or it will attempt to run +# the endian program. If you get syntax errors when you compile, +# try forcing the value to be -DBIG_ENDIAN and run the calc regression +# tests. (see the README.FIRST file) If the calc regression tests fail, do +# a make clobber and try -DCALC_LITTLE_ENDIAN. If that fails, ask a wizard +# for help. +# +# Select CALC_BYTE_ORDER= -DCALC_LITTLE_ENDIAN for DJGPP. +# +CALC_BYTE_ORDER= +#CALC_BYTE_ORDER= -DBIG_ENDIAN +#CALC_BYTE_ORDER= -DLITTLE_ENDIAN + +# Determine the number of bits in a byte +# +# If in doubt, leave CALC_CHARBIT empty. This Makefile will run +# the charbits program to determine the length. +# +# In order to avoid make brain damage in some systems, we avoid placing +# a space after the ='s below. +# +# Select CALC_CHARBIT= 8 for DJGPP. +# +CALC_CHARBIT= +#CALC_CHARBIT= 8 + +# Determine the number of bits in a long +# +# If in doubt, leave LONG_BITS empty. This Makefile will run +# the longbits program to determine the length. +# +# In order to avoid make brain damage in some systems, we avoid placing +# a space after the ='s below. +# +# Select LONG_BITS= 32 for DJGPP. +# +LONG_BITS= +#LONG_BITS= 32 +#LONG_BITS= 64 + +# Determine if we have the ANSI C fgetpos and fsetpos alternate interface +# to the ftell() and fseek() (with whence set to SEEK_SET) functions. +# +# If HAVE_FGETSETPOS is empty, this Makefile will run the have_fpos program +# to determine if there is are fgetpos and fsetpos functions. If HAVE_FGETSETPOS +# is set to -DHAVE_NO_FGETSETPOS, then calc will use ftell() and fseek(). +# +# If in doubt, leave HAVE_FGETSETPOS empty and this Makefile will figure it out. +# +HAVE_FGETSETPOS= +#HAVE_FGETSETPOS= -DHAVE_NO_FGETSETPOS + +# Determine if we have an __pos element of a file position (fpos_t) structure. +# +# If HAVE_FPOS_POS is empty, this Makefile will run the have_fpos_pos program +# to determine if fpos_t has a __pos structure element. If HAVE_FPOS_POS +# is set to -DHAVE_NO_FPOS_POS, then calc assume there is no __pos element. +# +# Select HAVE_FPOS_POS= -DHAVE_NO_FPOS_POS for DJGPP. +# +# If in doubt, leave HAVE_FPOS_POS empty and this Makefile will figure it out. +# +HAVE_FPOS_POS= +#HAVE_FPOS_POS= -DHAVE_NO_FPOS_POS + +# Determine the size of the __pos element in fpos_t, if it exists. +# +# If FPOS_POS_BITS is empty, then the Makefile will determine the size of +# the file position value of the __pos element. +# +# If there is no __pos element in fpos_t (say because fpos_t is a scalar), +# leave FPOS_POS_BITS blank. +# +# If in doubt, leave FPOS_POS_BITS empty and this Makefile will figure it out. +# +FPOS_POS_BITS= +#FPOS_POS_BITS= 32 +#FPOS_POS_BITS= 64 + +# Determine the size of a file position value. +# +# If FPOS_BITS is empty, then the Makefile will determine the size of +# the file position value. +# +# Select FPOS_BITS= 32 for DJGPP. +# +# If in doubt, leave FPOS_BITS empty and this Makefile will figure it out. +# +FPOS_BITS= +#FPOS_BITS= 32 +#FPOS_BITS= 64 + +# Determine the size of the off_t file offset element +# +# If OFF_T_BITS is empty, then the Makefile will determine the size of +# the file offset value. +# +# Select OFF_T_BITS= 32 for DJGPP. +# +# If in doubt, leave OFF_T_BITS empty and this Makefile will figure it out. +# +OFF_T_BITS= +#OFF_T_BITS= 32 +#OFF_T_BITS= 64 + +# Determine the size of the dev_t device value +# +# If DEV_BITS is empty, then the Makefile will determine the size of +# the dev_t device value +# +# Select DEV_BITS= 32 for DJGPP. +# +# If in doubt, leave DEV_BITS empty and this Makefile will figure it out. +# +DEV_BITS= +#DEV_BITS= 16 +#DEV_BITS= 32 +#DEV_BITS= 64 + +# Determine the size of the ino_t device value +# +# If INODE_BITS is empty, then the Makefile will determine the size of +# the ino_t inode value +# +# Select INODE_BITS= 32 for DJGPP. +# +# If in doubt, leave INODE_BITS empty and this Makefile will figure it out. +# +INODE_BITS= +#INODE_BITS= 16 +#INODE_BITS= 32 +#INODE_BITS= 64 + +# Determine if we have an off_t which one can perform arithmetic operations, +# assignments and comparisons. On some systems off_t is some sort of union +# or struct. +# +# If HAVE_OFFSCL is empty, this Makefile will run the have_offscl program +# to determine if off_t is a scalar. If HAVE_OFFSCL is set to the value +# -DOFF_T_NON_SCALAR when calc will assume that off_t some sort of +# union or struct. +# +# If in doubt, leave HAVE_OFFSCL empty and this Makefile will figure it out. +# +HAVE_OFFSCL= +#HAVE_OFFSCL= -DOFF_T_NON_SCALAR + +# Determine if we have an fpos_t which one can perform arithmetic operations, +# assignments and comparisons. On some systems fpos_t is some sort of union +# or struct. Some systems do not have an fpos_t and long is as a file +# offset instead. +# +# If HAVE_POSSCL is empty, this Makefile will run the have_offscl program +# to determine if off_t is a scalar, or if there is no off_t and long +# (a scalar) should be used instead. If HAVE_POSSCL is set to the value +# -DFILEPOS_NON_SCALAR when calc will assume that fpos_t exists and is +# some sort of union or struct. +# +# If in doubt, leave HAVE_POSSCL empty and this Makefile will figure it out. +# +HAVE_POSSCL= +#HAVE_POSSCL= -DFILEPOS_NON_SCALAR + +# Determine if we have ANSI C const. +# +# If HAVE_CONST is empty, this Makefile will run the have_const program +# to determine if const is supported. If HAVE_CONST is set to -DHAVE_NO_CONST, +# then calc will not use const. +# +# If in doubt, leave HAVE_CONST empty and this Makefile will figure it out. +# +HAVE_CONST= +#HAVE_CONST= -DHAVE_NO_CONST + +# Determine if we have uid_t +# +# If HAVE_UID_T is empty, this Makefile will run the have_uid_t program +# to determine if uid_t is supported. If HAVE_UID_T is set to -DHAVE_NO_UID_T, +# then calc will treat uid_t as an unsigned short. This only matters if +# $HOME is not set and calc must look up the home directory in /etc/passwd. +# +# If in doubt, leave HAVE_UID_T empty and this Makefile will figure it out. +# +HAVE_UID_T= +#HAVE_UID_T= -DHAVE_NO_UID_T + +# Determine if we have a non-NULL user environment external: +# +# extern char **environ; /* user environment */ +# +# If HAVE_ENVIRON is empty, this Makefile will run the have_environ program +# to determine if environ exists and is non-NULL. If HAVE_ENVIRON is set +# to -DHAVE_NO_ENVIRON, then calc will assume there is no external environ +# symbol. +# +# If in doubt, leave HAVE_ENVIRON empty and this Makefile will figure it out. +# +HAVE_ENVIRON= +#HAVE_ENVIRON= -DHAVE_NO_ENVIRON + +# Determine if we have the arc4random_buf() function +# +# If HAVE_ARC4RANDOM is empty, this Makefile will run the have_arc4random +# program to determine if arc4random_buf() function exists. If +# HAVE_ARC4RANDOM is set to -DHAVE_NO_ARC4RANDOM, then calc will assume +# there is no arc4random_buf() function. +# +# If in doubt, leave HAVE_ARC4RANDOM empty and this Makefile will figure it out. +# +HAVE_ARC4RANDOM= +#HAVE_ARC4RANDOM= -DHAVE_NO_ARC4RANDOM + +# Determine if we have memcpy(), memset() and strchr() +# +# If HAVE_NEWSTR is empty, this Makefile will run the have_newstr program +# to determine if memcpy(), memset() and strchr() are supported. If +# HAVE_NEWSTR is set to -DHAVE_NO_NEWSTR, then calc will use bcopy() instead +# of memcpy(), use bfill() instead of memset(), and use index() instead of +# strchr(). +# +# If in doubt, leave HAVE_NEWSTR empty and this Makefile will figure it out. +# +HAVE_NEWSTR= +#HAVE_NEWSTR= -DHAVE_NO_NEWSTR + +# Determine if we have memmove() +# +# If HAVE_MEMMOVE is empty, this Makefile will run the have_memmv program +# to determine if memmove() is supported. If HAVE_MEMMOVE is set to +# -DHAVE_NO_MEMMOVE, then calc will use internal functions to simulate +# the memory move function that does correct overlapping memory moves. +# +# If in doubt, leave HAVE_MEMMOVE empty and this Makefile will figure it out. +# +HAVE_MEMMOVE= +#HAVE_MEMMOVE= -DHAVE_NO_MEMMOVE + +# Determine if we have ustat() +# +# If HAVE_USTAT is empty, this Makefile will run the have_ustat program +# to determine if ustat() is supported. If HAVE_USTAT is set to +# -DHAVE_NO_USTAT, then calc will use internal functions to simulate +# the ustat() function that gets file system statistics. +# +# Select HAVE_USTAT= -DHAVE_NO_USTAT for DJGPP. +# +# If in doubt, leave HAVE_USTAT empty and this Makefile will figure it out. +# +HAVE_USTAT= +#HAVE_USTAT= -DHAVE_NO_USTAT + +# Determine if we have statfs() +# +# If HAVE_STATFS is empty, this Makefile will run the have_statfs program +# to determine if statfs() is supported. If HAVE_STATFS is set to +# -DHAVE_NO_STATFS, then calc will use internal functions to simulate +# the statfs() function that gets file system statistics. +# +# Select HAVE_STATFS= -DHAVE_NO_STATFS for DJGPP. +# +# If in doubt, leave HAVE_STATFS empty and this Makefile will figure it out. +# +HAVE_STATFS= +#HAVE_STATFS= -DHAVE_NO_STATFS + +# Determine if we have the include file. +# +# HAVE_SYS_VFS_H= let the Makefile look for the include file +# HAVE_SYS_VFS_H= YES assume that the include file exists +# HAVE_SYS_VFS_H= NO assume that the include file does not exist +# +# Select HAVE_SYS_VFS_H= NO for DJGPP. +# +# When in doubt, leave HAVE_SYS_VFS_H empty. +# +HAVE_SYS_VFS_H= +#HAVE_SYS_VFS_H= YES +#HAVE_SYS_VFS_H= NO + +# Determine if we have the include file. +# +# HAVE_SYS_PARAM_H= let the Makefile look for the include file +# HAVE_SYS_PARAM_H= YES assume that the include file exists +# HAVE_SYS_PARAM_H= NO assume that the include file does not exist +# +# Select HAVE_SYS_PARAM_H= NO for DJGPP. +# +# When in doubt, leave HAVE_SYS_PARAM_H empty. +# +HAVE_SYS_PARAM_H= +#HAVE_SYS_PARAM_H= YES +#HAVE_SYS_PARAM_H= NO + +# Determine if we have the include file. +# +# HAVE_SYS_MOUNT_H= let the Makefile look for the include file +# HAVE_SYS_MOUNT_H= YES assume that the include file exists +# HAVE_SYS_MOUNT_H= NO assume that the include file does not exist +# +# Select HAVE_SYS_MOUNT_H= NO for DJGPP. +# +# When in doubt, leave HAVE_SYS_MOUNT_H empty. +# +HAVE_SYS_MOUNT_H= +#HAVE_SYS_MOUNT_H= YES +#HAVE_SYS_MOUNT_H= NO + +# Determine if we have getsid() +# +# If HAVE_GETSID is empty, this Makefile will run the have_getsid program +# to determine if getsid() is supported. If HAVE_GETSID is set to +# -DHAVE_NO_GETSID, then calc will use internal functions to simulate +# the getsid() function that gets session ID. +# +# Select HAVE_GETSID= -DHAVE_NO_GETSID for DJGPP. +# +# If in doubt, leave HAVE_GETSID empty and this Makefile will figure it out. +# +HAVE_GETSID= +#HAVE_GETSID= -DHAVE_NO_GETSID + +# Determine if we have getpgid() +# +# If HAVE_GETPGID is empty, this Makefile will run the have_getpgid program +# to determine if getpgid() is supported. If HAVE_GETPGID is set to +# -DHAVE_NO_GETPGID, then calc will use internal functions to simulate +# the getpgid() function that sets the process group ID. +# +# Select HAVE_GETPGID= -DHAVE_NO_GETPGID for DJGPP. +# +# If in doubt, leave HAVE_GETPGID empty and this Makefile will figure it out. +# +HAVE_GETPGID= +#HAVE_GETPGID= -DHAVE_NO_GETPGID + +# Determine if we have clock_gettime() +# +# If HAVE_GETTIME is empty, this Makefile will run the have_gettime program +# to determine if clock_gettime() is supported. If HAVE_GETTIME is set to +# -DHAVE_NO_GETTIME, then calc will use internal functions to simulate +# the clock_gettime() function. +# +# Select HAVE_GETTIME= -DHAVE_NO_GETTIME for DJGPP. +# +# If in doubt, leave HAVE_GETTIME empty and this Makefile will figure it out. +# +HAVE_GETTIME= +#HAVE_GETTIME= -DHAVE_NO_GETTIME + +# Determine if we have getprid() +# +# If HAVE_GETPRID is empty, this Makefile will run the have_getprid program +# to determine if getprid() is supported. If HAVE_GETPRID is set to +# -DHAVE_NO_GETPRID, then calc will use internal functions to simulate +# the getprid() function. +# +# Select HAVE_GETPRID= -DHAVE_NO_GETPRID for DJGPP. +# +# If in doubt, leave HAVE_GETPRID empty and this Makefile will figure it out. +# +HAVE_GETPRID= +#HAVE_GETPRID= -DHAVE_NO_GETPRID + +# Determine if we have the /dev/urandom +# +# HAVE_URANDOM_H= let the Makefile look for /dev/urandom +# HAVE_URANDOM_H= YES assume that /dev/urandom exists +# HAVE_URANDOM_H= NO assume that /dev/urandom does not exist +# +# Select HAVE_URANDOM_H= NO for DJGPP. +# +# When in doubt, leave HAVE_URANDOM_H empty. +# +HAVE_URANDOM_H= +#HAVE_URANDOM_H= YES +#HAVE_URANDOM_H= NO + +# Determine if we have getrusage() +# +# If HAVE_GETRUSAGE is empty, this Makefile will run the have_rusage program +# to determine if getrusage() is supported. If HAVE_GETRUSAGE is set to +# -DHAVE_NO_GETRUSAGE, then calc will use internal functions to simulate +# the getrusage() function. +# +# If in doubt, leave HAVE_GETRUSAGE empty and this Makefile will figure it out. +# +HAVE_GETRUSAGE= +#HAVE_GETRUSAGE= -DHAVE_NO_GETRUSAGE + +# Determine if we have strdup() +# +# If HAVE_STRDUP is empty, this Makefile will run the have_strdup program +# to determine if strdup() is supported. If HAVE_STRDUP is set to +# -DHAVE_NO_STRDUP, then calc will use internal functions to simulate +# the strdup() function. +# +# If in doubt, leave HAVE_STRDUP empty and this Makefile will figure it out. +# +HAVE_STRDUP= +#HAVE_STRDUP= -DHAVE_NO_STRDUP + +# Some architectures such as Sparc do not allow one to access 32 bit values +# that are not aligned on a 32 bit boundary. +# +# The Dec Alpha running OSF/1 will produce alignment error messages when +# align32.c tries to figure out if alignment is needed. Use the +# ALIGN32= -DMUST_ALIGN32 to force alignment and avoid such error messages. +# +# ALIGN32= let align32.c figure out if alignment is needed +# ALIGN32= -DMUST_ALIGN32 force 32 bit alignment +# ALIGN32= -UMUST_ALIGN32 allow non-alignment of 32 bit accesses +# +# Select ALIGN32= -UMUST_ALIGN32 for DJGPP. +# +# When in doubt, be safe and pick ALIGN32=-DMUST_ALIGN32. +# +ALIGN32= +#ALIGN32= -DMUST_ALIGN32 +#ALIGN32= -UMUST_ALIGN32 + +# Determine if we have the include file. +# +# HAVE_STDLIB_H= let the Makefile look for the include file +# HAVE_STDLIB_H= YES assume that the include file exists +# HAVE_STDLIB_H= NO assume that the include file does not exist +# +# Select HAVE_STDLIB_H= YES for DJGPP. +# +# When in doubt, leave HAVE_STDLIB_H empty. +# +HAVE_STDLIB_H= +#HAVE_STDLIB_H= YES +#HAVE_STDLIB_H= NO + +# Determine if we have the include file. +# +# HAVE_STRING_H= let the Makefile look for the include file +# HAVE_STRING_H= YES assume that the include file exists +# HAVE_STRING_H= NO assume that the include file does not exist +# +# Select HAVE_STRING_H= YES for DJGPP. +# +# When in doubt, leave HAVE_STRING_H empty. +# +HAVE_STRING_H= +#HAVE_STRING_H= YES +#HAVE_STRING_H= NO + +# Determine if we have the include file. +# +# HAVE_TIMES_H= let the Makefile look for the include file +# HAVE_TIMES_H= YES assume that the include file exists +# HAVE_TIMES_H= NO assume that the include file does not exist +# +# Select HAVE_TIMES_H= NO for DJGPP. +# +# When in doubt, leave HAVE_TIMES_H empty. +# +HAVE_TIMES_H= +#HAVE_TIMES_H= YES +#HAVE_TIMES_H= NO + +# Determine if we have the include file. +# +# HAVE_SYS_TIMES_H= let the Makefile look for the include file +# HAVE_SYS_TIMES_H= YES assume that the include file exists +# HAVE_SYS_TIMES_H= NO assume that the include file does not exist +# +# Select HAVE_SYS_TIMES_H= YES for DJGPP. +# +# When in doubt, leave HAVE_SYS_TIMES_H empty. +# +HAVE_SYS_TIMES_H= +#HAVE_SYS_TIMES_H= YES +#HAVE_SYS_TIMES_H= NO + +# Determine if we have the include file. +# +# HAVE_TIME_H= let the Makefile look for the include file +# HAVE_TIME_H= YES assume that the include file exists +# HAVE_TIME_H= NO assume that the include file does not exist +# +# Select HAVE_TIME_H= YES for DJGPP. +# +# When in doubt, leave HAVE_TIME_H empty. +# +HAVE_TIME_H= +#HAVE_TIME_H= YES +#HAVE_TIME_H= NO + +# Determine if we have the include file. +# +# HAVE_SYS_TIME_H= let the Makefile look for the include file +# HAVE_SYS_TIME_H= YES assume that the include file exists +# HAVE_SYS_TIME_H= NO assume that the include file does not exist +# +# Select HAVE_SYS_TIME_H= YES for DJGPP. +# +# When in doubt, leave HAVE_SYS_TIME_H empty. +# +HAVE_SYS_TIME_H= +#HAVE_SYS_TIME_H= YES +#HAVE_SYS_TIME_H= NO + +# Determine if we have the include file. +# +# HAVE_UNISTD_H= let the Makefile look for the include file +# HAVE_UNISTD_H= YES assume that the include file exists +# HAVE_UNISTD_H= NO assume that the include file does not exist +# +# Select HAVE_UNISTD_H= YES for DJGPP. +# +# When in doubt, leave HAVE_UNISTD_H empty. +# +HAVE_UNISTD_H= +#HAVE_UNISTD_H= YES +#HAVE_UNISTD_H= NO + +# Determine if we have the include file. +# +# HAVE_LIMITS_H= let the Makefile look for the include file +# HAVE_LIMITS_H= YES assume that the include file exists +# HAVE_LIMITS_H= NO assume that the include file does not exist +# +# Select HAVE_LIMITS_H= YES for DJGPP. +# +# When in doubt, leave HAVE_LIMITS_H empty. +# +HAVE_LIMITS_H= +#HAVE_LIMITS_H= YES +#HAVE_LIMITS_H= NO + +# Determine if our compiler allows the unused attribute +# +# If HAVE_UNUSED is empty, this Makefile will run the have_unused program +# to determine if the unused attribute is supported. If HAVE_UNUSED is set to +# -DHAVE_NO_UNUSED, then the unused attribute will not be used. +# +# Select HAVE_UNUSED= for DJGPP. +# +# If in doubt, leave HAVE_UNUSED empty and this Makefile will figure it out. +# +HAVE_UNUSED= +#HAVE_UNUSED= -DHAVE_NO_UNUSED + +# Determine if we allow use of "#pragma GCC poison func_name" +# +# If HAVE_PRAGMA_GCC_POSION is empty, then Makefile will run the +# have_bprag program to determine if the "#pragma GCC poison func_name" +# is supported. If HAVE_PRAGMA_GCC_POSION is set to +# -DHAVE_NO_PRAGMA_GCC_POSION. then the "#pragma GCC poison func_name" +# is not used. +# +# If in doubt, leave HAVE_PRAGMA_GCC_POSION empty and this Makefile +# will figure it out. +# +HAVE_PRAGMA_GCC_POSION= +#HAVE_PRAGMA_GCC_POSION= -DHAVE_NO_PRAGMA_GCC_POSION + +# Determine if we have strlcpy() +# +# If HAVE_STRLCPY is empty, this Makefile will run the have_strlcpy program +# to determine if strlcpy() is supported. If HAVE_STRLCPY is set to +# -DHAVE_NO_STRLCPY, then calc will use internal functions to simulate +# the strlcpy() function. +# +# If in doubt, leave HAVE_STRLCPY empty and this Makefile will figure it out. +# +HAVE_STRLCPY= +#HAVE_STRLCPY= -DHAVE_NO_STRLCPY + +# Determine if we have strlcat() +# +# If HAVE_STRLCAT is empty, this Makefile will run the have_strlcat program +# to determine if strlcat() is supported. If HAVE_STRLCAT is set to +# -DHAVE_NO_STRLCAT, then calc will use internal functions to simulate +# the strlcat() function. +# +# If in doubt, leave HAVE_STRLCAT empty and this Makefile will figure it out. +# +HAVE_STRLCAT= +#HAVE_STRLCAT= -DHAVE_NO_STRLCAT + +# System include files +# +# ${INCDIR} where the system include (.h) files are kept +# +# For DJGPP, select: +# +# INCDIR= /dev/env/DJDIR/include +# +# If in doubt, for non-macOS hosts set: +# +# INCDIR= /usr/include +# +# However, if you are on macOS then set: +# +# INCDIR= ${PREFIX}/include +ifeq ($(target),Darwin) + +# determine default INCDIR for macOS +# +ifeq ($(arch),powerpc) +# Default location for old systems such as Mac OS X 10.6 Snow Leopard +INCDIR= /usr/include +else # ($(arch),powerpc) +# Modern macOS such as macOS 10.11.6 and later +INCDIR= $(shell xcrun --sdk macosx --show-sdk-path 2>/dev/null)/usr/include +endif # ($(arch),powerpc) + +# default INCDIR for non-macOS +# +else # ($(target),Darwin) + +INCDIR= /usr/include +#INCDIR= ${PREFIX}/include +#INCDIR= /dev/env/DJDIR/include + +endif # ($(target),Darwin) + +# Where to install calc related things +# +# ${BINDIR} where to install calc binary files +# ${LIBDIR} where calc link library (*.a) files are installed +# ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files +# ${CALC_INCDIR} where the calc include files are installed +# +# NOTE: The install rule prepends installation paths with ${T}, which +# by default is empty. If ${T} is non-empty, then installation +# locations will be relative to the ${T} directory. +# +# NOTE: If you change LIBDIR to a non-standard location, you will need +# to make changes to your execution environment so that executables +# will search LIBDIR when they are resolving dynamic shared libraries. +# +# On OS X, this means you need to export $DYLD_LIBRARY_PATH +# to include the LIBDIR path in the value. +# +# On Linux and BSD, this means you need to export $LD_LIBRARY_PATH +# to include the LIBDIR path in the value. +# +# You might be better off not changing LIBDIR in the first place. +# +# For DJGPP, select: +# +# BINDIR= /dev/env/DJDIR/bin +# LIBDIR= /dev/env/DJDIR/lib +# CALC_SHAREDIR= /dev/env/DJDIR/share/calc +# +# If in doubt, for non-macOS hosts set: +# +# BINDIR= /usr/bin +# LIBDIR= /usr/lib +# CALC_SHAREDIR= /usr/share/calc +# +# However, if you are on macOS then set: +# +# BINDIR= ${PREFIX}/bin +# LIBDIR= ${PREFIX}/lib +# CALC_SHAREDIR= ${PREFIX}/share/calc +# +# NOTE: Starting with macOS El Capitan OS X 10.11, root by default +# could not mkdir under system locations, so macOS must now +# use the ${PREFIX} tree. + +# defaults for macOS +ifeq ($(target),Darwin) +BINDIR= ${PREFIX}/bin +LIBDIR= ${PREFIX}/lib +CALC_SHAREDIR= ${PREFIX}/share/calc + +# defaults for non-macOS +else # ($(target),Darwin) +# default BINDIR for non-macOS +BINDIR= /usr/bin +#BINDIR= ${PREFIX}/bin +#BINDIR= /dev/env/DJDIR/bin +# default LIBDIR for non-macOS +LIBDIR= /usr/lib +#LIBDIR= ${PREFIX}/lib +#LIBDIR= /dev/env/DJDIR/lib +# default CALC_SHAREDIR for non-macOS +CALC_SHAREDIR= /usr/share/calc +#CALC_SHAREDIR= ${PREFIX}/lib/calc +#CALC_SHAREDIR= /dev/env/DJDIR/share/calc +endif # ($(target),Darwin) + +# NOTE: Do not set CALC_INCDIR to /usr/include or ${PREFIX}/include!!! +# Always be sure that the CALC_INCDIR path ends in /calc to avoid +# conflicts with system or other application include files!!! +# +#CALC_INCDIR= ${PREFIX}/include/calc +#CALC_INCDIR= /dev/env/DJDIR/include/calc +CALC_INCDIR= ${INCDIR}/calc + +# By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR +# --------------------------------------------------------------- +# ${HELPDIR} where the help directory is installed +# ${CUSTOMCALDIR} where custom *.cal files are installed +# ${CUSTOMHELPDIR} where custom help files are installed +# ${CUSTOMINCDIR} where custom .h files are installed +# ${SCRIPTDIR} where calc shell scripts are installed +# +# NOTE: The install rule prepends installation paths with ${T}, which +# by default is empty. If ${T} is non-empty, then installation +# locations will be relative to the ${T} directory. +# +# If in doubt, set: +# +# HELPDIR= ${CALC_SHAREDIR}/help +# CALC_INCDIR= ${INCDIR}/calc +# CUSTOMCALDIR= ${CALC_SHAREDIR}/custom +# CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp +# CUSTOMINCDIR= ${CALC_INCDIR}/custom +# SCRIPTDIR= ${BINDIR}/cscript +# +HELPDIR= ${CALC_SHAREDIR}/help +CUSTOMCALDIR= ${CALC_SHAREDIR}/custom +CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp +CUSTOMINCDIR= ${CALC_INCDIR}/custom +SCRIPTDIR= ${BINDIR}/cscript + +# T - top level directory under which calc will be installed +# +# The calc install is performed under ${T}, the calc build is +# performed under /. The purpose for ${T} is to allow someone +# to install calc somewhere other than into the system area. +# +# For example, if: +# +# BINDIR= /usr/bin +# LIBDIR= /usr/lib +# CALC_SHAREDIR= /usr/share/calc +# +# and if: +# +# T= /var/tmp/testing +# +# Then the installation locations will be: +# +# calc binary files: /var/tmp/testing/usr/bin +# calc link library: /var/tmp/testing/usr/lib +# calc help, .cal ...: /var/tmp/testing/usr/share/calc +# ... etc ... /var/tmp/testing/... +# +# If ${T} is empty, calc is installed under /, which is the same +# top of tree for which it was built. If ${T} is non-empty, then +# calc is installed under ${T}, as if one had to chroot under +# ${T} for calc to operate. +# +# NOTE: The ${PREFIX} is not the same as ${T}. The ${T} specifies +# a top level directory under which calc installs things. +# While usually ${T} is empty, it can be specific path +# as if calc where "chrooted" during an install. +# The ${PREFIX} value, during install, is a path between +# the top level ${T} install directory and the object +# such as an include file. +# +# See ${PREFIX} above. +# +# If in doubt, use T= +# +T= + +# where man section 1 pages are installed +# +# Select MANDIR= /dev/env/DJDIR/man/man1 for DJGPP. +# +# Use MANDIR= to disable installation of the calc man (source) page. +# +# NOTE: man pages not installed by macOS must go under, +# (according to MANPATH as found in /private/etc/man.conf): +# +# MANDIR= ${PREFIX}/share/man/man1 +# +#MANDIR= +#MANDIR= ${PREFIX}/man/man1 +#MANDIR= /usr/man/man1 +# +ifeq ($(target),Darwin) +MANDIR= ${PREFIX}/share/man/man1 +else # ($(target),Darwin) +MANDIR= /usr/share/man/man1 +endif # ($(target),Darwin) +#MANDIR= /dev/env/DJDIR/man/man1 +#MANDIR= /usr/man/u_man/man1 +#MANDIR= /usr/contrib/man/man1 + +# where cat (formatted man) pages are installed +# +# Select CATDIR= /dev/env/DJDIR/man/cat1 for DJGPP. +# +# Use CATDIR= to disable installation of the calc cat (formatted) page. +# +# NOTE: If CATDIR is non-empty, then one should have either the +# ${NROFF} executable and/or the ${MANMAKE} executable. +# +CATDIR= +#CATDIR= ${PREFIX}/man/cat1 +#CATDIR= ${PREFIX}/catman/cat1 +#CATDIR= /usr/man/cat1 +#CATDIR= /usr/share/man/cat1 +#CATDIR= /dev/env/DJDIR/man/cat1 +#CATDIR= /var/cache/man/cat1 +#CATDIR= /usr/man/u_man/cat1 +#CATDIR= /usr/contrib/man/cat1 + +# extension to add on to the calc man page filename +# +# This is ignored if CATDIR is empty. +# +MANEXT= 1 +#MANEXT= l + +# extension to add on to the calc man page filename +# +# This is ignored if CATDIR is empty. +# +CATEXT= 1 +#CATEXT= 1.gz +#CATEXT= 0 +#CATEXT= l + +# how to format a man page +# +# If CATDIR is non-empty, then +# +# If NROFF is non-empty, then +# +# ${NROFF} ${NROFF_ARG} calc.1 > ${CATDIR}/calc.${CATEXT} +# is used to build and install the cat page +# +# else (NROFF is empty) +# +# ${MANMAKE} calc.1 ${CATDIR} +# is used to build and install the cat page +# else +# +# The cat page is not built or installed +# +# Select NROFF= groff for DJGPP. +# +# If in doubt and you don't want to fool with man pages, set MANDIR +# and CATDIR to empty and ignore the NROFF, NROFF_ARG and MANMAKE +# lines below. +# +#NROFF= nroff +NROFF= +#NROFF= groff +NROFF_ARG= -man +#NROFF_ARG= -mandoc +MANMAKE= ${PREFIX}/bin/manmake +#MANMAKE= manmake +MANMODE= 0444 +CATMODE= 0444 + +# By default, custom builtin functions may only be executed if calc +# is given the -C option. This is because custom builtin functions +# may invoke non-standard or non-portable code. One may completely +# disable custom builtin functions by not compiling any custom code +# +# ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given +# ALLOW_CUSTOM= -UCUSTOM # disable custom even if -C is given +# +# If in doubt, use ALLOW_CUSTOM= -DCUSTOM +# +ALLOW_CUSTOM= -DCUSTOM +#ALLOW_CUSTOM= -UCUSTOM + +# If the $CALCPATH environment variable is not defined, then the following +# path will be searched for calc resource file routines. +# +# Select CALCPATH= .;./cal;~/.cal;${CALC_SHAREDIR};${CUSTOMCALDIR} for DJGPP. +# +ifeq ($(ALLOW_CUSTOM),-DCUSTOM) +CALCPATH= .:./cal:~/.cal:${T}${CALC_SHAREDIR}:${T}${CUSTOMCALDIR} +else # ($(ALLOW_CUSTOM),-DCUSTOM) +CALCPATH= .:./cal:~/.cal:${T}${CALC_SHAREDIR} +endif # ($(ALLOW_CUSTOM),-DCUSTOM) + +# When RPM_TOP is defined, we do not use ${T} +# +ifdef RPM_TOP +ifeq ($(ALLOW_CUSTOM),-DCUSTOM) +CALCPATH:= .:./cal:~/.cal:${CALC_SHAREDIR}:${CUSTOMCALDIR} +else # ($(ALLOW_CUSTOM),-DCUSTOM) +CALCPATH:= .:./cal:~/.cal:${CALC_SHAREDIR} +endif # ($(ALLOW_CUSTOM),-DCUSTOM) +endif # RPM_TOP + +# If the $CALCRC environment variable is not defined, then the following +# path will be searched for calc resource files. +# +# Select CALCRC= ./.calcinit:~/.calcrc:${CALC_SHAREDIR}/startup for DJGPP. +# +CALCRC= ./.calcinit:~/.calcrc:${CALC_SHAREDIR}/startup +#CALCRC= ./.calcinit;~/.calcrc;${CALC_SHAREDIR}/startup + +# Determine of the GNU-readline facility will be used instead of the +# builtin calc binding method. +# +# USE_READLINE= Do not use GNU-readline, use calc bindings +# USE_READLINE= -DUSE_READLINE Use GNU-readline, do not use calc bindings +# +# NOTE: If you select the 'USE_READLINE= -DUSE_READLINE' mode, you must set: +# +# READLINE_LIB The flags needed to link in the readline +# and history link libraries +# READLINE_EXTRAS Flags and libs needed to use the readline +# and history link libraries +# READLINE_INCLUDE Where the readline include files reside +# (leave blank if they are /usr/include/readline) +# +# NOTE: If you select the 'USE_READLINE=' mode, then we recommend you set: +# +# READLINE_EXTRAS= +# READLINE_INCLUDE= +# READLINE_LIB= +# +# NOTE: The GNU-readline code is not shipped with calc. You must have +# the appropriate headers and link libs installed on your system in +# order to use it. +# +# To disable the use of the GNU-readline facility (as well as ncurses), set: +# +# USE_READLINE= +# READLINE_EXTRAS= +# READLINE_INCLUDE= +# READLINE_LIB= +# +# If in doubt, set USE_READLINE, READLINE_EXTRAS, READLINE_INCLUDE, and +# READLINE_LIB to nothing. +# +#USE_READLINE= +USE_READLINE= -DUSE_READLINE +# +#READLINE_LIB= +#READLINE_EXTRAS= +# +READLINE_LIB= -lreadline +READLINE_EXTRAS= -lhistory -lncurses +# +#READLINE_LIB= -L/usr/gnu/lib -lreadline +#READLINE_EXTRAS= -lhistory -lncurses +# +#READLINE_LIB= -L${PREFIX}/lib -lreadline +#READLINE_EXTRAS= -lhistory -lncurses +# +# For Apple OS X: install fink from http://fink.sourceforge.net +# and then do a 'fink install readline' and then use: +# +#READLINE_LIB= -L/sw/lib -lreadline +#READLINE_EXTRAS= -lhistory -lncurses +# +# For Apple OS X: install HomeBrew and then: +# +# brew install readline +# +# and use: +# +#READLINE_LIB= -L${PREFIX}/opt/readline/lib -lreadline +#READLINE_EXTRAS= -lhistory -lncurses +# +READLINE_INCLUDE= +#READLINE_INCLUDE= -I/usr/gnu/include +#READLINE_INCLUDE= -I${PREFIX}/include + +# Handle the case where macOS is being used with HomeBrew +# # and using the readline, history, and ncurses libraries. +# # +ifneq ($(HOMEBREW_PREFIX),) +READLINE_LIB:= -L${HOMEBREW_PREFIX}/opt/readline/lib -lreadline +READLINE_INCLUDE:= -I${HOMEBREW_PREFIX}/opt/readline/include +endif # ($(HOMEBREW_PREFIX),) + +# If $PAGER is not set, use this program to display a help file +# +# Select CALCPAGER= less.exe -ci for DJGPP. +# +#CALCPAGER= more +#CALCPAGER= pg +#CALCPAGER= cat +CALCPAGER= less +#CALCPAGER= less.exe -ci + +# Debug/Optimize options for ${CC} and ${LCC} +# +# Select DEBUG= -O2 -gstabs+ -DWINDOZ for DJGPP. +# +#DEBUG= +#DEBUG= -g +#DEBUG= -g3 +# +#DEBUG= -O +#DEBUG= -O -g +#DEBUG= -O -g3 +# +#DEBUG= -O1 +#DEBUG= -O1 -g +#DEBUG= -O1 -g3 +# +#DEBUG= -O2 +#DEBUG= -O2 -g +#DEBUG= -O2 -g3 +#DEBUG= -O2 -ipa +#DEBUG= -O2 -g3 -ipa +# +#DEBUG= -O3 +#DEBUG= -O3 -g +DEBUG= -O3 -g3 +#DEBUG= -O3 -ipa +#DEBUG= -O3 -g3 -ipa + +# Some systems require one to use ranlib to add a symbol table to +# a *.a link library. Set RANLIB to the utility that performs this +# action. Set RANLIB to : if your system does not need such a utility. +# +RANLIB=ranlib +#RANLIB=: + +# If you do not wish to use purify, set PURIFY to an empty string. +# +# If in doubt, use PURIFY= +# +#PURIFY= purify +#PURIFY= purify -m71-engine +#PURIFY= purify -logfile=pure.out +#PURIFY= purify -m71-engine -logfile=pure.out + + +PURIFY= + +# If you want to use a debugging link library such as a malloc debug link +# library, or need to add special ld flags after the calc link libraries +# are included, set ${LD_DEBUG} below. +# +# If in doubt, set LD_DEBUG to empty. +# +#LD_DEBUG= -lmalloc_cv +LD_DEBUG= + +# When doing a: +# +# make check +# make chk +# make debug +# +# the ${CALC_ENV} is used to supply the proper environment variables +# to calc. Most people will simply need 'CALCPATH=./cal' to ensure +# that these debug rules will only use calc resource files under the +# local source directory. +# +# If in doubt, use: +# +# CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.:./custom DYLD_LIBRARY_PATH=. +# +ifeq ($(ALLOW_CUSTOM),-DCUSTOM) +CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=. DYLD_LIBRARY_PATH=. CALCHELP=./help \ + CALCCUSTOMHELP=./custom +else # ($(ALLOW_CUSTOM),-DCUSTOM) +CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=. DYLD_LIBRARY_PATH=. CALCHELP=./help +endif # ($(ALLOW_CUSTOM),-DCUSTOM) + +# Some out of date operating systems require/want an executable to +# end with a certain file extension. Some compiler systems such as +# Windows build calc as calc.exe. The EXT variable is used to denote +# the extension required by such. Note that Cygwin requires EXT to be +# the same as Linux/Un*x/GNU, even though it runs under Windows. +# +# EXT= # normal Un*x / Linux / GNU/Linux / Cygwin +# EXT=.exe # Windows +# +# If in doubt, use EXT= +# +EXT= +#EXT=.exe + +# The default calc version +# +VERSION= 2.14.3.1 + +# Names of shared libraries with versions +# +LIB_EXT= .so +LIB_EXT_VERSION= ${LIB_EXT}.${VERSION} + +# standard utilities used during make +# +AR= ar +AWK= awk +CAT= cat +CHMOD= chmod +CMP= cmp +CO= co +COL= col +CP= cp +CTAGS= ctags +DATE= date +DIFF= diff +FMT= fmt +GREP= grep +HOSTNAME= hostname +LANG= C +LDCONFIG= ldconfig +LN= ln +LS= ls +MAKE= make +MAKEDEPEND= makedepend +MKDIR= mkdir +MV= mv +PWDCMD= pwd +RM= rm +RMDIR= rmdir +SED= sed +SORT= sort +SPLINT= splint +SPLINT_OPTS= +STRIP= strip +TEE= tee +TAIL= tail +TOUCH= touch +TRUE= true +UNAME= uname +XARGS= xargs + +# NOTE: On some shells, echo is a builtin that does +# not understand -n, so we call /bin/echo -n +# directly to get around such shells. +# +ECHON= /bin/echo -n + +# Extra compiling and linking flags +# +# EXTRA_CFLAGS are flags given to ${CC} when compiling C files +# EXTRA_LDFLAGS are flags given to ${CC} when linking programs +# +# Both CFLAGS and LDFLAGS are left blank in this Makefile by +# default so that users may use them on the make command line +# to always set the way that C is compiled and files are linked +# respectively. For example: +# +# make all EXTRA_CFLAGS="-DMAGIC" EXTRA_LDFLAGS="-lmagic" +# +# NOTE: These should be left blank in this Makefile to make it +# easier to add stuff on the command line. If you want to +# to change the way calc is compiled by this Makefile, change +# the appropriate host target section below or a flag above. +# +EXTRA_CFLAGS= +EXTRA_LDFLAGS= + +# Architecture compile flags +# +# The ARCH_CFLAGS are ${CC} when compiling C files. They follow +# CCMISC and precede EXTRA_CFLAGS. +# +# When ARCH_CFLAGS is empty, the native binary architecture is assumed. +# +ARCH_CFLAGS= +# ARCH_CFLAGS= -arch i386 # old Intel binary +# ARCH_CFLAGS= -arch ppc # Power PC binary +# ARCH_CFLAGS= -arch x86_64 # Intel 64-bit binary +# ARCH_CFLAGS= -arch arm64 # Apple Silicon binary +# ARCH_CFLAGS= -arch arm64 -arch x86_64 # Apple Silicon and Intel 64-bit binary +# ARCH_CFLAGS= -arch i386 -arch ppc # old Intel and Power PC binary + +# COMMON_CFLAGS are the common ${CC} flags used for all programs, both +# intermediate and final calc and calc related programs +# +ifeq ($(ALLOW_CUSTOM),-DCUSTOM) +COMMON_CFLAGS= -DCALC_SRC ${ALLOW_CUSTOM} ${CCWARN} ${CCMISC} ${ARCH_CFLAGS} ${EXTRA_CFLAGS} +else # ($(ALLOW_CUSTOM),-DCUSTOM) +COMMON_CFLAGS= -DCALC_SRC -UCUSTOM ${CCWARN} ${CCMISC} ${ARCH_CFLAGS} ${EXTRA_CFLAGS} +endif # ($(ALLOW_CUSTOM),-DCUSTOM) + +# COMMON_LDFLAGS are the common flags used for linking all programs, both +# intermediate and final calc and calc related programs +# +COMMON_LDFLAGS= ${EXTRA_LDFLAGS} diff --git a/cal/Makefile b/cal/Makefile index 10c2211..9e58d4b 100644 --- a/cal/Makefile +++ b/cal/Makefile @@ -36,177 +36,54 @@ # Makefile by Landon Curt Noll -# The shell used by this Makefile -# -# On some systems, /bin/sh is a rather reduced shell with -# deprecated behavior. -# -# If your system has a up to date, bash shell, then -# you may wish to use: -# -# 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= sh -# -SHELL= bash -#SHELL= sh -#if 0 /* start of skip for non-Gnu makefiles */ -# -ifeq ($(target),Darwin) -SHELL:= /bin/sh -endif -#endif /* end of skip for non-Gnu makefiles */ - - -#### -# Normally, the upper level makefile will set these values. We provide -# a default here just in case you want to build from this directory. -#### - -# PREFIX - Top level location for calc -# -# The PREFIX is often prepended to paths within calc and calc Makefiles. -# -# Starting with calc v2.13.0.1, nearly all Makefile places that used -# /usr/local now use ${PREFIX}. An exception is the olduninstall rule -# and, of course, this section. :-) -# -# NOTE: The ${PREFIX} is not the same as ${T}. The ${T} specifies -# a top level directory under which calc installs things. -# While usually ${T} is empty, it can be specific path -# as if calc where "chrooted" during an install. -# The ${PREFIX} value, during install, is a path between -# the top level ${T} install directory and the object -# such as an include file. -# -# NOTE: See also, ${T}, below. -# -# There are some paths that do NOT call under ${PREFIX}, such as -# ${CALCPATH}, that include paths not under ${PREFIX}, but those -# too are exceptions to this general rule. -# -# When in doubt, try: -# -# PREFIX= /usr/local -# -PREFIX= /usr/local -#PREFIX= /usr -#PREFIX= /usr/global +########################################### +# Files used or included by this Makefile # +########################################### # Normally certain files depend on the Makefile. If the Makefile is # changed, then certain steps should be redone. If MAKE_FILE is # set to Makefile, then these files will depend on Makefile. If -# MAKE_FILE is empty, then they wont. +# MAKE_FILE is empty, then they won't. # # If in doubt, set MAKE_FILE to Makefile # MAKE_FILE= Makefile -# Where the system include (.h) files are kept -# -# For DJGPP, select: -# -# INCDIR= /dev/env/DJDIR/include -# -# If in doubt, set: -# -# INCDIR= /usr/include +# Calc configuration and compile configuration values # +CONFIG_MKF= ../Makefile.config -#INCDIR= ${PREFIX}/include -#INCDIR= /dev/env/DJDIR/include -INCDIR= /usr/include +# Host targets that are shared in common with both Makefile +# and custom/Makefile. +# +TARGET_MKF= ../Makefile.target -# where to install calc related things +# Local file that is included just prior to the first rule, +# that allows one to override any values set in this Makefile. # -# ${BINDIR} where to install calc binary files -# ${LIBDIR} where calc link library (*.a) files are installed -# ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files -# -# NOTE: The install rule prepends installation paths with ${T}, which -# by default is empty. If ${T} is non-empty, then installation -# locations will be relative to the ${T} directory. -# -# For DJGPP, select: -# -# BINDIR= /dev/env/DJDIR/bin -# LIBDIR= /dev/env/DJDIR/lib -# CALC_SHAREDIR= /dev/env/DJDIR/share/calc -# -# If in doubt, set: -# -# BINDIR= /usr/bin -# LIBDIR= /usr/lib -# CALC_SHAREDIR= /usr/share/calc -# -#BINDIR= ${PREFIX}/bin -#BINDIR= /dev/env/DJDIR/bin -BINDIR= /usr/bin +LOCAL_MKF= ../Makefile.local -#LIBDIR= ${PREFIX}/lib -#LIBDIR= /dev/env/DJDIR/lib -LIBDIR= /usr/lib +# The set of Makefiles +# +MK_SET= ${MAKE_FILE} ${CONFIG_MKF} ${TARGET_MKF} ${LOCAL_MKF} -#CALC_SHAREDIR= ${PREFIX}/lib/calc -#CALC_SHAREDIR= /dev/env/DJDIR/share/calc -CALC_SHAREDIR= /usr/share/calc -# By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR -# --------------------------------------------------------------- -# ${HELPDIR} where the help directory is installed -# ${CALC_INCDIR} where the calc include files are installed -# ${SCRIPTDIR} where calc shell scripts are installed -# -# NOTE: The install rule prepends installation paths with ${T}, which -# by default is empty. If ${T} is non-empty, then installation -# locations will be relative to the ${T} directory. -# -# If in doubt, set: -# -# HELPDIR= ${CALC_SHAREDIR}/help -# CALC_INCDIR= ${INCDIR}/calc -# SCRIPTDIR= ${BINDIR}/cscript -# -HELPDIR= ${CALC_SHAREDIR}/help -CALC_INCDIR= ${INCDIR}/calc -SCRIPTDIR= ${BINDIR}/cscript +####################################################### +# Calc configuration and compile configuration values # +####################################################### +include ${CONFIG_MKF} + + +############################### +# host target section include # +############################### +include ${TARGET_MKF} + + +########################################################################## +#=-=-=-=-=- Be careful if you change something below this line -=-=-=-=-=# +########################################################################## -# T - top level directory under which calc will be installed -# -# The calc install is performed under ${T}, the calc build is -# performed under /. The purpose for ${T} is to allow someone -# to install calc somewhere other than into the system area. -# -# For example, if: -# -# BINDIR= /usr/bin -# LIBDIR= /usr/lib -# CALC_SHAREDIR= /usr/share/calc -# -# and if: -# -# T= /var/tmp/testing -# -# Then the installation locations will be: -# -# calc binary files: /var/tmp/testing/usr/bin -# calc link library: /var/tmp/testing/usr/lib -# calc help, .cal ...: /var/tmp/testing/usr/share/calc -# ... etc ... /var/tmp/testing/... -# -# If ${T} is empty, calc is installed under /, which is the same -# top of tree for which it was built. If ${T} is non-empty, then -# calc is installed under ${T}, as if one had to chroot under -# ${T} for calc to operate. -# -# If in doubt, use T= -# -T= # Makefile debug # @@ -240,22 +117,6 @@ H=@ V=@: #V=@ -# standard tools -# -CHMOD= chmod -CMP= cmp -CO= co -CP= cp -FMT= fmt -MKDIR= mkdir -MV= mv -RM= rm -RMDIR= rmdir -SED= sed -SORT= sort -TOUCH= touch -TRUE= true - # The calc files to install # # This list is produced by the detaillist rule when no WARNINGS are detected. @@ -300,8 +161,24 @@ CALCLIBLIST= # PHONY= all clobber distlist install + +############################################################ +# Allow Makefile.local to change any of the above settings # +############################################################ +include ${LOCAL_MKF} + + +########################################### +# all - First and default Makefile target # +########################################### + all: ${CALC_FILES} ${MAKE_FILE} .all + +############################### +# additional Makefile targets # +############################### + # used by the upper level Makefile to determine of we have done all # .all: diff --git a/custom/Makefile b/custom/Makefile index eabea41..f94c09c 100644 --- a/custom/Makefile +++ b/custom/Makefile @@ -4,13 +4,7 @@ # # Copyright (C) 1999-2006,2014,2017-2018,2021,2023 Landon Curt Noll # -# SRC: custom/Makefile -# -# The "# SRC: ... - ..." comment line above indicates -# the origin of this file. -# -# IMPORTANT: Please see the section on Makefiles near the -# bottom of the HOWTO.INSTALL file. +# Suggestion: Read the ../HOWTO.INSTALL file. # # 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 @@ -36,140 +30,53 @@ # Makefile by Landon Curt Noll -# The shell used by this Makefile -# -# On some systems, /bin/sh is a rather reduced shell with -# deprecated behavior. -# -# If your system has a up to date, bash shell, then -# you may wish to use: -# -# 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= sh -# -SHELL= bash -#SHELL= sh +########################################### +# Files used or included by this Makefile # +########################################### -# Darwin shell default +# Normally certain files depend on the Makefile. If the Makefile is +# changed, then certain steps should be redone. If MAKE_FILE is +# set to Makefile, then these files will depend on Makefile. If +# MAKE_FILE is empty, then they won't. # -ifeq ($(target),Darwin) -SHELL:= /bin/sh -endif # ($(target),Darwin) +# If in doubt, set MAKE_FILE to Makefile +# +MAKE_FILE= Makefile -# If you are using Cygwin with MinGW64 packages -# then we will also need to use the Cygwin runtime enviroment -# and the calc Cygwin make target. -## -ifeq ($(OSNAME),Cygwin) -target:= Cygwin -endif # ($(OSNAME),Cygwin) +# Calc configuration and compile configuration values +# +CONFIG_MKF= ../Makefile.config + +# Host targets that are shared in common with both Makefile +# and custom/Makefile. +# +TARGET_MKF= ../Makefile.target + +# Local file that is included just prior to the first rule, +# that allows one to override any values set in this Makefile. +# +LOCAL_MKF= ../Makefile.local + +# The set of Makefiles +# +MK_SET= ${MAKE_FILE} ${CONFIG_MKF} ${TARGET_MKF} ${LOCAL_MKF} -# PREFIX - Top level location for calc -# -# The PREFIX is often prepended to paths within calc and calc Makefiles. -# -# Starting with calc v2.13.0.1, nearly all Makefile places that used -# /usr/local now use ${PREFIX}. An exception is the olduninstall rule -# and, of course, this section. :-) -# -# NOTE: The ${PREFIX} is not the same as ${T}. The ${T} specifies -# a top level directory under which calc installs things. -# While usually ${T} is empty, it can be specific path -# as if calc where "chrooted" during an install. -# The ${PREFIX} value, during install, is a path between -# the top level ${T} install directory and the object -# such as an include file. -# -# NOTE: See also, ${T}, below. -# -# There are some paths that do NOT call under ${PREFIX}, such as -# ${CALCPATH}, that include paths not under ${PREFIX}, but those -# too are exceptions to this general rule. -# -# When in doubt, try: -# -# PREFIX= /usr/local -# -PREFIX= /usr/local -#PREFIX= /usr -#PREFIX= /usr/global +####################################################### +# Calc configuration and compile configuration values # +####################################################### +include ${CONFIG_MKF} -# CCBAN is given to ${CC} in order to control if banned.h is in effect. -# -# The banned.h attempts to ban the use of certain dangerous functions -# that, if improperly used, could compromise the computational integrity -# if calculations. -# -# In the case of calc, we are motivated in part by the desire for calc -# to correctly calculate: even during extremely long calculations. -# -# If UNBAN is NOT defined, then calling certain functions -# will result in a call to a non-existent function (link error). -# -# While we do NOT encourage defining UNBAN, there may be -# a system / compiler environment where re-defining a -# function may lead to a fatal compiler complication. -# If that happens, consider compiling as: -# -# make clobber all chk CCBAN=-DUNBAN -# -# as see if this is a work-a-round. -# -# If YOU discover a need for the -DUNBAN work-a-round, PLEASE tell us! -# Please send us a bug report. See the file: -# -# BUGS -# -# or the URL: -# -# http://www.isthe.com/chongo/tech/comp/calc/calc-bugrept.html -# -# for how to send us such a bug report. -# -CCBAN= -UUNBAN -#CCBAN= -DUNBAN +############################### +# host target section include # +############################### +include ${TARGET_MKF} -# We do not support parallel make of calc. We have found most -# parallel make systems do not get the rule dependency order -# correct, resulting in a failed attempt to compile calc. -# -# If you believe you have a way to get a parallel make of calc -# to work, consider submitting a pull request with a -# proposed change. -# -.NOTPARALLEL: - -############################################################################## -#-=-=-=-=-=-=-=-=- Identify the target machine, if possible -=-=-=-=-=-=-=-=-# -############################################################################## - -# NOTE: You can force a target value by defining target as in: -# -# make ...__optional_arguments_... target=value - -# Try uname -s if the target was not already set on the make command line -# -ifeq ($(target),) -target=$(shell uname -s 2>/dev/null) -endif # ($(target),) -ifeq ($(arch),) -arch=$(shell uname -p 2>/dev/null) -endif # ($(arch),) -ifeq ($(hardware),) -hardware=$(shell uname -m 2>/dev/null) -endif # ($(hardware),) -ifeq ($(OSNAME),) -OSNAME=$(shell uname -o 2>/dev/null) -endif # ($(OSNAME),) +################################## +# Files managed by this Makefile # +################################## # The custom calc resource files to install # @@ -214,16 +121,10 @@ CUSTOM_SRC= c_argv.c c_devnull.c c_help.c c_sysinfo.c c_pzasusb8.c \ CUSTOM_OBJ= c_argv.o c_devnull.o c_help.o c_sysinfo.o c_pzasusb8.o \ c_pmodm127.o c_register.o -############################################################################## -#-=-=-=-=-=-=-=-=- You may want to change some values below -=-=-=-=-=-=-=-=-# -############################################################################## -############################################################################## -#-=-=-=-=-=-=- Defaults in case you want to build from this dir -=-=-=-=-=-=-# -############################################################################## - -# Normally, the upper level makefile will set these values. We provide -# a default here just in case you want to build from this directory. +########################################################################## +#=-=-=-=-=- Be careful if you change something below this line -=-=-=-=-=# +########################################################################## # Makefile debug # @@ -257,337 +158,6 @@ H=@ V=@: #V=@ -#### -# Normally, the upper level makefile will set these values. We provide -# a default here just in case you want to build from this directory. -#### - -# Where the system include (.h) files are kept -# -# For DJGPP, select: -# -# INCDIR= /dev/env/DJDIR/include -# -# If in doubt, set: -# -# INCDIR= /usr/include -# - -#INCDIR= ${PREFIX}/include -#INCDIR= /dev/env/DJDIR/include -INCDIR= /usr/include - -# where to install calc related things -# -# ${BINDIR} where to install calc binary files -# ${LIBDIR} where calc link library (*.a) files are installed -# ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files -# -# NOTE: The install rule prepends installation paths with ${T}, which -# by default is empty. If ${T} is non-empty, then installation -# locations will be relative to the ${T} directory. -# -# For DJGPP, select: -# -# BINDIR= /dev/env/DJDIR/bin -# LIBDIR= /dev/env/DJDIR/lib -# CALC_SHAREDIR= /dev/env/DJDIR/share/calc -# -# If in doubt, set: -# -# BINDIR= /usr/bin -# LIBDIR= /usr/lib -# CALC_SHAREDIR= /usr/share/calc -# -#BINDIR= ${PREFIX}/bin -#BINDIR= /dev/env/DJDIR/bin -BINDIR= /usr/bin - -#LIBDIR= ${PREFIX}/lib -#LIBDIR= /dev/env/DJDIR/lib -LIBDIR= /usr/lib - -#CALC_SHAREDIR= ${PREFIX}/lib/calc -#CALC_SHAREDIR= /dev/env/DJDIR/share/calc -CALC_SHAREDIR= /usr/share/calc - -# By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR -# --------------------------------------------------------------- -# ${HELPDIR} where the help directory is installed -# ${CALC_INCDIR} where the calc include files are installed -# ${CUSTOMCALDIR} where custom *.cal files are installed -# ${CUSTOMHELPDIR} where custom help files are installed -# ${CUSTOMINCDIR} where custom .h files are installed -# ${SCRIPTDIR} where calc shell scripts are installed -# -# NOTE: The install rule prepends installation paths with ${T}, which -# by default is empty. If ${T} is non-empty, then installation -# locations will be relative to the ${T} directory. -# -# If in doubt, set: -# -# HELPDIR= ${CALC_SHAREDIR}/help -# CALC_INCDIR= ${INCDIR}/calc -# CUSTOMCALDIR= ${CALC_SHAREDIR}/custom -# CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp -# CUSTOMINCDIR= ${CALC_INCDIR}/custom -# SCRIPTDIR= ${BINDIR}/cscript -# -HELPDIR= ${CALC_SHAREDIR}/help -CALC_INCDIR= ${INCDIR}/calc -CUSTOMCALDIR= ${CALC_SHAREDIR}/custom -CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp -CUSTOMINCDIR= ${CALC_INCDIR}/custom -SCRIPTDIR= ${BINDIR}/cscript - -# T - top level directory under which calc will be installed -# -# The calc install is performed under ${T}, the calc build is -# performed under /. The purpose for ${T} is to allow someone -# to install calc somewhere other than into the system area. -# -# For example, if: -# -# BINDIR= /usr/bin -# LIBDIR= /usr/lib -# CALC_SHAREDIR= /usr/share/calc -# -# and if: -# -# T= /var/tmp/testing -# -# Then the installation locations will be: -# -# calc binary files: /var/tmp/testing/usr/bin -# calc link library: /var/tmp/testing/usr/lib -# calc help, .cal ...: /var/tmp/testing/usr/share/calc -# ... etc ... /var/tmp/testing/... -# -# If ${T} is empty, calc is installed under /, which is the same -# top of tree for which it was built. If ${T} is non-empty, then -# calc is installed under ${T}, as if one had to chroot under -# ${T} for calc to operate. -# -# If in doubt, use T= -# -T= - -# Debug/Optimize options for ${CC} and ${LCC} -# -# Select DEBUG= -O2 -gstabs+ -D_WIN32 for DJGPP. -# -#DEBUG= -# -#DEBUG= -O -#DEBUG= -O -g -#DEBUG= -O -g3 -# -#DEBUG= -O1 -#DEBUG= -O1 -g -#DEBUG= -O1 -g3 -# -#DEBUG= -O2 -#DEBUG= -O2 -g -#DEBUG= -O2 -g3 -#DEBUG= -O2 -ipa -#DEBUG= -O2 -g3 -ipa -# -#DEBUG= -O3 -#DEBUG= -O3 -g -DEBUG= -O3 -g3 -#DEBUG= -O3 -ipa -#DEBUG= -O3 -g3 -ipa -# -#DEBUG= -g -#DEBUG= -g3 -#DEBUG= -gx -#DEBUG= -WM,-g -# -#DEBUG= -O2 -gstabs+ -D_WIN32 - -# Some systems require one to use ranlib to add a symbol table to -# a *.a link library. Set RANLIB to the utility that performs this -# action. Set RANLIB to : if your system does not need such a utility. -# -RANLIB=ranlib -#RANLIB=: - -# Normally certain files depend on the Makefile. If the Makefile is -# changed, then certain steps should be redone. If MAKE_FILE is -# set to Makefile, then these files will depend on Makefile. If -# MAKE_FILE is empty, then they wont. -# -# If in doubt, set MAKE_FILE to Makefile -# -MAKE_FILE= Makefile -#MAKE_FILE= - -# If you do not wish to use purify, set PURIFY to an empty string. -# -# If in doubt, use PURIFY= -# -#PURIFY= purify -#PURIFY= purify -m71-engine -#PURIFY= purify -logfile=pure.out -#PURIFY= purify -m71-engine -logfile=pure.out -PURIFY= - -# If you want to use a debugging link library such as a malloc debug link -# library, or need to add special ld flags after the calc link libraries -# are included, set ${LD_DEBUG} below. -# -# If in doubt, set LD_DEBUG to empty. -# -#LD_DEBUG= -lmalloc_cv -LD_DEBUG= - -# When doing a: -# -# make check -# make chk -# make debug -# -# the ${CALC_ENV} is used to supply the proper environment variables -# to calc. Most people will simply need 'CALCPATH=./cal' to ensure -# that these debug rules will only use calc resource files under the -# local source directory. The longer lines (with MALLOC_VERBOSE=1 ...) -# are useful for SGI IRIX people who have 'WorkShop Performance Tools' -# and who also set 'LD_DEBUG= -lmalloc_cv' above. -# -# If in doubt, use CALC_ENV= CALCPATH=./cal. -# -CALC_ENV= CALCPATH=./cal -#CALC_ENV= CALCPATH=./cal MALLOC_VERBOSE=1 MALLOC_TRACING=1 \ -# MALLOC_FASTCHK=1 MALLOC_FULLWARN=1 -#CALC_ENV= CALCPATH=./cal MALLOC_VERBOSE=1 MALLOC_TRACING=1 \ -# MALLOC_FASTCHK=1 MALLOC_FULLWARN=1 MALLOC_CLEAR_FREE=1 \ -# MALLOC_CLEAR_MALLOC=1 - -# By default, custom builtin functions may only be executed if calc -# is given the -C option. This is because custom builtin functions -# may invoke non-standard or non-portable code. One may completely -# disable custom builtin functions by not compiling any of code -# -# ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given -# ALLOW_CUSTOM= -UCUSTOM # disable custom even if -C is given -# -# If in doubt, use ALLOW_CUSTOM= -DCUSTOM -# -ALLOW_CUSTOM= -DCUSTOM -#ALLOW_CUSTOM= -UCUSTOM - - -# Some out of date operating systems require / want an executable to -# end with a certain file extension. Some compile systems such as -# Cygwin build calc as calc.exe. The EXT variable is used to denote -# the extension required by such. -# -# EXT= # normal Un*x / Linux / GNU/Linux systems -# EXT=.exe # Windows / Cygwin -# -# If in doubt, use EXT= -# -EXT= -#EXT=.exe - -# The default calc versions -# -VERSION= 2.14.3.1 - -# Names of shared libraries with versions -# -LIB_EXT= .so -LIB_EXT_VERSION= ${LIB_EXT}.${VERSION} - -# standard tools -# -AR= ar -AWK= awk -CHMOD= chmod -CMP= cmp -CO= co -CP= cp -DIFF= diff -FMT= fmt -GREP= grep -LN= ln -LS= ls -MAKE= make -MAKEDEPEND= makedepend -MKDIR= mkdir -MV= mv -RM= rm -RMDIR= rmdir -SED= sed -SORT= sort -TAIL= tail -TOUCH= touch -TRUE= true - -# EXTRA_CFLAGS are flags given to ${CC} when compiling C files -# EXTRA_LDFLAGS are flags given to ${CC} when linking progs -# -# Both CFLAGS and LDFLAGS are left blank in this Makefile by -# default so that users may use them on the make command line -# to always the way that C is compiled and files are linked -# respectively. For example: -# -# make all EXTRA_CFLAGS="-DMAGIC" EXTRA_LDFLAGS="-lmagic" -# -# NOTE: These should be left blank in this Makefile to make it -# easier to add stuff on the command line. If you want to -# to change the way calc is compiled by this Makefile, change -# the appropriate host target section below or a flag above. -# -EXTRA_CFLAGS= -EXTRA_LDFLAGS= - -# COMMON_CFLAGS are the common ${CC} flags used for all progs, both -# intermediate and final calc and calc related progs -# -COMMON_CFLAGS= -DCALC_SRC ${ALLOW_CUSTOM} ${CCWARN} ${CCMISC} ${EXTRA_CFLAGS} - -# COMMON_LDFLAGS are the common flags used for linking all progs, both -# intermediate and final calc and calc related progs -# -COMMON_LDFLAGS= ${EXTRA_LDFLAGS} - -########################################### -# Set the default compile flags for ${CC} # -########################################### - -# Required flags to compile C files for calc -# -# ICFLAGS are given to ${CC} for intermediate progs used to help compile calc -# CFLAGS are given to ${CC} for calc progs other than intermediate progs -# -# NOTE: This does not work for: make-XYZ-only and BLD_TYPE != make-XYZ-only -# -ifeq ($(BLD_TYPE),calc-static-only) -ICFLAGS= ${COMMON_CFLAGS} ${CCBAN} ${CC_STATIC} -else # ($(BLD_TYPE),calc-static-only) -ICFLAGS= ${COMMON_CFLAGS} ${CCBAN} ${CC_SHARE} -endif # ($(BLD_TYPE),calc-static-only) -CFLAGS= ${ICFLAGS} ${CCOPT} - -# Required flags to link files for calc -# -# ILDFLAGS for ${CC} in linking intermediate progs used to help compile calc -# LDFLAGS for ${CC} in linking calc progs other than intermediate progs -# -ILDFLAGS= ${COMMON_LDFLAGS} -LDFLAGS= ${LD_DEBUG} ${ILDFLAGS} - -########################################################################## -#=-=-=-=-=- Be careful if you change something below this line -=-=-=-=-=# -########################################################################## - -# Host targets that are shared in common with both Makefile -# and custom/Makefile (if ALLOW_CUSTOM is -DCUSTOM). -# -TARGET_MKF= ../Makefile.target -include ${TARGET_MKF} - # These .c files are required for the main custom interface and # for the custom support functions for libcustcalc${LIB_EXT_VERSION}. # @@ -646,15 +216,25 @@ CALC_STATIC_LIBCUSTCALC= libcustcalc.a # TARGETS= ${BLD_TYPE} -### -# -# The main reason for this Makefile :-) -# -### + +############################################################ +# Allow Makefile.local to change any of the above settings # +############################################################ +include ${LOCAL_MKF} + + +########################################### +# all - First and default Makefile target # +########################################### all: ${TARGETS} ${INSTALL_H_SRC} ${CUSTOM_CALC_FILES} \ ${CUSTOM_HELP} ${MAKE_FILE} .all + +############################### +# additional Makefile targets # +############################### + calc-dynamic-only: ${CUSTCALC_OBJ} ${CALC_DYNAMIC_LIBCUSTCALC} calc-static-only: ${CUSTCALC_OBJ} ${CALC_STATIC_LIBCUSTCALC} @@ -674,12 +254,6 @@ libcustcalc${LIB_EXT_VERSION}: ${CUSTCALC_OBJ} ${MAKE_FILE} c_sysinfo.o: c_sysinfo.c ${MAKE_FILE} ${CC} ${CFLAGS} c_sysinfo.c -c -## -# -# used by the upper level Makefile -# -## - # to determine of we have done all # .all: diff --git a/help/Makefile b/help/Makefile index 88ea564..7451a0f 100644 --- a/help/Makefile +++ b/help/Makefile @@ -36,177 +36,54 @@ # Makefile by Landon Curt Noll -# The shell used by this Makefile -# -# On some systems, /bin/sh is a rather reduced shell with -# deprecated behavior. -# -# If your system has a up to date, bash shell, then -# you may wish to use: -# -# 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= sh -# -SHELL= bash -#SHELL= sh -#if 0 /* start of skip for non-Gnu makefiles */ -# -ifeq ($(target),Darwin) -SHELL:= /bin/sh -endif -#endif /* end of skip for non-Gnu makefiles */ - - -#### -# Normally, the upper level makefile will set these values. We provide -# a default here just in case you want to build from this directory. -#### - -# PREFIX - Top level location for calc -# -# The PREFIX is often prepended to paths within calc and calc Makefiles. -# -# Starting with calc v2.13.0.1, nearly all Makefile places that used -# /usr/local now use ${PREFIX}. An exception is the olduninstall rule -# and, of course, this section. :-) -# -# NOTE: The ${PREFIX} is not the same as ${T}. The ${T} specifies -# a top level directory under which calc installs things. -# While usually ${T} is empty, it can be specific path -# as if calc where "chrooted" during an install. -# The ${PREFIX} value, during install, is a path between -# the top level ${T} install directory and the object -# such as an include file. -# -# NOTE: See also, ${T}, below. -# -# There are some paths that do NOT call under ${PREFIX}, such as -# ${CALCPATH}, that include paths not under ${PREFIX}, but those -# too are exceptions to this general rule. -# -# When in doubt, try: -# -# PREFIX= /usr/local -# -PREFIX= /usr/local -#PREFIX= /usr -#PREFIX= /usr/global +########################################### +# Files used or included by this Makefile # +########################################### # Normally certain files depend on the Makefile. If the Makefile is # changed, then certain steps should be redone. If MAKE_FILE is # set to Makefile, then these files will depend on Makefile. If -# MAKE_FILE is empty, then they wont. +# MAKE_FILE is empty, then they won't. # # If in doubt, set MAKE_FILE to Makefile # MAKE_FILE= Makefile -# Where the system include (.h) files are kept -# -# For DJGPP, select: -# -# INCDIR= /dev/env/DJDIR/include -# -# If in doubt, set: -# -# INCDIR= /usr/include +# Calc configuration and compile configuration values # +CONFIG_MKF= ../Makefile.config -#INCDIR= /usr/local/include -#INCDIR= /dev/env/DJDIR/include -INCDIR= /usr/include +# Host targets that are shared in common with both Makefile +# and custom/Makefile. +# +TARGET_MKF= ../Makefile.target -# where to install calc related things +# Local file that is included just prior to the first rule, +# that allows one to override any values set in this Makefile. # -# ${BINDIR} where to install calc binary files -# ${LIBDIR} where calc link library (*.a) files are installed -# ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files -# -# NOTE: The install rule prepends installation paths with ${T}, which -# by default is empty. If ${T} is non-empty, then installation -# locations will be relative to the ${T} directory. -# -# For DJGPP, select: -# -# BINDIR= /dev/env/DJDIR/bin -# LIBDIR= /dev/env/DJDIR/lib -# CALC_SHAREDIR= /dev/env/DJDIR/share/calc -# -# If in doubt, set: -# -# BINDIR= /usr/bin -# LIBDIR= /usr/lib -# CALC_SHAREDIR= /usr/share/calc -# -#BINDIR= ${PREFIX}/bin -#BINDIR= /dev/env/DJDIR/bin -BINDIR= /usr/bin +LOCAL_MKF= ../Makefile.local -#LIBDIR= ${PREFIX}/lib -#LIBDIR= /dev/env/DJDIR/lib -LIBDIR= /usr/lib +# The set of Makefiles +# +MK_SET= ${MAKE_FILE} ${CONFIG_MKF} ${TARGET_MKF} ${LOCAL_MKF} -#CALC_SHAREDIR= ${PREFIX}/lib/calc -#CALC_SHAREDIR= /dev/env/DJDIR/share/calc -CALC_SHAREDIR= /usr/share/calc -# By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR -# --------------------------------------------------------------- -# ${HELPDIR} where the help directory is installed -# ${CALC_INCDIR} where the calc include files are installed -# ${SCRIPTDIR} where calc shell scripts are installed -# -# NOTE: The install rule prepends installation paths with ${T}, which -# by default is empty. If ${T} is non-empty, then installation -# locations will be relative to the ${T} directory. -# -# If in doubt, set: -# -# HELPDIR= ${CALC_SHAREDIR}/help -# CALC_INCDIR= ${INCDIR}/calc -# SCRIPTDIR= ${BINDIR}/cscript -# -HELPDIR= ${CALC_SHAREDIR}/help -CALC_INCDIR= ${INCDIR}/calc -SCRIPTDIR= ${BINDIR}/cscript +####################################################### +# Calc configuration and compile configuration values # +####################################################### +include ${CONFIG_MKF} + + +############################### +# host target section include # +############################### +include ${TARGET_MKF} + + +########################################################################## +#=-=-=-=-=- Be careful if you change something below this line -=-=-=-=-=# +########################################################################## -# T - top level directory under which calc will be installed -# -# The calc install is performed under ${T}, the calc build is -# performed under /. The purpose for ${T} is to allow someone -# to install calc somewhere other than into the system area. -# -# For example, if: -# -# BINDIR= /usr/bin -# LIBDIR= /usr/lib -# CALC_SHAREDIR= /usr/share/calc -# -# and if: -# -# T= /var/tmp/testing -# -# Then the installation locations will be: -# -# calc binary files: /var/tmp/testing/usr/bin -# calc link library: /var/tmp/testing/usr/lib -# calc help, .cal ...: /var/tmp/testing/usr/share/calc -# ... etc ... /var/tmp/testing/... -# -# If ${T} is empty, calc is installed under /, which is the same -# top of tree for which it was built. If ${T} is non-empty, then -# calc is installed under ${T}, as if one had to chroot under -# ${T} for calc to operate. -# -# If in doubt, use T= -# -T= # Makefile debug # @@ -240,41 +117,11 @@ H=@ V=@: #V=@ -# standard tools -# -CAT= cat -CHMOD= chmod -CMP= cmp -CP= cp -FMT= fmt -GREP= grep -ICFLAGS= -ILDFLAGS= -LCC= cc -MKDIR= mkdir -MV= mv -RM= rm -RMDIR= rmdir -SED= sed -SORT= sort -TOUCH= touch -TRUE= true -# Some out of date operating systems require / want an executable to -# end with a certain file extension. Some compile systems such as -# Cygwin build calc as calc.exe. The EXT variable is used to denote -# the extension required by such. -# -# EXT= # normal Un*x / Linux / GNU/Linux systems -# EXT=.exe # Windows / Cygwin -# -# If in doubt, use EXT= -# -EXT= -#EXT=.exe +################################## +# Files managed by this Makefile # +################################## -# Standard and Builtin help files -# STD_HELP_FILES_1= intro overview help STD_HELP_FILES_2= assoc @@ -414,9 +261,25 @@ CALCLIBLIST= # PHONY= all clobber distlist install + +############################################################ +# Allow Makefile.local to change any of the above settings # +############################################################ +include ${LOCAL_MKF} + + +########################################### +# all - First and default Makefile target # +########################################### + all: ${FULL_HELP_FILES} full ${DETAIL_HELP} ${DETAIL_CLONE} \ ${SINGULAR_FILES} .all + +############################### +# additional Makefile targets # +############################### + # used by the upper level Makefile to determine of we have done all # # NOTE: Due to bogus shells found on one common system we must have