Files
calc/Makefile.config
Landon Curt Noll d14d525a6a Release v2.15.0.1
The following are the changes in this release:

    The tarball for calc version 2.15.0.0 was missing version.h.
    The version.h is now listed as part of the calc distribution.

    Added the following new trigonometric functions:

	versin(x [,eps])	versed trigonometric sine
	coversin(x [,eps])	coversed trigonometric sine
	vercos(x [,eps])	versed trigonometric cosine
	covercos(x [,eps])	coversed trigonometric cosine
	aversin(x [,eps])	inverse versed trigonometric sine
	acoversin(x [,eps])	inverse coversed trigonometric sine
	avercos(x [,eps])	inverse versed trigonometric cosine
	acovercos(x [,eps])	inverse coversed trigonometric cosine
	haversin(x [,eps])	half versed trigonometric sine
	hacoversin(x [,eps])	half coversed trigonometric sine
	havercos(x [,eps])	half versed trigonometric cosine
	hacovercos(x [,eps])	half coversed trigonometric cosine
	ahaversin(x [,eps])	inverse half versed trigonometric sine
	ahacoversin(x [,eps])	inverse half coversed trigonometric sine
	ahavercos(x [,eps])	inverse half versed trigonometric cosine
	ahacovercos(x [,eps])	inverse half coversed trigonometric cosine
	exsec(x [,eps])		exterior trigonometric secant
	aexsec(x [,eps])	inverse exterior trigonometric secant
	excsc(x [,eps])		exterior trigonometric cosecant
	aexcsc(x [,eps])	inverse exterior trigonometric cosecant
	crd(x [,eps])		trigonometric chord of a unit circle
	acrd(x [,eps])		inverse trigonometric chord of a unit circle
	cas(x [,eps])		trigonometric cosine plus sine
	cis(x [,eps])		Euler's formula

    As Msys2 is a fork of Cygwin, if the OSNAME is Msys, the Cygwin
    target will be used.  Thanks to GitHub user @iahung2 for the
    pull request.

    Support for win32 and DJGPP has been dropped.  Calc version
    2.14.3.5 was the last to make references to win32 and make
    references to DJGPP.  Future versions of calc may work under
    those systems, we just elected to remove the somewhat out of
    date and awkward `win32.mkdef` and related win32 references.

    If you are a win32 user, please feel free to create a win32
    target in Makefile.target and submit as a pull request.
    If you are a DJGPP user, please feel free to create a DJGPP
    target in Makefile.target and submit as a pull request.
    Until someone can test such systems, we prefer to wait
    until someone is able to test and supply a pull request.

    Added PTR_LEN (length of a pointer) and PTR_BITS (bit length
    of a pointer) to longbits.h.

    Moved calc version definition from version.c to version.h.

    Sorted the order of symbols printed by "make env".

    Test if <stdbool.h> exists and set HAVE_STDBOOL_H accordingly
    in have_stdbool.h.  Added HAVE_STDBOOL_H to allow one to force
    this value.

    Added "bool.h" include file to support use of boolean symbols,
    true and false for pre-c99 C compilers.  The "bool.h" include
    file defines TRUE as true, FALSE as false, and BOOL as bool:
    for backward compatibility.

    Replaced in C source, TRUE with true, FALSE with false, and
    BOOL with bool.

    Fixed have_statfs optional executable file extension ${EXT{ in
    the ${UTIL_PROGS} make variable.

    Test if <stdint.h> exists and set HAVE_STDINT_H accordingly
    in have_stdint.h.  Added HAVE_STDINT_H to allow one to force
    this value.

    Test if <inttypes.h> exists and set HAVE_INTTYPES_H accordingly
    in have_inttypes.h.  Added HAVE_INTTYPES_H to allow one to force
    this value.

    Added c_chk.c to check the compiler and C include for calc
    requirements.  If you are unable to compile this program, or
    if this program when compiles does not exit 0, then your C
    compiler and/or C include fails to meet calc requirements.
    Compilers that are at least c99 MUST be able to compile this
    program such that when run will exit 0.

    The "make hsrc" file will attempt to compile and run c_chk and
    will warn if the C compiler and/or C include fails to meet
    calc requirements.  The "make debug" system will run c_chk -c
    to print information about the C compiler and C include.
    Currently failure to compile cc_chk.c or c_chk exiting non-0
    will just print "WARNING!!" strings to stderr.

    The make chk_c file also forms status.chk_c.h which either
    defines CHK_C when the C compiler and select include files
    appear to meet calc requirements, or undefines CHK_C
    when it does not.

    Added int.h as a central place for calc integer types and
    integer macros.

    Removed `-R release_file` and `-r release_file` command
    line options from `ver_calc`.  Add `-h` option.  Updated
    comments in "README.RELEASE", which serves as the contents
    of the calc command "help release".

    Added log2(x [,eps]) builtin function.  When x is an integer
    power of 2, log2(x) will return an integer, otherwise it will
    return the equivalent of ln(x)/ln(2).

    Removed CALC2_COMPAT in favor of ckecking if MAJOR_VER < 3.

    The sign element in a ZVALUE is now of type SIGN, which is either
    SB32 when MAJOR_VER < 3, or a bool otherwise.

    The len element in a ZVALUE is of type LEN.  LEN type is SB32 when
    MAJOR_VER < 3, or a uintptr_t otherwise.

    Setting an invalid epsilon via the epsilon(value) or confiv("epsilon",
    value) triggers an error.  The epsilon value must be: 0 < epsilon < 1.

    Added new logn(x, n [,eps]) builtin to compute logarithms to base n.

    Verify that eps arguments (error tolerance arguments that override
    the default epsilon value) to builtin functions have proper values.
    Previously the eps argument had little to no value checks for
    many builtin functions.

    Document in help files for builtin functions that take eps arguments,
    the LIMIT range for such eps values.

    Removed old Makefile testing rules for make dbx and make gdb.

    Improved "make run" to execute calccalc using shared libraries
    from the local directory, and with reading of the startup scripts
    disabled.

    Changed "make prep" to perform various tests that are used to
    help verify that calc is ready for a release.  Added the
    update_ver tool, (formerly verupdate) and the trailblank tool
    that existed outside of the calc source base but neverthless
    used in the calc release process.  Both of these tools are used
    by "make prep".

    Added Makefile testing rule "make testfuncsort" to check for
    the sort of the builtin function list.  Changed the order that
    builtin functions are listed by "show builtin" and the help/builtin
    to match the sorting of "LANG=C LC_ALL=C sort -d -u".

    Added c_to_q(COMPLEX *c, bool cfree) to make is easier to convert
    a COMPLEX value that is real (imag part is 0) into a NUMBER and
    optionally free the COMPLEX value.  The func.c code now uses c_to_q().

    Added q_to_c(NUMBER *q) to make it easier to convert a NUMBER
    into an allocated COMPLEX value.

    Added new vercos(x, [,eps]) for versed cosine and covercos(x, [,eps])
    for inverse versed cosine.

    Added new avercos(x, [,eps]) for inverse versed cosine and acovercos(x, [,eps])
    for inverse coversed cosine.

    Improved comments about use of the ${CALC_ENV} Makefile variable.
    Noted in Makefile.cal where and how the ${CALC_ENV} is used.
    Use ${CALC_ENV} Makefile variable were needed.

    Modified regression test cal/regress.cal: in some cases test numbers
    were adjusted.  Add comments indicate which test numbers apply to
    which code.  Indicated where there is room for new tests.
    Expanded the end of test numbers from 9999 to  99999.

    To make the meaning a bit more clear in cal/regress.cal, we have
    renamed the following test calc resource files that are related to
    the calc regression test suite:

	cal/test1700.cal -> cal/test8000.read.cal
	cal/test2300.cal -> cal/test2300.obj_incdec.cal
	cal/test2600.cal -> cal/test2600.numfunc.cal
	cal/test2700.cal -> cal/test2700.isqrt.cal
	cal/test3100.cal -> cal/test3100.matobj.cal
	cal/test3400.cal -> cal/test3400.trig.cal
	cal/test4000.cal -> cal/test4000.ptest.cal
	cal/test4100.cal -> cal/test4100.redc.cal
	cal/test4600.cal -> cal/test4600.fileop.cal
	cal/test5100.cal -> cal/test5100.newdecl.cal
	cal/test5200.cal -> cal/test5200.globstat.cal
	cal/test8400.cal -> cal/test8400.quit.cal
	cal/test8500.cal -> cal/test8500.divmod.cal
	cal/test8600.cal -> cal/test8600.maxargs.cal
	cal/set8700.cal -> cal/test8700.dotest.cal
	cal/test8900.cal -> cal/test8900.special.cal
	cal/test9300.cal -> cal/test9300.frem.cal

    Added to test 94dd, read of a number of new calc resource files
    that are not already read as a result of the calc regression test suite.

    Fixed more documentation and code comments that referred to the
    old additive 55 (a55) shuffle pseudo-random number generator.
    We have been using the subtractive 100 shuffle pseudo-random
    number generator in place of the additive 55 generator for a
    while now.

    Improved help files trigonometric functions.  They were corrected
    to indicate that complex arguments are allowed: an oversight
    from long ago when those trigonometric functions were expanded
    to include complex arguments.  The EXAMPLE sections were expanded
    and made consistent, where applicable, across the trigonometric
    help files.  Documented libcalc functions in the SEE ALSO sections.

    Improved "SEE ALSO" for the hyperbolic function help files.

    Expanded the calc regression test suite test 34dd to test various
    real and complex values for trigonometric functions.

    Added complex multiple approximation function to commath.c so
    that users of libcalc may directly round complex number to
    nearest multiple of a given real number:

	E_FUNC COMPLEX *cmappr(COMPLEX *c, NUMBER *e, long rnd, bool cfree);

    For example:

	COMPLEX *c;             /* complex number to round to nearest epsilon */
	NUMBER *eps;            /* epsilon rounding precision */
	COMPLEX *res;           /* c rounded to nearest epsilon */
	long rnd = 24L;         /* a common rounding mode */
	bool ok_to_free;        /* true ==> free c, false ==> do not free c */

	...

	res = cmappr(c, eps, ok_to_free);

    The complex trigonometric functions tan, cot, sec, csc were
    implemented in func.c as calls to complex sin and complex cos.
    We added the following direct calls to comfunc.c so that users
    of libcalc may call them directly:

	E_FUNC COMPLEX *c_tan(COMPLEX *c, NUMBER *eps);
	E_FUNC COMPLEX *c_cot(COMPLEX *c, NUMBER *eps);
	E_FUNC COMPLEX *c_sec(COMPLEX *c, NUMBER *eps);
	E_FUNC COMPLEX *c_cot(COMPLEX *c, NUMBER *eps);

    Added help/errorcodes rule to the top level Makefile.

    Added E_USERMAX symbol (== 32767) to indicate the maximum value
    allowed for user error codes.

    Improved help/error.  Added text about error code ranges and
    range symbols.

    Changed calc_errno a global int variable so that is may be directly
    accessed by libcalc users.

    Further improve help files for help/errno, help/error, help/newerror,
    help/stoponerror and help/strerror by adding to documentation
    of the calc error code system as well as libcalc interface
    where applicable.

    Changed #define E_USERDEF to #define E__USERDEF.

    Removed use of E_USERDEF, E__BASE, E__COUNT, and E__HIGHEST
    from custom/c_sysinfo because the c_sysinfo is just a demo
    and this will simplify the custom/Makefile.

    The include file calcerr.h is now the errsym.h include file.
    The calcerr.tbl has been replaced by errtbl.c and errtbl.h.

    The calcerr_c.awk, calcerr_c.sed, calcerr_h.awk, and
    calcerr_h.sed files are now obsolete and have been removed.
    The calcerr.c and calcerr.h now obsolete and are no longer built.

    The calc computation error codes, symbols and messages are now in
    a error_table[] array of struct errtbl.

    An E_STRING is a string corresponds to an error code #define.
    For example, the E_STRING for the calc error E_STRCAT,
    is the string "E_STRING".  An E_STRING must now match
    the regular expression: "^E_[A-Z0-9_]+$".

    The old array error_table[] of error message strings has been
    replaced by a new error_table[] array of struct errtbl.  The struct
    errtbl array holds calc errnum error codes, the related E_STRING
    symbol as a string, and the original related error message.
    To add new computation error codes, add them near the bottom of the
    error_table[] array, just before the NULL entry.

    The ./errcode utility, when run, will verify the consistency of
    the error_table[] array.

    The Makefile uses ./errcode -e to generate the contents of
    help/errorcodes file.  The help errorcodes now prints
    information from the new cstruct errtbl error_table[] array.

    The help/errorcodes.hdr and help/errorcodes.sed files are
    now obsolete and have been removed.

    The Makefile uses ./errcode -d to generate the contents of the
    errsym.h include file.

    Code that used the old array error_table[] of error message strings
    such as:

	#include "calcerr.h"

	char *msg;	/* calc computation error message */

	msg = error_table[errnum - E__BASE];

    where errnum is the calc computation error code
    E__BASE <= errnum <= E__HIGHEST, may now use:

	#include "errtbl.h"
	#include "errsym.h"

	char *msg;	/* calc computation error message */

	msg = error_table[errnum - E__BASE].errmsg;

    Rename the #define E__COUNT to ECOUNT to avoid confusion
    with "E_STRING" error symbols.

    Renamed "E_1OVER0" to "E_DIVBYZERO".
    Renamed "E_0OVER0" to "E_ZERODIVZERO".

    The verify_error_table() function that does a verification
    the error_table[] array and setup private_error_alias[] array
    is now called by libcalc_call_me_first().

    Fix comment about wrong include file in have_sys_mount.h.

    Removed unused booltostr() and strtobool() macros from bool.h.

    Moved define of math_error(char *, ...) from zmath.h to errtbl.h.
    The errtbl.h include file, unless ERRCODE_SRC is defined
    also includes attribute.h and errsym.h.

    Added E_STRING to error([errnum | "E_STRING"]) builtin function.
    Added E_STRING to errno([errnum | "E_STRING"]) builtin function.
    Added E_STRING to strerror([errnum | "E_STRING"]) builtin function.
    Calling these functions with an E_STRING errsym is the same as calling
    them with the matching errnum code.

    Standardized on calc computation error related E_STRING strings
    where there are a set of related codes.  Changed "E_...digits" into
    "E_..._digits".  For example, E_FPUTC1 became E_FPUTC_1, E_FPUTC2
    became E_FPUTC_2, and E_FPUTC3 became E_FPUTC_3.  In a few cases
    such as E_APPR became E_APPR_1, because there was a E_APPR2 (which
    became E_APPR_2) and E_APPR3 (which became E_APPR_3).  To other
    special cases, E_ILOG10 became E_IBASE10_LOG and E_ILOG2 became
    E_IBASE2_LOG because E_ILOG10 and E_ILOG2 are both independent calc
    computation error related E_STRING strings.  Now related sets of
    E_STRING strings end in _ (underscore) followed by digits.

    Added errsym builtin function.  The errsym(errnum | "E_STRING")
    builtin, , when given a valid integer errnum that corresponds to a
    calc error condition, will return an E_STRING string, AND when given
    a valid E_STRING string that is associated with a calc error
    condition, will return errnum integer that corresponds to a calc
    error condition.

    Supplying a non-integer numeric errnum code to error(), errno(),
    strerror(), or errsym() will result in an error.

    Added tests to the calc regression test suite (cal/regress.cal) to
    verify that the errnum calc computation error codes and their
    E_STRING values have not changed.

    Improved the clarity of calc regression suite (regress.cal) to mostly
    use E_STRING errsym instead of numeric errnum values for error()
    and errno() related tests.

    Fixed SEE ALSO typo in help randperm.

    Fixed calc regression test 42dd to set the display value back to 20.

    Added to test 95dd and test9500.trigeq.cal to the calc regression test
    suite to perform extensive test of trigonometric functions.

    Added to test 34dd, some if the missing inverse trigonometric tests.

    Improved builtin function strings, as printed by help builtin,
    that use an optional accuracy (epsilon) arg by adding a comma.

The following are the changes from calc version 2.14.3.4 to 2.14.3.5:

    Under macOS, to reduce dependency chains, we remove functions
    and data that are unreachable by the entry point or exported
    symbols.  In particular, the macOS linker is used with both
    "-dead_strip" and "-dead_strip_dylibs".

    The libcalc shared library is now linked with libcustcalc.

    The config("triground") controls rounding for the following
    trigonometric and hyperbolic functions:

	sin, cos, tan, cot, sec, csc
	asin, acos, atan, acot, asec, acsc
	versin, coversin, vercos, covercos
	aversin, acoversin, avercos, acovercos
	haversin, hacoversin, havercos, hacovercos
	ahaversin, hacoversin, havercos, ahacovercos
	exsec, aexsec, excsc, aexcsc
	crd, acrd
	cas, cis
	sinh, cosh, tanh, coth, sech, csch
	asinh, acosh, atanh, acoth, asech, acsch

    In addition to taking a complex root (such as via the power
    function on a complex value), "triground" is used for:

	exp, polar

    For the above mentioned functions, the rounding mode used to
    round the result to the nearest epsilon value is controlled by,
    and defaults to:

	config("triground", 24)

    As with other config options, the call returns the previous mode,
    without a 2nd argument, returns the current mode without changing it:

	config("triground")

    When printing an error, calc used to print the errnum (error number):

	; 1/0
		Error 10001

    Calc now prints the errsym (errsym):

	; 1/0
		Error E_DIVBYZERO

    Added errsym E_LN_3 for ln(0).
    Added errsym E_LOG_5 for log(0).
    Added errsym E_LOG2_4 for log2(0).
    Added errsym E_LOGN_6 for logn(0,base).

    Added a chk_tree tool to help look for problems such as files that are
    result of building calc that are also part of the calc distribution,
    and files that are part of the calc source that are missing from the
    calc distribution, and files that are of unknown status that are either
    result of building calc nor missing from the calc distribution.

    Updated file lists in Makefile, sorting as needed.

    Updated Makefile PHONY rule to include Makefile rules that are NOT files.

    Reduced make chatter for rules that build lists.

    Added make verifydist to verify the existence of files that are part of
    the calc distribution.

    Added make verifydist to make prep.

    Added a chk_tree double check, one after make clobber, one before
    the final make chk, to make prep.  Added double pass of chk_tree to
    make full_debug (and thus to the make debug output).

    Improved notes for install locations in Makefile.config.

    Added printing of ${BUILD_ALL} to make env output.
2023-10-05 04:37:59 -07:00

1385 lines
41 KiB
Makefile

#!/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.
#
# This calculator first developed by David I. Bell with help/mods from others.
#
# chongo <was here> /\oo/\ http://www.isthe.com/chongo/
# Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
# SUGGESTION: Instead of modifying this file, consider adding
# statements to modify, replace or append Makefile
# variables in the Makefile.local file.
# 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)
# MSYS2 (MSYS) is a fork of Cygwin
#
ifeq ($(OSNAME),Msys)
target:= Cygwin
endif # ($(OSNAME),Msys)
##############################################################################
#-=-=-=-=-=-=-=-=- 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 <termios.h>
# -DUSE_TERMIO use struct termios from <termio.h>
# -DUSE_SGTTY use struct sgttyb from <sys/ioctl.h>
# -DUSE_NOTHING Windows system, don't use any of them
#
# If in doubt, leave TERMCONTROL empty.
#
TERMCONTROL=
#TERMCONTROL= -DUSE_TERMIOS
#TERMCONTROL= -DUSE_TERMIO
#TERMCONTROL= -DUSE_SGTTY
# 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 <machine/endian.h> 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.
#
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.
#
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.
#
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.
#
# 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.
#
# 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.
#
# 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
#
# 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
#
# 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.
#
# 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.
#
# 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 <sys/vfs.h> 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
#
# 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 <sys/param.h> 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
#
# 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 <sys/mount.h> 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
#
# 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.
#
# 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.
#
# 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.
#
# 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.
#
# 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
#
# 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
#
# When in doubt, be safe and pick ALIGN32=-DMUST_ALIGN32.
#
ALIGN32=
#ALIGN32= -DMUST_ALIGN32
#ALIGN32= -UMUST_ALIGN32
# Determine if we have the <stdlib.h> 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
#
# When in doubt, leave HAVE_STDLIB_H empty.
#
HAVE_STDLIB_H=
#HAVE_STDLIB_H= YES
#HAVE_STDLIB_H= NO
# Determine if we have the <string.h> 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
#
# When in doubt, leave HAVE_STRING_H empty.
#
HAVE_STRING_H=
#HAVE_STRING_H= YES
#HAVE_STRING_H= NO
# Determine if we have the <times.h> 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
#
# When in doubt, leave HAVE_TIMES_H empty.
#
HAVE_TIMES_H=
#HAVE_TIMES_H= YES
#HAVE_TIMES_H= NO
# Determine if we have the <sys/times.h> 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
#
# 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 <time.h> 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
#
# When in doubt, leave HAVE_TIME_H empty.
#
HAVE_TIME_H=
#HAVE_TIME_H= YES
#HAVE_TIME_H= NO
# Determine if we have the <sys/time.h> 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
#
# 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 <unistd.h> 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
#
# When in doubt, leave HAVE_UNISTD_H empty.
#
HAVE_UNISTD_H=
#HAVE_UNISTD_H= YES
#HAVE_UNISTD_H= NO
# Determine if we have the <limits.h> 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
#
# When in doubt, leave HAVE_LIMITS_H empty.
#
HAVE_LIMITS_H=
#HAVE_LIMITS_H= YES
#HAVE_LIMITS_H= NO
# Determine if we have the <stdbool.h> include file.
#
# HAVE_STDBOOL_H= let the Makefile look for the include file
# HAVE_STDBOOL_H= YES assume that the include file exists
# HAVE_STDBOOL_H= NO assume that the include file does not exist
#
# When in doubt, leave HAVE_STDBOOL_H empty.
#
HAVE_STDBOOL_H=
#HAVE_STDBOOL_H= YES
#HAVE_STDBOOL_H= NO
# Determine if we have the <stdint.h> include file.
#
# HAVE_STDINT_H= let the Makefile look for the include file
# HAVE_STDINT_H= YES assume that the include file exists
# HAVE_STDINT_H= NO assume that the include file does not exist
#
# When in doubt, leave HAVE_STDINT_H empty.
#
HAVE_STDINT_H=
#HAVE_STDINT_H= YES
#HAVE_STDINT_H= NO
# Determine if we have the <inttypes.h> include file.
#
# HAVE_INTTYPES_H= let the Makefile look for the include file
# HAVE_INTTYPES_H= YES assume that the include file exists
# HAVE_INTTYPES_H= NO assume that the include file does not exist
#
# When in doubt, leave HAVE_INTTYPES_H empty.
#
HAVE_INTTYPES_H=
#HAVE_INTTYPES_H= YES
#HAVE_INTTYPES_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.
#
# 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
#
# 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.
#
# If in doubt, for non-macOS hosts set:
#
# BINDIR= /usr/bin
# LIBDIR= /usr/lib
# CALC_SHAREDIR= /usr/share/calc
# CALC_INCDIR= /usr/include/calc
#
# Or if you prefer everything under /usr/local:
#
# BINDIR= /usr/local/bin
# LIBDIR= /usr/local/lib
# CALC_SHAREDIR= /usr/local/share/calc
# CALC_INCDIR= /usr/local/include/calc
#
# However, if you are on macOS then set:
#
# BINDIR= ${PREFIX}/bin
# LIBDIR= ${PREFIX}/lib
# CALC_SHAREDIR= ${PREFIX}/share/calc
# CALC_INCDIR= ${PREFIX}/include/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
#
# 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
#
# 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
#
# 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.
#
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.
#
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
#
#CALCPAGER= more
#CALCPAGER= pg
#CALCPAGER= cat
CALCPAGER= less
#CALCPAGER= less.exe -ci
# Debug/Optimize options for ${CC} and ${LCC}
#
#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=
# Environment variables for local directory calc execution and local directory calc testing
#
# These environment variables are used in the following rules:
#
# make check
# make chk
# make debug
# make testfuncsort
# make prep
# make run
#
# NOTE: An equivalent environment variable setting is found in .lldbinit for lldb use.
#
# When calc is installed on the local system, it is assumed that variables such as
# ${LIBDIR} will be set to the default LD_LIBRARY_PATH for the system. Thus for
# normal execution outside of the special rules mentioned in this comment block,
# the system wide defaults for shared libraries will be used AND that one does NOT
# need to use set these environment variables for normal calc use.
#
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 calc version in the form of x.y.z.w
#
VERSION= 2.15.0.1
# The calc major version in the form of x.y.z
#
VER= 2.15.0
# Names of shared libraries with versions
#
LIB_EXT= .so
LIB_EXT_VERSION= ${LIB_EXT}.${VERSION}
LIB_EXT_VER= ${LIB_EXT}.${VER}
# 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
SDIFF= sdiff
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}