mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Release calc version 2.12.2
This commit is contained in:
@@ -55,10 +55,10 @@ pzasusb8.cal
|
||||
## 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.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 29.2 $
|
||||
## @(#) $Id: CUSTOM_CAL,v 29.2 2000/06/07 14:03:03 chongo Exp $
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: CUSTOM_CAL,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/CUSTOM_CAL,v $
|
||||
##
|
||||
## Under source code control: 1997/03/08 20:51:32
|
||||
|
@@ -130,13 +130,7 @@ Step 4: Write your test code
|
||||
change the comment from 'halflen - determine the length ...' to
|
||||
'curds - brief description about ...'
|
||||
|
||||
change the print statement near the very bottom from:
|
||||
|
||||
print "halflen(num) defined";
|
||||
|
||||
to:
|
||||
|
||||
print "curds( ... args description here ...) defined";
|
||||
change other code as needed.
|
||||
|
||||
|
||||
Step 5: Write your custom function
|
||||
@@ -494,24 +488,25 @@ Step 6: Register the function in the custom interface table
|
||||
E_FUNC VALUE u_curds(char*, int, VALUE**);
|
||||
|
||||
|
||||
Step 7: Add the required information to the custom/Makefile
|
||||
Step 7: Add the required information to the custom/Makefile.head
|
||||
|
||||
The calc test script, curds.cal, should be added to the
|
||||
CUSTOM_CALC_FILES Makefile variable found in custom/Makefile:
|
||||
CUSTOM_CALC_FILES Makefile variable found in custom/Makefile.head:
|
||||
|
||||
CUSTOM_CALC_FILES= argv.cal halflen.cal curds.cal
|
||||
|
||||
The help file, curds, should be added to the CUSTOM_HELP
|
||||
Makefile variable:
|
||||
custom/Makefile.head variable:
|
||||
|
||||
CUSTOM_HELP= argv devnull help sysinfo curds
|
||||
|
||||
If you needed to create any .h files to support u_curds.c, these
|
||||
files should be added to the CUSTOM_H_SRC Makefile variable:
|
||||
files should be added to the CUSTOM_H_SRC custom/Makefile.head variable:
|
||||
|
||||
CUSTOM_H_SRC= u_curds.h otherfile.h
|
||||
|
||||
Your u_curds.c file MUST be added to the CUSTOM_SRC Makefile variable:
|
||||
Your u_curds.c file MUST be added to the CUSTOM_SRC custom/Makefile.head
|
||||
variable:
|
||||
|
||||
CUSTOM_SRC= c_argv.c c_devnull.c c_help.c c_sysinfo.c u_curds.c
|
||||
|
||||
@@ -645,10 +640,10 @@ Step 12: Contribute
|
||||
## 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.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 29.6 $
|
||||
## @(#) $Id: HOW_TO_ADD,v 29.6 2007/02/11 10:22:46 chongo Exp $
|
||||
## @(#) $Revision: 30.3 $
|
||||
## @(#) $Id: HOW_TO_ADD,v 30.3 2007/07/13 23:45:54 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/HOW_TO_ADD,v $
|
||||
##
|
||||
## Under source code control: 1997/03/10 03:03:21
|
||||
|
863
custom/Makefile
863
custom/Makefile
File diff suppressed because it is too large
Load Diff
456
custom/Makefile.head
Normal file
456
custom/Makefile.head
Normal file
@@ -0,0 +1,456 @@
|
||||
#!/bin/make
|
||||
#
|
||||
# custom - makefile for calc custom routines
|
||||
#
|
||||
# Copyright (C) 1999-2006 Landon Curt Noll
|
||||
#
|
||||
# Calc is open software; you can redistribute it and/or modify it under
|
||||
# the terms of the version 2.1 of the GNU Lesser General Public License
|
||||
# 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.
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# @(#) $Revision: 30.12 $
|
||||
# @(#) $Id: Makefile.head,v 30.12 2007/09/01 19:54:03 chongo Exp $
|
||||
# @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/Makefile.head,v $
|
||||
#
|
||||
# Under source code control: 1997/03/09 02:28:54
|
||||
# File existed as early as: 1997
|
||||
#
|
||||
# chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
||||
# Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
||||
#
|
||||
# calculator by David I. Bell with help/mods from others
|
||||
# Makefile by Landon Curt Noll
|
||||
|
||||
#if 0 /* start of skip for non-Gnu makefiles */
|
||||
##############################################################################
|
||||
#-=-=-=-=-=-=-=-=- 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 alreadhy set on the make command line
|
||||
#
|
||||
ifeq ($(target),)
|
||||
target=$(shell uname -s 2>/dev/null)
|
||||
endif
|
||||
#endif /* end of skip for non-Gnu makefiles */
|
||||
|
||||
##############################################################################
|
||||
#-=-=-=-=-=-=-=-=- You may want to change some values below -=-=-=-=-=-=-=-=-#
|
||||
##############################################################################
|
||||
|
||||
# The custom calc resource files to install
|
||||
#
|
||||
# Put your custom calc resource files here.
|
||||
#
|
||||
CUSTOM_CALC_FILES= argv.cal halflen.cal pzasusb8.cal pmodm127.cal register.cal
|
||||
|
||||
# The custom help files to install
|
||||
#
|
||||
# Put your custom help files here.
|
||||
#
|
||||
CUSTOM_HELP= argv devnull help sysinfo pzasusb8 pmodm127 register
|
||||
|
||||
# Any .h files that are needed by programs that use libcustcalc${LIB_EXT_VERS}
|
||||
#
|
||||
# Put any .h files that you add which might be useful to other
|
||||
# programs here.
|
||||
#
|
||||
CUSTOM_H_SRC=
|
||||
|
||||
# Any .c files that are needed to build libcustcalc${LIB_EXT_VERS}.
|
||||
# Don't put ${REQUIRED_SRC} files in this list.
|
||||
#
|
||||
# There MUST be a .c in CUSTOM_SRC for every .o in CUSTOM_OBJ.
|
||||
#
|
||||
# Put your custom .c files here.
|
||||
#
|
||||
CUSTOM_SRC= c_argv.c c_devnull.c c_help.c c_sysinfo.c c_pzasusb8.c \
|
||||
c_pmodm127.c c_register.c
|
||||
|
||||
# Any .o files that are needed by program that use libcustcalc${LIB_EXT_VERS}.
|
||||
# Don't put ${REQUIRED_OBJ} files in this list.
|
||||
#
|
||||
# There MUST be a .c in CUSTOM_SRC for every .o in CUSTOM_OBJ.
|
||||
#
|
||||
# Put your custom .o files here.
|
||||
#
|
||||
CUSTOM_OBJ= c_argv.o c_devnull.o c_help.o c_sysinfo.o c_pzasusb8.o \
|
||||
c_pmodm127.o c_register.o
|
||||
|
||||
##############################################################################
|
||||
#-=-=-=-=-=-=- 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.
|
||||
#
|
||||
# Makefile debug
|
||||
#
|
||||
# Q=@ do not echo internal makefile actions (quiet mode)
|
||||
# Q= echo internal makefile actions (debug / verbose mode)
|
||||
#
|
||||
#Q=
|
||||
Q=@
|
||||
|
||||
####
|
||||
# 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= /usr/local/include
|
||||
#INCDIR= /dev/env/DJDIR/include
|
||||
INCDIR= /usr/include
|
||||
|
||||
# where to install calc realted 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= /usr/local/bin
|
||||
#BINDIR= /dev/env/DJDIR/bin
|
||||
BINDIR= /usr/bin
|
||||
|
||||
#LIBDIR= /usr/local/lib
|
||||
#LIBDIR= /dev/env/DJDIR/lib
|
||||
LIBDIR= /usr/lib
|
||||
|
||||
#CALC_SHAREDIR= /usr/local/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+ -DWINDOZ 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+ -DWINDOZ
|
||||
|
||||
# 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=
|
||||
|
||||
# Controlling file makefile basename (without the path)
|
||||
#
|
||||
# This is the basename same of the makefile that may/does/will drive
|
||||
# this makefile.
|
||||
#
|
||||
# If in doubt, set TOP_MAKE_FILE to Makefile
|
||||
#
|
||||
TOP_MAKE_FILE= Makefile
|
||||
|
||||
# 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= # disable custom even if -C is given
|
||||
#
|
||||
# If in doubt, use ALLOW_CUSTOM= -DCUSTOM
|
||||
#
|
||||
ALLOW_CUSTOM= -DCUSTOM
|
||||
#ALLOW_CUSTOM=
|
||||
|
||||
# The install rule uses:
|
||||
#
|
||||
# ${MKDIR} ${MKDIR_ARG}
|
||||
#
|
||||
# to create directorties. Normall this amounts to usins mkdir -p dir ...
|
||||
# Some older systems may not have mkdir -p. If you system does not
|
||||
# make mkdir -p, then set MKDIR_ARG to empty.
|
||||
#
|
||||
# MKDIR_ARG= -p # use mkdir -p when creating paths
|
||||
# MKDIR_ARG= # use if system does not understand mkdir -p
|
||||
#
|
||||
MKDIR_ARG= -p
|
||||
#MKDIR_ARG=
|
||||
|
||||
# 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 # windoz / Cygwin
|
||||
#
|
||||
# If in doubt, use EXT=
|
||||
#
|
||||
EXT=
|
||||
#EXT=.exe
|
||||
|
||||
# The default calc versions
|
||||
#
|
||||
VERSION= 2.12.2
|
||||
VERS= 2.12.2
|
||||
VER= 2.12
|
||||
VE= 2
|
||||
|
||||
# Names of shared libraries with versions
|
||||
#
|
||||
LIB_EXT= .so
|
||||
LIB_EXT_VERS= ${LIB_EXT}.${VERS}
|
||||
LIB_EXT_VER= ${LIB_EXT}.${VER}
|
||||
LIB_EXT_VE= ${LIB_EXT}.${VE}
|
||||
|
||||
# standard tools
|
||||
#
|
||||
SHELL= /bin/sh
|
||||
SED= sed
|
||||
MAKEDEPEND= makedepend
|
||||
GREP= egrep
|
||||
CHMOD= chmod
|
||||
FMT= fmt
|
||||
SORT= sort
|
||||
CMP= cmp
|
||||
AR= ar
|
||||
RM= rm
|
||||
TOUCH= touch
|
||||
MKDIR= mkdir
|
||||
RMDIR= rmdir
|
||||
MV= mv
|
||||
CP= cp
|
||||
CO= co
|
||||
TRUE= true
|
||||
MAKE= make
|
||||
LN= ln
|
||||
AWK= awk
|
||||
|
||||
# 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 appropirate 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} #
|
||||
###########################################
|
||||
|
||||
#if 0 /* start of skip for non-Gnu makefiles */
|
||||
|
||||
# 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} ${CC_STATIC}
|
||||
else
|
||||
ICFLAGS= ${COMMON_CFLAGS} ${CC_SHARE}
|
||||
endif
|
||||
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}
|
||||
|
||||
#endif /* end of skip for non-Gnu makefiles */
|
1220
custom/Makefile.simple
Normal file
1220
custom/Makefile.simple
Normal file
File diff suppressed because it is too large
Load Diff
723
custom/Makefile.tail
Normal file
723
custom/Makefile.tail
Normal file
@@ -0,0 +1,723 @@
|
||||
##############################################################################
|
||||
#-=-=-=-=-=-=-=-=- Be careful if you change something below -=-=-=-=-=-=-=-=-#
|
||||
##############################################################################
|
||||
|
||||
# These .c files are required for the main custom interface and
|
||||
# for the custom support functions for libcustcalc${LIB_EXT_VERS}.
|
||||
#
|
||||
# There MUST be a .c for every .o in REQUIRED_OBJ.
|
||||
#
|
||||
REQUIRED_SRC= custtbl.c
|
||||
|
||||
# These .o files correspond to the .c files in REQUIRED_SRC
|
||||
# for libcustcalc${LIB_EXT_VERS}.
|
||||
#
|
||||
# There MUST be a .o for every .c in REQUIRED_SRC.
|
||||
#
|
||||
REQUIRED_OBJ= custtbl.o
|
||||
|
||||
# These .h files are installed under ${CUSTOMCALDIR} by the install rule.
|
||||
#
|
||||
INSTALL_H_SRC= ${CUSTOM_H_SRC}
|
||||
|
||||
# These .c files are used to form libcustcalc${LIB_EXT_VERS}.
|
||||
#
|
||||
CUSTCALC_SRC= ${REQUIRED_SRC} ${CUSTOM_SRC}
|
||||
|
||||
# These .o files are used to form libcustcalc${LIB_EXT_VERS}.
|
||||
#
|
||||
CUSTCALC_OBJ= ${REQUIRED_OBJ} ${CUSTOM_OBJ}
|
||||
|
||||
# These .c files are used to build the dependency list
|
||||
#
|
||||
C_SRC= ${REQUIRED_SRC} ${CUSTOM_SRC}
|
||||
|
||||
# These .h files are used to build the dependecy list
|
||||
#
|
||||
H_SRC= ${CUSTOM_H_SRC}
|
||||
|
||||
# These files are found (but not built) in the distribution
|
||||
#
|
||||
# The CUSTOM_CAL and HOW_TO_ADD are files distributed from this
|
||||
# directory but are installed as help files from the help/Makefile.
|
||||
#
|
||||
DISTLIST= ${CUSTCALC_SRC} ${CUSTOM_CALC_FILES} ${CUSTOM_HELP} \
|
||||
${INSTALL_H_SRC} CUSTOM_CAL HOW_TO_ADD ${MAKE_FILE}.head \
|
||||
${MAKE_FILE}.tail
|
||||
|
||||
# These files are used to make (but not built) a calc .a link library
|
||||
#
|
||||
CALCLIBLIST= ${CUSTCALC_SRC} ${INSTALL_H_SRC} ${MAKE_FILE} HOW_TO_ADD
|
||||
|
||||
# This is the custom dynbamic shared library that is build
|
||||
#
|
||||
CALC_DYNAMIC_LIBCUSTCALC= libcustcalc${LIB_EXT_VERS}
|
||||
|
||||
# This is the custom static library that is build
|
||||
#
|
||||
CALC_STATIC_LIBCUSTCALC= libcustcalc.a
|
||||
|
||||
# complete list of targets
|
||||
#
|
||||
TARGETS= ${BLD_TYPE} Makefile.simple
|
||||
|
||||
###
|
||||
#
|
||||
# The reason for this Makefile :-)
|
||||
#
|
||||
###
|
||||
|
||||
all: ${TARGETS} ${INSTALL_H_SRC} ${CUSTOM_CALC_FILES} \
|
||||
${CUSTOM_HELP} ${MAKE_FILE} .all
|
||||
|
||||
calc-dynamic-only: ${CUSTCALC_OBJ} ${CALC_DYNAMIC_LIBCUSTCALC}
|
||||
|
||||
calc-static-only: ${CUSTCALC_OBJ} ${CALC_STATIC_LIBCUSTCALC}
|
||||
|
||||
custom/libcustcalc${LIB_EXT_VERS}: libcustcalc${LIB_EXT_VERS} \
|
||||
${CALC_STATIC_LIBCUSTCALC}
|
||||
|
||||
libcustcalc${LIB_EXT_VERS}: ${CUSTCALC_OBJ} ${MAKE_FILE}
|
||||
${CC} ${LIBCUSTCALC_SHLIB} ${CUSTCALC_OBJ} -o $@
|
||||
|
||||
##
|
||||
#
|
||||
# Special .o files
|
||||
#
|
||||
##
|
||||
|
||||
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:
|
||||
${RM} -f .all
|
||||
${TOUCH} .all
|
||||
|
||||
###
|
||||
#
|
||||
# building calc-static and static lib*.a libraires
|
||||
#
|
||||
###
|
||||
|
||||
libcustcalc.a: ${CUSTCALC_OBJ} ${MAKE_FILE}
|
||||
${RM} -f libcustcalc.a
|
||||
${AR} qc libcustcalc.a ${CUSTCALC_OBJ}
|
||||
${RANLIB} libcustcalc.a
|
||||
${CHMOD} 0644 libcustcalc.a
|
||||
|
||||
##
|
||||
#
|
||||
# File list generation. You can ignore this section.
|
||||
#
|
||||
#
|
||||
# We will form the names of source files as if they were in a
|
||||
# sub-directory called calc/lib.
|
||||
#
|
||||
# NOTE: Due to bogus shells found on one common system we must have
|
||||
# an non-emoty else clause for every if condition. *sigh*
|
||||
#
|
||||
##
|
||||
|
||||
distlist: ${DISTLIST}
|
||||
${Q} for i in ${DISTLIST} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
echo custom/$$i; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
distdir:
|
||||
${Q} echo custom
|
||||
|
||||
calcliblist: ${CALCLIBLIST}
|
||||
${Q} for i in ${CALCLIBLIST} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
echo custom/$$i; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
#if 0 /* start of skip for non-Gnu makefiles */
|
||||
Makefile.simple: ${MAKE_FILE}
|
||||
${V} echo '=-=-=-=-= custom/${MAKE_FILE} start of $@ rule =-=-=-=-='
|
||||
${Q} ${RM} -f $@
|
||||
${Q} ${AWK} '/^#if 0/{skp=1} {if(!skp){print $$0}} /^#endif/{skp=0}' \
|
||||
${MAKE_FILE} > $@
|
||||
${Q} echo >> $@
|
||||
${Q} echo 'Makefile.simple:' >> $@
|
||||
${Q} echo ' $${Q} if [ ! -f Makefile.simple ]; then '"\\" >> $@
|
||||
${Q} echo ' $${CP} -f $${MAKE_FILE} $$@; fi' >> $@
|
||||
${V} echo '=-=-=-=-= custom/${MAKE_FILE} end of $@ rule =-=-=-=-='
|
||||
#endif /* end of skip for non-Gnu makefiles */
|
||||
|
||||
##
|
||||
#
|
||||
# Home grown make dependency rules. Your system make not support
|
||||
# or have the needed tools. You can ignore this section.
|
||||
#
|
||||
# We will form a skelaton tree of *.c files containing only #include "foo.h"
|
||||
# lines and .h files containing the same lines surrounded by multiple include
|
||||
# prevention lines. This allows us to build a static depend list that will
|
||||
# satisfy all possible cpp symbol definition combinations.
|
||||
#
|
||||
##
|
||||
|
||||
depend:
|
||||
${Q} if [ -f ${MAKE_FILE}.bak ]; then \
|
||||
echo "${MAKE_FILE}.bak exists, remove or move it"; \
|
||||
exit 1; \
|
||||
else \
|
||||
${TRUE}; \
|
||||
fi
|
||||
${Q} echo forming custom/skel
|
||||
${Q} ${RM} -rf skel
|
||||
${Q} ${MKDIR} skel
|
||||
${Q} ${MKDIR} skel/custom
|
||||
-${Q} for i in ${C_SRC} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
${SED} -n '/^#[ ]*include[ ]*"/p' \
|
||||
"$$i" > "skel/custom/$$i"; \
|
||||
fi; \
|
||||
done
|
||||
-${Q} for i in ${H_SRC} /dev/null; do \
|
||||
if [ "$$i" = "/dev/null" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
tag="`echo $$i | ${SED} 's/[\.+,:]/_/g'`"; \
|
||||
echo "#if !defined($$tag)" > "skel/custom/$$i"; \
|
||||
echo "#define $$tag" >> "skel/custom/$$i"; \
|
||||
${SED} -n '/^#[ ]*include[ ]*"/p' "$$i" \
|
||||
>> "skel/custom/$$i"; \
|
||||
echo '#endif /* '"$$tag"' */' >> "skel/custom/$$i"; \
|
||||
done
|
||||
${Q} (cd ..; ${MAKE} -f ${TOP_MAKE_FILE} hsrc)
|
||||
${Q} for i in `cd ..; ${MAKE} -f ${TOP_MAKE_FILE} h_list 2>&1 | \
|
||||
${SED} -e '/Entering directory/d' \
|
||||
-e '/Nothing to be done/d' \
|
||||
-e '/Leaving directory/d'` /dev/null; do \
|
||||
if [ "$$i" = "/dev/null" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
tag="`echo $$i | ${SED} 's/[\.+,:]/_/g'`"; \
|
||||
echo "#if !defined($$tag)" > "skel/$$i"; \
|
||||
echo "#define $$tag" >> "skel/$$i"; \
|
||||
${SED} -n '/^#[ ]*include[ ]*"/p' "../$$i" \
|
||||
>> "skel/$$i"; \
|
||||
echo '#endif /* '"$$tag"' */' >> "skel/$$i"; \
|
||||
done
|
||||
${Q} ${RM} -f skel/custom/makedep.out
|
||||
${Q} echo custom/skel formed
|
||||
${Q} echo forming custom dependency list
|
||||
${Q} :> skel/custom/makedep.out
|
||||
${Q} cd skel/custom; ${MAKEDEPEND} -I.. -w 1 -f makedep.out ${C_SRC}
|
||||
-${Q} for i in ${C_SRC} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
echo "$$i" | ${SED} 's/^\(.*\)\.c/\1.o: \1.c/'; \
|
||||
fi; \
|
||||
done >> skel/custom/makedep.out
|
||||
${Q} LANG=C ${SORT} -u skel/custom/makedep.out \
|
||||
-o skel/custom/makedep.out
|
||||
${Q} echo custom dependency list formed
|
||||
${Q} echo forming new custom/${MAKE_FILE}
|
||||
${Q} ${RM} -f ${MAKE_FILE}.bak
|
||||
${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
|
||||
${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' ${MAKE_FILE}.bak > ${MAKE_FILE}
|
||||
${Q} ${GREP} -v '^#' skel/custom/makedep.out >> ${MAKE_FILE}
|
||||
${Q} ${RM} -rf skel
|
||||
-${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \
|
||||
echo 'custom ${MAKE_FILE} was already up to date'; \
|
||||
${MV} -f ${MAKE_FILE}.bak ${MAKE_FILE}; \
|
||||
else \
|
||||
${RM} -f ${MAKE_FILE}.tmp; \
|
||||
${MV} ${MAKE_FILE} ${MAKE_FILE}.tmp; \
|
||||
if [ -d RCS -a ! -w "${MAKE_FILE}" ]; then \
|
||||
${CO} -l ${MAKE_FILE}; \
|
||||
fi ;\
|
||||
${MV} ${MAKE_FILE}.tmp ${MAKE_FILE}; \
|
||||
if [ -d RCS ]; then \
|
||||
echo '****************************************************'; \
|
||||
echo 'new custom ${MAKE_FILE} formed -- you to check it in'; \
|
||||
echo '****************************************************'; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
##
|
||||
#
|
||||
# rpm rules
|
||||
#
|
||||
##
|
||||
|
||||
echo_inst_files:
|
||||
${Q} for i in ${INSTALL_H_SRC} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
echo __file__ ${CUSTOMINCDIR}/$$i; \
|
||||
fi; \
|
||||
done
|
||||
${Q} for i in ${CUSTOM_HELP} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
echo __file__ ${CUSTOMHELPDIR}/$$i; \
|
||||
fi; \
|
||||
done
|
||||
${Q} for i in ${CUSTOM_CALC_FILES} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
echo __file__ ${CUSTOMCALDIR}/$$i; \
|
||||
fi; \
|
||||
done
|
||||
${Q} for i in ${CALC_DYNAMIC_LIBCUSTCALC} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
echo __file__ ${CUSTOMCALDIR}/$$i; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
##
|
||||
#
|
||||
# Utility rules
|
||||
#
|
||||
##
|
||||
|
||||
clean:
|
||||
${RM} -f ${CUSTCALC_OBJ}
|
||||
|
||||
clobber: clean
|
||||
${RM} -f ${BLD_TYPE}
|
||||
${RM} -f .all ${MAKE_FILE}.tmp ${MAKE_FILE}.bak
|
||||
${RM} -f libcustcalc${LIB_EXT_VERS}
|
||||
${RM} -f libcustcalc${LIB_EXT_VER}
|
||||
${RM} -f libcustcalc${LIB_EXT_VE}
|
||||
${RM} -f libcustcalc${LIB_EXT}
|
||||
${RM} -f libcustcalc.a
|
||||
#if 0 /* start of skip for non-Gnu makefiles */
|
||||
${RM} -f Makefile.simple
|
||||
#endif /* end of skip for non-Gnu makefiles */
|
||||
|
||||
# install everything
|
||||
#
|
||||
# NOTE: Keep the uninstall rule in reverse order to the install rule
|
||||
#
|
||||
install: all
|
||||
-${Q} if [ ! -d ${T}${INCDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${INCDIR}; \
|
||||
${MKDIR} ${T}${INCDIR}; \
|
||||
if [ ! -d "${T}${INCDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${INCDIR}"; \
|
||||
${MKDIR} -p "${T}${INCDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 ${T}${INCDIR}; \
|
||||
${CHMOD} 0755 ${T}${INCDIR}; \
|
||||
else \
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CALC_SHAREDIR}; \
|
||||
${MKDIR} ${T}${CALC_SHAREDIR}; \
|
||||
if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
|
||||
${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 ${T}${CALC_SHAREDIR}; \
|
||||
${CHMOD} 0755 ${T}${CALC_SHAREDIR}; \
|
||||
else \
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CALC_INCDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CALC_INCDIR}; \
|
||||
${MKDIR} ${T}${CALC_INCDIR}; \
|
||||
if [ ! -d "${T}${CALC_INCDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CALC_INCDIR}"; \
|
||||
${MKDIR} -p "${T}${CALC_INCDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 ${T}${CALC_INCDIR}; \
|
||||
${CHMOD} 0755 ${T}${CALC_INCDIR}; \
|
||||
else \
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${HELPDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${HELPDIR}; \
|
||||
${MKDIR} ${T}${HELPDIR}; \
|
||||
if [ ! -d "${T}${HELPDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${HELPDIR}"; \
|
||||
${MKDIR} -p "${T}${HELPDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 ${T}${HELPDIR}; \
|
||||
${CHMOD} 0755 ${T}${HELPDIR}; \
|
||||
else \
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CUSTOMCALDIR}; \
|
||||
${MKDIR} ${T}${CUSTOMCALDIR}; \
|
||||
if [ ! -d "${T}${CUSTOMCALDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \
|
||||
${MKDIR} -p "${T}${CUSTOMCALDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 ${T}${CUSTOMCALDIR}; \
|
||||
${CHMOD} 0755 ${T}${CUSTOMCALDIR}; \
|
||||
else \
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CUSTOMHELPDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CUSTOMHELPDIR}; \
|
||||
${MKDIR} ${T}${CUSTOMHELPDIR}; \
|
||||
if [ ! -d "${T}${CUSTOMHELPDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \
|
||||
${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 ${T}${CUSTOMHELPDIR}; \
|
||||
${CHMOD} 0755 ${T}${CUSTOMHELPDIR}; \
|
||||
else \
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CUSTOMINCDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CUSTOMINCDIR}; \
|
||||
${MKDIR} ${T}${CUSTOMINCDIR}; \
|
||||
if [ ! -d "${T}${CUSTOMINCDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \
|
||||
${MKDIR} -p "${T}${CUSTOMINCDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 ${T}${CUSTOMINCDIR}; \
|
||||
${CHMOD} 0755 ${T}${CUSTOMINCDIR}; \
|
||||
else \
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} for i in ${INSTALL_H_SRC} /dev/null; do \
|
||||
if [ "$$i" = "/dev/null" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
if ${CMP} -s "$$i" ${T}${CUSTOMINCDIR}/$$i; then \
|
||||
${TRUE}; \
|
||||
else \
|
||||
${RM} -f ${T}${CUSTOMINCDIR}/$$i.new; \
|
||||
${CP} -f $$i ${T}${CUSTOMINCDIR}/$$i.new; \
|
||||
${CHMOD} 0444 ${T}${CUSTOMINCDIR}/$$i.new; \
|
||||
${MV} -f ${T}${CUSTOMINCDIR}/$$i.new ${T}${CUSTOMINCDIR}/$$i; \
|
||||
echo "installed ${T}${CUSTOMINCDIR}/$$i"; \
|
||||
fi; \
|
||||
done
|
||||
-${Q} for i in ${CUSTOM_CALC_FILES} /dev/null; do \
|
||||
if [ "$$i" = "/dev/null" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
if ${CMP} -s $$i ${T}${CUSTOMCALDIR}/$$i; then \
|
||||
${TRUE}; \
|
||||
else \
|
||||
${RM} -f ${T}${CUSTOMCALDIR}/$$i.new; \
|
||||
${CP} -f $$i ${T}${CUSTOMCALDIR}/$$i.new; \
|
||||
${CHMOD} 0444 ${T}${CUSTOMCALDIR}/$$i.new; \
|
||||
${MV} -f ${T}${CUSTOMCALDIR}/$$i.new ${T}${CUSTOMCALDIR}/$$i; \
|
||||
echo "installed ${T}${CUSTOMCALDIR}/$$i"; \
|
||||
fi; \
|
||||
done
|
||||
-${Q} for i in ${CUSTOM_HELP} /dev/null; do \
|
||||
if [ "$$i" = "/dev/null" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
if ${CMP} -s $$i ${T}${CUSTOMHELPDIR}/$$i; then \
|
||||
${TRUE}; \
|
||||
else \
|
||||
${RM} -f ${T}${CUSTOMHELPDIR}/$$i.new; \
|
||||
${CP} -f $$i ${T}${CUSTOMHELPDIR}/$$i.new; \
|
||||
${CHMOD} 0444 ${T}${CUSTOMHELPDIR}/$$i.new; \
|
||||
${MV} -f ${T}${CUSTOMHELPDIR}/$$i.new ${T}${CUSTOMHELPDIR}/$$i; \
|
||||
echo "installed ${T}${CUSTOMHELPDIR}/$$i"; \
|
||||
fi; \
|
||||
done
|
||||
-${Q} if [ -f "${T}${CUSTOMCALDIR}/libcustcalc.a" ]; then \
|
||||
${RM} -f ${T}${CUSTOMCALDIR}/libcustcalc.a; \
|
||||
echo "removed old ${T}${CUSTOMCALDIR}/libcustcalc.a"; \
|
||||
fi
|
||||
-${Q} if [ ! -z ${ALLOW_CUSTOM} ]; then \
|
||||
if [ -f libcustcalc.a ]; then \
|
||||
if ${CMP} -s libcustcalc.a ${T}${LIBDIR}/libcustcalc.a; then \
|
||||
${TRUE}; \
|
||||
else \
|
||||
${RM} -f ${T}${LIBDIR}/libcustcalc.a.new; \
|
||||
${CP} -f libcustcalc.a ${T}${LIBDIR}/libcustcalc.a.new; \
|
||||
${CHMOD} 0644 ${T}${LIBDIR}/libcustcalc.a.new; \
|
||||
${MV} -f ${T}${LIBDIR}/libcustcalc.a.new \
|
||||
${T}${LIBDIR}/libcustcalc.a; \
|
||||
${RANLIB} ${T}${LIBDIR}/libcustcalc.a; \
|
||||
echo "installed ${T}${LIBDIR}/libcustcalc.a"; \
|
||||
fi; \
|
||||
fi; \
|
||||
fi
|
||||
${Q}# NOTE: The upper level makefile installs libcustcalc${LIB_EXT_VERS}
|
||||
${Q}# because we only want to perform one ${LDCONFIG} for both
|
||||
${Q}# libcalc${LIB_EXT_VERS} and libcustcalc${LIB_EXT_VERS}.
|
||||
|
||||
# Try to remove everything that was installed
|
||||
#
|
||||
# NOTE: Keep the uninstall rule in reverse order to the install rule
|
||||
#
|
||||
uninstall:
|
||||
-${Q} if [ -f "${T}${CUSTOMCALDIR}/libcustcalc.a" ]; then \
|
||||
${RM} -f "${T}${CUSTOMCALDIR}/libcustcalc.a"; \
|
||||
if [ -f "${T}${CUSTOMCALDIR}/libcustcalc.a" ]; then \
|
||||
echo "cannot uninstall ${T}${CUSTOMCALDIR}/libcustcalc.a"; \
|
||||
else \
|
||||
echo "uninstalled ${T}${CUSTOMCALDIR}/libcustcalc.a"; \
|
||||
fi; \
|
||||
fi
|
||||
-${Q} for i in ${CUSTOM_HELP} /dev/null; do \
|
||||
if [ "$$i" = "/dev/null" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
if [ -f "${T}${CUSTOMHELPDIR}/$$i" ]; then \
|
||||
${RM} -f "${T}${CUSTOMHELPDIR}/$$i"; \
|
||||
if [ -f "${T}${CUSTOMHELPDIR}/$$i" ]; then \
|
||||
echo "cannot uninstall ${T}${CUSTOMHELPDIR}/$$i"; \
|
||||
else \
|
||||
echo "uninstalled ${T}${CUSTOMHELPDIR}/$$i"; \
|
||||
fi; \
|
||||
fi; \
|
||||
done
|
||||
-${Q} for i in ${CUSTOM_CALC_FILES} /dev/null; do \
|
||||
if [ "$$i" = "/dev/null" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
if [ -f "${T}${CUSTOMCALDIR}/$$i" ]; then \
|
||||
${RM} -f "${T}${CUSTOMCALDIR}/$$i"; \
|
||||
if [ -f "${T}${CUSTOMCALDIR}/$$i" ]; then \
|
||||
echo "cannot uninstall ${T}${CUSTOMCALDIR}/$$i"; \
|
||||
else \
|
||||
echo "uninstalled ${T}${CUSTOMCALDIR}/$$i"; \
|
||||
fi; \
|
||||
fi; \
|
||||
done
|
||||
-${Q} for i in ${INSTALL_H_SRC} /dev/null; do \
|
||||
if [ "$$i" = "/dev/null" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
if [ -f "${T}${CUSTOMINCDIR}/$$i" ]; then \
|
||||
${RM} -f "${T}${CUSTOMINCDIR}/$$i"; \
|
||||
if [ -f "${T}${CUSTOMINCDIR}/$$i" ]; then \
|
||||
echo "cannot uninstall ${T}${CUSTOMINCDIR}/$$i"; \
|
||||
else \
|
||||
echo "uninstalled ${T}${CUSTOMINCDIR}/$$i"; \
|
||||
fi; \
|
||||
fi; \
|
||||
done
|
||||
-${Q} for i in ${CUSTOMINCDIR} ${CUSTOMHELPDIR} ${CUSTOMCALDIR} \
|
||||
${HELPDIR} ${CALC_INCDIR} ${CALC_SHAREDIR} ${INCDIR}; do \
|
||||
if [ -d "${T}$$i" ]; then \
|
||||
${RMDIR} "${T}$$i" 2>/dev/null; \
|
||||
echo "cleaned up ${T}$$i"; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
##
|
||||
#
|
||||
# make depend stuff
|
||||
#
|
||||
##
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
c_argv.o: ../alloc.h
|
||||
c_argv.o: ../block.h
|
||||
c_argv.o: ../byteswap.h
|
||||
c_argv.o: ../calc.h
|
||||
c_argv.o: ../calcerr.h
|
||||
c_argv.o: ../cmath.h
|
||||
c_argv.o: ../config.h
|
||||
c_argv.o: ../custom.h
|
||||
c_argv.o: ../decl.h
|
||||
c_argv.o: ../endian_calc.h
|
||||
c_argv.o: ../hash.h
|
||||
c_argv.o: ../have_const.h
|
||||
c_argv.o: ../have_memmv.h
|
||||
c_argv.o: ../have_newstr.h
|
||||
c_argv.o: ../have_stdlib.h
|
||||
c_argv.o: ../have_string.h
|
||||
c_argv.o: ../have_unused.h
|
||||
c_argv.o: ../longbits.h
|
||||
c_argv.o: ../nametype.h
|
||||
c_argv.o: ../qmath.h
|
||||
c_argv.o: ../sha1.h
|
||||
c_argv.o: ../str.h
|
||||
c_argv.o: ../value.h
|
||||
c_argv.o: ../zmath.h
|
||||
c_argv.o: c_argv.c
|
||||
c_devnull.o: ../alloc.h
|
||||
c_devnull.o: ../block.h
|
||||
c_devnull.o: ../byteswap.h
|
||||
c_devnull.o: ../calcerr.h
|
||||
c_devnull.o: ../cmath.h
|
||||
c_devnull.o: ../config.h
|
||||
c_devnull.o: ../custom.h
|
||||
c_devnull.o: ../decl.h
|
||||
c_devnull.o: ../endian_calc.h
|
||||
c_devnull.o: ../hash.h
|
||||
c_devnull.o: ../have_const.h
|
||||
c_devnull.o: ../have_memmv.h
|
||||
c_devnull.o: ../have_newstr.h
|
||||
c_devnull.o: ../have_stdlib.h
|
||||
c_devnull.o: ../have_string.h
|
||||
c_devnull.o: ../have_unistd.h
|
||||
c_devnull.o: ../have_unused.h
|
||||
c_devnull.o: ../longbits.h
|
||||
c_devnull.o: ../nametype.h
|
||||
c_devnull.o: ../qmath.h
|
||||
c_devnull.o: ../sha1.h
|
||||
c_devnull.o: ../str.h
|
||||
c_devnull.o: ../value.h
|
||||
c_devnull.o: ../zmath.h
|
||||
c_devnull.o: c_devnull.c
|
||||
c_help.o: ../alloc.h
|
||||
c_help.o: ../block.h
|
||||
c_help.o: ../byteswap.h
|
||||
c_help.o: ../calcerr.h
|
||||
c_help.o: ../cmath.h
|
||||
c_help.o: ../config.h
|
||||
c_help.o: ../custom.h
|
||||
c_help.o: ../decl.h
|
||||
c_help.o: ../endian_calc.h
|
||||
c_help.o: ../hash.h
|
||||
c_help.o: ../have_const.h
|
||||
c_help.o: ../have_memmv.h
|
||||
c_help.o: ../have_newstr.h
|
||||
c_help.o: ../have_stdlib.h
|
||||
c_help.o: ../have_string.h
|
||||
c_help.o: ../have_unistd.h
|
||||
c_help.o: ../have_unused.h
|
||||
c_help.o: ../longbits.h
|
||||
c_help.o: ../nametype.h
|
||||
c_help.o: ../qmath.h
|
||||
c_help.o: ../sha1.h
|
||||
c_help.o: ../str.h
|
||||
c_help.o: ../value.h
|
||||
c_help.o: ../zmath.h
|
||||
c_help.o: c_help.c
|
||||
c_pmodm127.o: ../alloc.h
|
||||
c_pmodm127.o: ../block.h
|
||||
c_pmodm127.o: ../byteswap.h
|
||||
c_pmodm127.o: ../calcerr.h
|
||||
c_pmodm127.o: ../cmath.h
|
||||
c_pmodm127.o: ../config.h
|
||||
c_pmodm127.o: ../custom.h
|
||||
c_pmodm127.o: ../decl.h
|
||||
c_pmodm127.o: ../endian_calc.h
|
||||
c_pmodm127.o: ../hash.h
|
||||
c_pmodm127.o: ../have_const.h
|
||||
c_pmodm127.o: ../have_memmv.h
|
||||
c_pmodm127.o: ../have_newstr.h
|
||||
c_pmodm127.o: ../have_stdlib.h
|
||||
c_pmodm127.o: ../have_string.h
|
||||
c_pmodm127.o: ../have_unused.h
|
||||
c_pmodm127.o: ../longbits.h
|
||||
c_pmodm127.o: ../nametype.h
|
||||
c_pmodm127.o: ../qmath.h
|
||||
c_pmodm127.o: ../sha1.h
|
||||
c_pmodm127.o: ../str.h
|
||||
c_pmodm127.o: ../value.h
|
||||
c_pmodm127.o: ../zmath.h
|
||||
c_pmodm127.o: c_pmodm127.c
|
||||
c_pzasusb8.o: ../alloc.h
|
||||
c_pzasusb8.o: ../block.h
|
||||
c_pzasusb8.o: ../byteswap.h
|
||||
c_pzasusb8.o: ../calcerr.h
|
||||
c_pzasusb8.o: ../cmath.h
|
||||
c_pzasusb8.o: ../config.h
|
||||
c_pzasusb8.o: ../custom.h
|
||||
c_pzasusb8.o: ../decl.h
|
||||
c_pzasusb8.o: ../endian_calc.h
|
||||
c_pzasusb8.o: ../hash.h
|
||||
c_pzasusb8.o: ../have_const.h
|
||||
c_pzasusb8.o: ../have_memmv.h
|
||||
c_pzasusb8.o: ../have_newstr.h
|
||||
c_pzasusb8.o: ../have_stdlib.h
|
||||
c_pzasusb8.o: ../have_string.h
|
||||
c_pzasusb8.o: ../have_unused.h
|
||||
c_pzasusb8.o: ../longbits.h
|
||||
c_pzasusb8.o: ../nametype.h
|
||||
c_pzasusb8.o: ../qmath.h
|
||||
c_pzasusb8.o: ../sha1.h
|
||||
c_pzasusb8.o: ../str.h
|
||||
c_pzasusb8.o: ../value.h
|
||||
c_pzasusb8.o: ../zmath.h
|
||||
c_pzasusb8.o: c_pzasusb8.c
|
||||
c_register.o: ../alloc.h
|
||||
c_register.o: ../block.h
|
||||
c_register.o: ../byteswap.h
|
||||
c_register.o: ../calc.h
|
||||
c_register.o: ../calcerr.h
|
||||
c_register.o: ../cmath.h
|
||||
c_register.o: ../config.h
|
||||
c_register.o: ../custom.h
|
||||
c_register.o: ../decl.h
|
||||
c_register.o: ../endian_calc.h
|
||||
c_register.o: ../hash.h
|
||||
c_register.o: ../have_const.h
|
||||
c_register.o: ../have_memmv.h
|
||||
c_register.o: ../have_newstr.h
|
||||
c_register.o: ../have_stdlib.h
|
||||
c_register.o: ../have_string.h
|
||||
c_register.o: ../have_unused.h
|
||||
c_register.o: ../longbits.h
|
||||
c_register.o: ../nametype.h
|
||||
c_register.o: ../qmath.h
|
||||
c_register.o: ../sha1.h
|
||||
c_register.o: ../str.h
|
||||
c_register.o: ../value.h
|
||||
c_register.o: ../zmath.h
|
||||
c_register.o: c_register.c
|
||||
c_sysinfo.o: ../alloc.h
|
||||
c_sysinfo.o: ../block.h
|
||||
c_sysinfo.o: ../byteswap.h
|
||||
c_sysinfo.o: ../calc.h
|
||||
c_sysinfo.o: ../calcerr.h
|
||||
c_sysinfo.o: ../cmath.h
|
||||
c_sysinfo.o: ../conf.h
|
||||
c_sysinfo.o: ../config.h
|
||||
c_sysinfo.o: ../custom.h
|
||||
c_sysinfo.o: ../decl.h
|
||||
c_sysinfo.o: ../endian_calc.h
|
||||
c_sysinfo.o: ../fposval.h
|
||||
c_sysinfo.o: ../hash.h
|
||||
c_sysinfo.o: ../have_const.h
|
||||
c_sysinfo.o: ../have_memmv.h
|
||||
c_sysinfo.o: ../have_newstr.h
|
||||
c_sysinfo.o: ../have_stdlib.h
|
||||
c_sysinfo.o: ../have_string.h
|
||||
c_sysinfo.o: ../have_unused.h
|
||||
c_sysinfo.o: ../hist.h
|
||||
c_sysinfo.o: ../lib_calc.h
|
||||
c_sysinfo.o: ../longbits.h
|
||||
c_sysinfo.o: ../nametype.h
|
||||
c_sysinfo.o: ../prime.h
|
||||
c_sysinfo.o: ../qmath.h
|
||||
c_sysinfo.o: ../sha1.h
|
||||
c_sysinfo.o: ../str.h
|
||||
c_sysinfo.o: ../value.h
|
||||
c_sysinfo.o: ../zmath.h
|
||||
c_sysinfo.o: ../zrand.h
|
||||
c_sysinfo.o: ../zrandom.h
|
||||
c_sysinfo.o: c_sysinfo.c
|
||||
custtbl.o: ../alloc.h
|
||||
custtbl.o: ../block.h
|
||||
custtbl.o: ../byteswap.h
|
||||
custtbl.o: ../calcerr.h
|
||||
custtbl.o: ../cmath.h
|
||||
custtbl.o: ../config.h
|
||||
custtbl.o: ../custom.h
|
||||
custtbl.o: ../decl.h
|
||||
custtbl.o: ../endian_calc.h
|
||||
custtbl.o: ../hash.h
|
||||
custtbl.o: ../have_const.h
|
||||
custtbl.o: ../have_memmv.h
|
||||
custtbl.o: ../have_newstr.h
|
||||
custtbl.o: ../have_stdlib.h
|
||||
custtbl.o: ../have_string.h
|
||||
custtbl.o: ../longbits.h
|
||||
custtbl.o: ../nametype.h
|
||||
custtbl.o: ../qmath.h
|
||||
custtbl.o: ../sha1.h
|
||||
custtbl.o: ../str.h
|
||||
custtbl.o: ../value.h
|
||||
custtbl.o: ../zmath.h
|
||||
custtbl.o: custtbl.c
|
@@ -54,10 +54,10 @@ SEE ALSO
|
||||
## 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.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 29.2 $
|
||||
## @(#) $Id: argv,v 29.2 2000/06/07 14:03:03 chongo Exp $
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: argv,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/argv,v $
|
||||
##
|
||||
## Under source code control: 1997/03/09 20:28:01
|
||||
|
@@ -15,10 +15,10 @@
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.3 $
|
||||
* @(#) $Id: argv.cal,v 29.3 2004/03/31 05:03:02 chongo Exp $
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: argv.cal,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/argv.cal,v $
|
||||
*
|
||||
* Under source code control: 1997/03/10 00:27:17
|
||||
|
@@ -15,10 +15,10 @@
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.9 $
|
||||
* @(#) $Id: c_argv.c,v 29.9 2007/02/18 14:24:56 chongo Exp $
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: c_argv.c,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_argv.c,v $
|
||||
*
|
||||
* Under source code control: 1997/03/09 20:27:37
|
||||
|
@@ -15,10 +15,10 @@
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.5 $
|
||||
* @(#) $Id: c_devnull.c,v 29.5 2007/02/18 14:24:56 chongo Exp $
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: c_devnull.c,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_devnull.c,v $
|
||||
*
|
||||
* Under source code control: 1997/03/09 17:49:12
|
||||
|
@@ -15,10 +15,10 @@
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.5 $
|
||||
* @(#) $Id: c_help.c,v 29.5 2007/02/18 14:24:56 chongo Exp $
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: c_help.c,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_help.c,v $
|
||||
*
|
||||
* Under source code control: 1997/03/09 05:25:41
|
||||
|
@@ -15,10 +15,10 @@
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.7 $
|
||||
* @(#) $Id: c_pmodm127.c,v 29.7 2007/02/18 14:24:56 chongo Exp $
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: c_pmodm127.c,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_pmodm127.c,v $
|
||||
*
|
||||
* Under source code control: 2004/07/28 22:12:25
|
||||
|
@@ -15,10 +15,10 @@
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.5 $
|
||||
* @(#) $Id: c_pzasusb8.c,v 29.5 2007/02/18 14:24:56 chongo Exp $
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: c_pzasusb8.c,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_pzasusb8.c,v $
|
||||
*
|
||||
* Under source code control: 1999/10/06 03:12:25
|
||||
|
130
custom/c_register.c
Normal file
130
custom/c_register.c
Normal file
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* c_register - set or print a custom register value
|
||||
*
|
||||
* Copyright (C) 2007 Landon Curt Noll
|
||||
*
|
||||
* Calc is open software; you can redistribute it and/or modify it under
|
||||
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: c_register.c,v 30.1 2007/07/15 02:24:34 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_register.c,v $
|
||||
*
|
||||
* Under source code control: 2007/07/14 20:23:46
|
||||
* File existed as early as: 2007
|
||||
*
|
||||
* chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
||||
* Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
||||
*/
|
||||
|
||||
|
||||
#if defined(CUSTOM)
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "have_const.h"
|
||||
#include "value.h"
|
||||
#include "custom.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "calc.h"
|
||||
|
||||
#include "have_unused.h"
|
||||
|
||||
|
||||
/*
|
||||
* registers
|
||||
*/
|
||||
STATIC VALUE custom_reg[CUSTOM_REG_MAX+1];
|
||||
|
||||
|
||||
/*
|
||||
* init_custreg - initialize custom registers
|
||||
*/
|
||||
void
|
||||
init_custreg(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
/*
|
||||
* set the registers to zero
|
||||
*/
|
||||
for (i=0; i < CUSTOM_REG_MAX+1; ++i) {
|
||||
custom_reg[i].v_type = V_NUM;
|
||||
custom_reg[i].v_subtype = V_NOSUBTYPE;
|
||||
custom_reg[i].v_num = itoq(0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* c_register - set or print a custom register value
|
||||
*
|
||||
* given:
|
||||
* vals[i] and arg to display information about
|
||||
*
|
||||
* returns:
|
||||
* count
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
VALUE
|
||||
c_register(char UNUSED *name, int count, VALUE **vals)
|
||||
{
|
||||
VALUE result; /* what we will return */
|
||||
long reg; /* register number */
|
||||
|
||||
/*
|
||||
* arg check
|
||||
*/
|
||||
result.v_type = V_NULL;
|
||||
if (vals[0]->v_type != V_NUM) {
|
||||
math_error("Non-numeric register number");
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
if (qisfrac(vals[0]->v_num)) {
|
||||
math_error("Non-integer register number");
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
if (qisneg(vals[0]->v_num)) {
|
||||
math_error("register number < 0");
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
if (! qistiny(vals[0]->v_num)) {
|
||||
math_error("register is huge");
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
reg = qtoi(vals[0]->v_num);
|
||||
if (reg > CUSTOM_REG_MAX) {
|
||||
math_error("register is larger than CUSTOM_REG_MAX");
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
/*
|
||||
* print info on each arg
|
||||
*/
|
||||
/* save previous value */
|
||||
copyvalue(&custom_reg[reg], &result);
|
||||
/* set the new value if a 2nd arg was given */
|
||||
if (count == 2) {
|
||||
copyvalue(vals[1], &custom_reg[reg]);
|
||||
}
|
||||
|
||||
/*
|
||||
* return result
|
||||
*/
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif /* CUSTOM */
|
@@ -15,10 +15,10 @@
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.14 $
|
||||
* @(#) $Id: c_sysinfo.c,v 29.14 2007/02/18 14:24:56 chongo Exp $
|
||||
* @(#) $Revision: 30.2 $
|
||||
* @(#) $Id: c_sysinfo.c,v 30.2 2007/07/05 19:35:20 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_sysinfo.c,v $
|
||||
*
|
||||
* Under source code control: 1997/03/09 23:14:40
|
||||
@@ -157,6 +157,7 @@ STATIC struct infoname sys_info[] = {
|
||||
{"TOPLONG", "top long bit", NULL, (FULL)TOPLONG},
|
||||
{"TRUE", "boolean true", NULL, (FULL)TRUE},
|
||||
{"USUAL_ELEMENTS", "usual number of elements for objects", NULL, (FULL)USUAL_ELEMENTS},
|
||||
{"REGNUM_MAX", "highest custom register number", NULL, (FULL)CUSTOM_REG_MAX},
|
||||
|
||||
/* must be last */
|
||||
{NULL, NULL, NULL, (FULL)0}
|
||||
|
@@ -15,10 +15,10 @@
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.6 $
|
||||
* @(#) $Id: custtbl.c,v 29.6 2007/02/18 14:24:56 chongo Exp $
|
||||
* @(#) $Revision: 30.2 $
|
||||
* @(#) $Id: custtbl.c,v 30.2 2007/07/05 19:35:20 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/custtbl.c,v $
|
||||
*
|
||||
* Under source code control: 1997/03/09 02:28:54
|
||||
@@ -58,6 +58,7 @@ E_FUNC VALUE c_help(char*, int, VALUE**);
|
||||
E_FUNC VALUE c_sysinfo(char*, int, VALUE**);
|
||||
E_FUNC VALUE c_pzasusb8(char*, int, VALUE**);
|
||||
E_FUNC VALUE c_pmodm127(char*, int, VALUE**);
|
||||
E_FUNC VALUE c_register(char*, int, VALUE**);
|
||||
|
||||
|
||||
#endif /* CUSTOM */
|
||||
@@ -113,6 +114,9 @@ CONST struct custom cust[] = {
|
||||
{ "pmodm127", "calculate q mod 2^(2^127-1)",
|
||||
1, 1, c_pmodm127 },
|
||||
|
||||
{ "register", "get or set customer registers",
|
||||
1, 2, c_register },
|
||||
|
||||
|
||||
#endif /* CUSTOM */
|
||||
|
||||
|
@@ -40,10 +40,10 @@ SEE ALSO
|
||||
## 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.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 29.2 $
|
||||
## @(#) $Id: devnull,v 29.2 2000/06/07 14:03:03 chongo Exp $
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: devnull,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/devnull,v $
|
||||
##
|
||||
## Under source code control: 1997/03/09 17:49:12
|
||||
|
@@ -15,10 +15,10 @@
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.3 $
|
||||
* @(#) $Id: halflen.cal,v 29.3 2004/03/31 05:03:02 chongo Exp $
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: halflen.cal,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/halflen.cal,v $
|
||||
*
|
||||
* Under source code control: 1997/03/08 20:51:32
|
||||
|
@@ -41,10 +41,10 @@ SEE ALSO
|
||||
## 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.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 29.2 $
|
||||
## @(#) $Id: help,v 29.2 2000/06/07 14:03:03 chongo Exp $
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: help,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/help,v $
|
||||
##
|
||||
## Under source code control: 1997/03/09 06:03:58
|
||||
|
@@ -65,10 +65,10 @@ SEE ALSO
|
||||
## 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.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 29.2 $
|
||||
## @(#) $Id: pmodm127,v 29.2 2004/07/29 09:28:58 chongo Exp $
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: pmodm127,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/pmodm127,v $
|
||||
##
|
||||
## Under source code control: 2004/02/25 07:13:15
|
||||
|
@@ -15,10 +15,10 @@
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.2 $
|
||||
* @(#) $Id: pmodm127.cal,v 29.2 2004/07/29 08:35:36 chongo Exp $
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: pmodm127.cal,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/pmodm127.cal,v $
|
||||
*
|
||||
* Under source code control: 2004/02/25 14:25:32
|
||||
|
@@ -63,10 +63,10 @@ SEE ALSO
|
||||
## 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.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 29.3 $
|
||||
## @(#) $Id: pzasusb8,v 29.3 2005/10/18 11:18:34 chongo Exp $
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: pzasusb8,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/pzasusb8,v $
|
||||
##
|
||||
## Under source code control: 1999/10/06 04:05:43
|
||||
|
@@ -17,10 +17,10 @@
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.3 $
|
||||
* @(#) $Id: pzasusb8.cal,v 29.3 2004/03/31 05:03:02 chongo Exp $
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: pzasusb8.cal,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/pzasusb8.cal,v $
|
||||
*
|
||||
* Under source code control: 1999/10/06 03:11:12
|
||||
|
82
custom/register
Normal file
82
custom/register
Normal file
@@ -0,0 +1,82 @@
|
||||
NAME
|
||||
register - set or print a custom register value
|
||||
|
||||
SYNOPSIS
|
||||
custom("register", regnum[, value])
|
||||
|
||||
TYPES
|
||||
regnum int
|
||||
value any, &any
|
||||
|
||||
return any
|
||||
|
||||
DESCRIPTION
|
||||
This custom function reads or sets a value of a custom register.
|
||||
A custom register can hold any calc value.
|
||||
|
||||
Without a value arg, the register value is return. With a value
|
||||
arg, the register is set with that value and the previous value
|
||||
is returned.
|
||||
|
||||
The number of custom registers is defined at compile time.
|
||||
There will be at least 32 registers although there could be more
|
||||
added in the future. It may be deterimed by:
|
||||
|
||||
custom("sysinfo", "REGNUM_MAX")
|
||||
|
||||
The custom registers are initialized to 0 by the internal
|
||||
function libcalc_call_me_first() during calc startup.
|
||||
|
||||
This custom interface is intented to make it easier to interface
|
||||
with special purpose hardware.
|
||||
|
||||
EXAMPLE
|
||||
> custom("register", 3)
|
||||
0
|
||||
> custom("register", 3, 45)
|
||||
0
|
||||
> custom("register", 3)
|
||||
45
|
||||
|
||||
> custom("register", 7, 2i),
|
||||
> custom("register", 8, 3i),
|
||||
> custom("register", 7) * custom("register", 8)
|
||||
-6
|
||||
|
||||
LIMITS
|
||||
calc must be built with ALLOW_CUSTOM= -DCUSTOM
|
||||
calc must be executed with a -C arg.
|
||||
The regnum numbe bee an integer >= 0 and < REGNUM_MAX where
|
||||
REGNUM_MAX is a compile time constant that is >= 32.
|
||||
|
||||
LIBRARY
|
||||
none
|
||||
|
||||
SEE ALSO
|
||||
custom
|
||||
|
||||
## Copyright (C) 2007 Landon Curt Noll
|
||||
##
|
||||
## Calc is open software; you can redistribute it and/or modify it under
|
||||
## the terms of the version 2.1 of the GNU Lesser General Public License
|
||||
## 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.
|
||||
##
|
||||
## @(#) $Revision: 29.2 $
|
||||
## @(#) $Id: register,v 29.2 2007/07/05 19:35:20 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/register,v $
|
||||
##
|
||||
## Under source code control: 2005/02/04 22:39:50
|
||||
## File existed as early as: 2005
|
||||
##
|
||||
## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
||||
## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
70
custom/register.cal
Normal file
70
custom/register.cal
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* register - set or print a custom register value
|
||||
*
|
||||
* Copyright (C) 2007 Landon Curt Noll
|
||||
*
|
||||
* Calc is open software; you can redistribute it and/or modify it under
|
||||
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: register.cal,v 30.1 2007/07/05 19:35:54 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/register.cal,v $
|
||||
*
|
||||
* Under source code control: 2007/07/05 11:11:11
|
||||
* File existed as early as: 2007
|
||||
*
|
||||
* chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
||||
* Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file is part of the custom sample calc files.
|
||||
*
|
||||
* NOTE: You must use a calc that was compiled with ALLOW_CUSTOM= -DCUSTOM
|
||||
* and run with a -C arg.
|
||||
*/
|
||||
if (config("compile_custom") == 0) {
|
||||
quit "calc compiled without -DCUSTOM";
|
||||
} else if (config("allow_custom") == 0) {
|
||||
quit "calc was run without the -D command line option";
|
||||
}
|
||||
|
||||
|
||||
define register(num)
|
||||
{
|
||||
local reg_max; /* number of registers */
|
||||
|
||||
/*
|
||||
* firewall
|
||||
*/
|
||||
if (!isnum(num)) {
|
||||
return newerror("register only works on numeric values");
|
||||
}
|
||||
|
||||
/*
|
||||
* determine register count
|
||||
*/
|
||||
reg_max = custom("sysinfo", "REGNUM_MAX");
|
||||
|
||||
/*
|
||||
* determine the HALF length of a numeric value
|
||||
*/
|
||||
if (num < 0) {
|
||||
return newerror("register number must be >= 0");
|
||||
} else if (num > reg_max) {
|
||||
return newerror("register number must be < REGNUM_MAX");
|
||||
} else {
|
||||
return custom("register", num);
|
||||
}
|
||||
}
|
@@ -67,10 +67,10 @@ SEE ALSO
|
||||
## 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.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 29.2 $
|
||||
## @(#) $Id: sysinfo,v 29.2 2000/06/07 14:03:03 chongo Exp $
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: sysinfo,v 30.1 2007/03/16 11:10:04 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/sysinfo,v $
|
||||
##
|
||||
## Under source code control: 1997/03/09 23:14:40
|
||||
|
Reference in New Issue
Block a user