modified: diffout.py
[GalaxyCodeBases.git] / c_cpp / etc / calc / custom / Makefile
blob73594fc6db33de5024d10a39240e34aebbd8e71d
1 #!/bin/make
3 # custom - makefile for calc custom routines
5 # Copyright (C) 1999-2006 Landon Curt Noll
7 # Calc is open software; you can redistribute it and/or modify it under
8 # the terms of the version 2.1 of the GNU Lesser General Public License
9 # as published by the Free Software Foundation.
11 # Calc is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
14 # Public License for more details.
16 # A copy of version 2.1 of the GNU Lesser General Public License is
17 # distributed with calc under the filename COPYING-LGPL. You should have
18 # received a copy with calc; if not, write to Free Software Foundation, Inc.
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 # @(#) $Revision: 30.28 $
22 # @(#) $Id: Makefile.head,v 30.28 2013/08/11 05:40:18 chongo Exp $
23 # @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/Makefile.head,v $
25 # Under source code control: 1997/03/09 02:28:54
26 # File existed as early as: 1997
28 # chongo <was here> /\oo/\ http://www.isthe.com/chongo/
29 # Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
31 # calculator by David I. Bell with help/mods from others
32 # Makefile by Landon Curt Noll
34 #if 0 /* start of skip for non-Gnu makefiles */
35 ##############################################################################
36 #-=-=-=-=-=-=-=-=- Identify the target machine, if possible -=-=-=-=-=-=-=-=-#
37 ##############################################################################
39 # NOTE: You can force a target value by defining target as in:
41 # make ...__optional_arguments_... target=value
43 # Try uname -s if the target was not alreadhy set on the make command line
45 ifeq ($(target),)
46 target=$(shell uname -s 2>/dev/null)
47 endif
48 #endif /* end of skip for non-Gnu makefiles */
50 ##############################################################################
51 #-=-=-=-=-=-=-=-=- You may want to change some values below -=-=-=-=-=-=-=-=-#
52 ##############################################################################
54 # The custom calc resource files to install
56 # Put your custom calc resource files here.
58 CUSTOM_CALC_FILES= argv.cal halflen.cal pzasusb8.cal pmodm127.cal register.cal
60 # The custom help files to install
62 # Put your custom help files here.
64 CUSTOM_HELP= argv devnull help sysinfo pzasusb8 pmodm127 register
66 # Any .h files that are needed by programs that use
67 # libcustcalc${LIB_EXT_VERSION}
69 # Put any .h files that you add which might be useful to other
70 # programs here.
72 CUSTOM_H_SRC=
74 # Any .c files that are needed to build libcustcalc${LIB_EXT_VERSION}.
76 # Don't put ${REQUIRED_SRC} files in this list.
78 # There MUST be a .c in CUSTOM_SRC for every .o in CUSTOM_OBJ.
80 # Put your custom .c files here.
82 CUSTOM_SRC= c_argv.c c_devnull.c c_help.c c_sysinfo.c c_pzasusb8.c \
83 c_pmodm127.c c_register.c
85 # Any .o files that are needed by program that use
86 # libcustcalc${LIB_EXT_VERSION}.
88 # Don't put ${REQUIRED_OBJ} files in this list.
90 # There MUST be a .c in CUSTOM_SRC for every .o in CUSTOM_OBJ.
92 # Put your custom .o files here.
94 CUSTOM_OBJ= c_argv.o c_devnull.o c_help.o c_sysinfo.o c_pzasusb8.o \
95 c_pmodm127.o c_register.o
97 ##############################################################################
98 #-=-=-=-=-=-=- Defaults in case you want to build from this dir -=-=-=-=-=-=-#
99 ##############################################################################
101 # Normally, the upper level makefile will set these values. We provide
102 # a default here just in case you want to build from this directory.
104 # Makefile debug
106 # Q=@ do not echo internal makefile actions (quiet mode)
107 # Q= echo internal makefile actions (debug / verbose mode)
112 ####
113 # Normally, the upper level makefile will set these values. We provide
114 # a default here just in case you want to build from this directory.
115 ####
117 # Where the system include (.h) files are kept
119 # For DJGPP, select:
121 # INCDIR= /dev/env/DJDIR/include
123 # If in doubt, set:
125 # INCDIR= /usr/include
128 #INCDIR= /usr/local/include
129 #INCDIR= /dev/env/DJDIR/include
130 INCDIR= /usr/include
132 # where to install calc realted things
134 # ${BINDIR} where to install calc binary files
135 # ${LIBDIR} where calc link library (*.a) files are installed
136 # ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files
138 # NOTE: The install rule prepends installation paths with ${T}, which
139 # by default is empty. If ${T} is non-empty, then installation
140 # locations will be relative to the ${T} directory.
142 # For DJGPP, select:
144 # BINDIR= /dev/env/DJDIR/bin
145 # LIBDIR= /dev/env/DJDIR/lib
146 # CALC_SHAREDIR= /dev/env/DJDIR/share/calc
148 # If in doubt, set:
150 # BINDIR= /usr/bin
151 # LIBDIR= /usr/lib
152 # CALC_SHAREDIR= /usr/share/calc
154 #BINDIR= /usr/local/bin
155 #BINDIR= /dev/env/DJDIR/bin
156 BINDIR= /usr/bin
158 #LIBDIR= /usr/local/lib
159 #LIBDIR= /dev/env/DJDIR/lib
160 LIBDIR= /usr/lib
162 #CALC_SHAREDIR= /usr/local/lib/calc
163 #CALC_SHAREDIR= /dev/env/DJDIR/share/calc
164 CALC_SHAREDIR= /usr/share/calc
166 # By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR
167 # ---------------------------------------------------------------
168 # ${HELPDIR} where the help directory is installed
169 # ${CALC_INCDIR} where the calc include files are installed
170 # ${CUSTOMCALDIR} where custom *.cal files are installed
171 # ${CUSTOMHELPDIR} where custom help files are installed
172 # ${CUSTOMINCDIR} where custom .h files are installed
173 # ${SCRIPTDIR} where calc shell scripts are installed
175 # NOTE: The install rule prepends installation paths with ${T}, which
176 # by default is empty. If ${T} is non-empty, then installation
177 # locations will be relative to the ${T} directory.
179 # If in doubt, set:
181 # HELPDIR= ${CALC_SHAREDIR}/help
182 # CALC_INCDIR= ${INCDIR}/calc
183 # CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
184 # CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
185 # CUSTOMINCDIR= ${CALC_INCDIR}/custom
186 # SCRIPTDIR= ${BINDIR}/cscript
188 HELPDIR= ${CALC_SHAREDIR}/help
189 CALC_INCDIR= ${INCDIR}/calc
190 CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
191 CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
192 CUSTOMINCDIR= ${CALC_INCDIR}/custom
193 SCRIPTDIR= ${BINDIR}/cscript
195 # T - top level directory under which calc will be installed
197 # The calc install is performed under ${T}, the calc build is
198 # performed under /. The purpose for ${T} is to allow someone
199 # to install calc somewhere other than into the system area.
201 # For example, if:
203 # BINDIR= /usr/bin
204 # LIBDIR= /usr/lib
205 # CALC_SHAREDIR= /usr/share/calc
207 # and if:
209 # T= /var/tmp/testing
211 # Then the installation locations will be:
213 # calc binary files: /var/tmp/testing/usr/bin
214 # calc link library: /var/tmp/testing/usr/lib
215 # calc help, .cal ...: /var/tmp/testing/usr/share/calc
216 # ... etc ... /var/tmp/testing/...
218 # If ${T} is empty, calc is installed under /, which is the same
219 # top of tree for which it was built. If ${T} is non-empty, then
220 # calc is installed under ${T}, as if one had to chroot under
221 # ${T} for calc to operate.
223 # If in doubt, use T=
227 # Debug/Optimize options for ${CC} and ${LCC}
229 # Select DEBUG= -O2 -gstabs+ -DWINDOZ for DJGPP.
231 #DEBUG=
233 #DEBUG= -O
234 #DEBUG= -O -g
235 #DEBUG= -O -g3
237 #DEBUG= -O1
238 #DEBUG= -O1 -g
239 #DEBUG= -O1 -g3
241 #DEBUG= -O2
242 #DEBUG= -O2 -g
243 #DEBUG= -O2 -g3
244 #DEBUG= -O2 -ipa
245 #DEBUG= -O2 -g3 -ipa
247 #DEBUG= -O3
248 #DEBUG= -O3 -g
249 DEBUG= -O3 -g3
250 #DEBUG= -O3 -ipa
251 #DEBUG= -O3 -g3 -ipa
253 #DEBUG= -g
254 #DEBUG= -g3
255 #DEBUG= -gx
256 #DEBUG= -WM,-g
258 #DEBUG= -O2 -gstabs+ -DWINDOZ
260 # Some systems require one to use ranlib to add a symbol table to
261 # a *.a link library. Set RANLIB to the utility that performs this
262 # action. Set RANLIB to : if your system does not need such a utility.
264 RANLIB=ranlib
265 #RANLIB=:
267 # Normally certain files depend on the Makefile. If the Makefile is
268 # changed, then certain steps should be redone. If MAKE_FILE is
269 # set to Makefile, then these files will depend on Makefile. If
270 # MAKE_FILE is empty, then they wont.
272 # If in doubt, set MAKE_FILE to Makefile
274 MAKE_FILE= Makefile
275 #MAKE_FILE=
277 # Controlling file makefile basename (without the path)
279 # This is the basename same of the makefile that may/does/will drive
280 # this makefile.
282 # If in doubt, set TOP_MAKE_FILE to Makefile
284 TOP_MAKE_FILE= Makefile
286 # If you do not wish to use purify, set PURIFY to an empty string.
288 # If in doubt, use PURIFY=
290 #PURIFY= purify
291 #PURIFY= purify -m71-engine
292 #PURIFY= purify -logfile=pure.out
293 #PURIFY= purify -m71-engine -logfile=pure.out
294 PURIFY=
296 # If you want to use a debugging link library such as a malloc debug link
297 # library, or need to add special ld flags after the calc link libraries
298 # are included, set ${LD_DEBUG} below.
300 # If in doubt, set LD_DEBUG to empty.
302 #LD_DEBUG= -lmalloc_cv
303 LD_DEBUG=
305 # When doing a:
307 # make check
308 # make chk
309 # make debug
311 # the ${CALC_ENV} is used to supply the proper environment variables
312 # to calc. Most people will simply need 'CALCPATH=./cal' to ensure
313 # that these debug rules will only use calc resource files under the
314 # local source directory. The longer lines (with MALLOC_VERBOSE=1 ...)
315 # are useful for SGI IRIX people who have 'WorkShop Performance Tools'
316 # and who also set 'LD_DEBUG= -lmalloc_cv' above.
318 # If in doubt, use CALC_ENV= CALCPATH=./cal.
320 CALC_ENV= CALCPATH=./cal
321 #CALC_ENV= CALCPATH=./cal MALLOC_VERBOSE=1 MALLOC_TRACING=1 \
322 # MALLOC_FASTCHK=1 MALLOC_FULLWARN=1
323 #CALC_ENV= CALCPATH=./cal MALLOC_VERBOSE=1 MALLOC_TRACING=1 \
324 # MALLOC_FASTCHK=1 MALLOC_FULLWARN=1 MALLOC_CLEAR_FREE=1 \
325 # MALLOC_CLEAR_MALLOC=1
327 # By default, custom builtin functions may only be executed if calc
328 # is given the -C option. This is because custom builtin functions
329 # may invoke non-standard or non-portable code. One may completely
330 # disable custom builtin functions by not compiling any of code
332 # ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given
333 # ALLOW_CUSTOM= # disable custom even if -C is given
335 # If in doubt, use ALLOW_CUSTOM= -DCUSTOM
337 ALLOW_CUSTOM= -DCUSTOM
338 #ALLOW_CUSTOM=
340 # The install rule uses:
342 # ${MKDIR} ${MKDIR_ARG}
344 # to create directorties. Normall this amounts to usins mkdir -p dir ...
345 # Some older systems may not have mkdir -p. If you system does not
346 # make mkdir -p, then set MKDIR_ARG to empty.
348 # MKDIR_ARG= -p # use mkdir -p when creating paths
349 # MKDIR_ARG= # use if system does not understand mkdir -p
351 MKDIR_ARG= -p
352 #MKDIR_ARG=
354 # Some out of date operating systems require / want an executable to
355 # end with a certain file extension. Some compile systems such as
356 # Cygwin build calc as calc.exe. The EXT variable is used to denote
357 # the extension required by such.
359 # EXT= # normal Un*x / Linux / GNU/Linux systems
360 # EXT=.exe # windoz / Cygwin
362 # If in doubt, use EXT=
364 EXT=
365 #EXT=.exe
367 # The default calc versions
369 VERSION= 2.12.4.10
370 VERS= 2.12.4
371 VER= 2.12
372 VE= 2
374 # Names of shared libraries with versions
376 LIB_EXT= .so
377 LIB_EXT_VERSION= ${LIB_EXT}.${VERSION}
378 LIB_EXT_VERS= ${LIB_EXT}.${VERS}
379 LIB_EXT_VER= ${LIB_EXT}.${VER}
380 LIB_EXT_VE= ${LIB_EXT}.${VE}
382 # standard tools
384 SHELL= /bin/sh
385 SED= sed
386 MAKEDEPEND= makedepend
387 GREP= egrep
388 CHMOD= chmod
389 FMT= fmt
390 SORT= sort
391 CMP= cmp
392 AR= ar
393 RM= rm
394 TOUCH= touch
395 MKDIR= mkdir
396 RMDIR= rmdir
397 MV= mv
398 CP= cp
399 CO= co
400 TRUE= true
401 MAKE= make
402 LN= ln
403 AWK= awk
405 # EXTRA_CFLAGS are flags given to ${CC} when compiling C files
406 # EXTRA_LDFLAGS are flags given to ${CC} when linking progs
408 # Both CFLAGS and LDFLAGS are left blank in this Makefile by
409 # default so that users may use them on the make command line
410 # to always the way that C is compiled and files are linked
411 # respectively. For example:
413 # make all EXTRA_CFLAGS="-DMAGIC" EXTRA_LDFLAGS="-lmagic"
415 # NOTE: These should be left blank in this Makefile to make it
416 # easier to add stuff on the command line. If you want to
417 # to change the way calc is compiled by this Makefile, change
418 # the appropirate host target section below or a flag above.
420 EXTRA_CFLAGS=
421 EXTRA_LDFLAGS=
423 # COMMON_CFLAGS are the common ${CC} flags used for all progs, both
424 # intermediate and final calc and calc related progs
426 COMMON_CFLAGS= -DCALC_SRC ${ALLOW_CUSTOM} ${CCWARN} ${CCMISC} ${EXTRA_CFLAGS}
428 # COMMON_LDFLAGS are the common flags used for linking all progs, both
429 # intermediate and final calc and calc related progs
431 COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
433 ###########################################
434 # Set the default compile flags for ${CC} #
435 ###########################################
437 #if 0 /* start of skip for non-Gnu makefiles */
439 # Required flags to compile C files for calc
441 # ICFLAGS are given to ${CC} for intermediate progs used to help compile calc
442 # CFLAGS are given to ${CC} for calc progs other than intermediate progs
444 # NOTE: This does not work for: make-XYZ-only and BLD_TYPE != make-XYZ-only
446 ifeq ($(BLD_TYPE),calc-static-only)
447 ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC}
448 else
449 ICFLAGS= ${COMMON_CFLAGS} ${CC_SHARE}
450 endif
451 CFLAGS= ${ICFLAGS} ${CCOPT}
453 # Required flags to link files for calc
455 # ILDFLAGS for ${CC} in linking intermediate progs used to help compile calc
456 # LDFLAGS for ${CC} in linking calc progs other than intermediate progs
458 ILDFLAGS= ${COMMON_LDFLAGS}
459 LDFLAGS= ${LD_DEBUG} ${ILDFLAGS}
461 #endif /* end of skip for non-Gnu makefiles */
462 # start of host target cut - Do not remove this line
463 ##############################################################################
464 #-=-=-=-=-=- host target section - targets that override defaults -=-=-=-=-=-#
465 ##############################################################################
467 # Common values set in targets
469 # BLD_TYPE determines if calc is built with static and/or dynamic libs.
470 # Set this value to one of:
472 # BLD_TYPE= calc-dynamic-only
473 # BLD_TYPE= calc-static-only
475 # CC_SHARE are flags given to ${CC} to build .o files suitable for shared libs
476 # DEFAULT_LIB_INSTALL_PATH is where calc progs look for calc shared libs
477 # LD_SHARE are common flags given to ${CC} to link with shared libraries
478 # LIBCALC_SHLIB are flags given to ${CC} to build libcalc shared lib
479 # LIBCUSTCALC_SHLIB are flags given to ${CC} to build libcustcalc shared lib
481 # NOTE: The above 4 values are unused if BLD_TYPE= calc-static-only
483 # CC_STATIC are flags given to ${CC} to build .o files suitable for static libs
484 # LD_STATIC are common flags given to ${CC} to link with static libraries
485 # LIBCALC_STATIC are flags given to ${CC} to build libcalc static lib
486 # LIBCUSTCALC_STATIC are flags given to ${CC} to build libcustcalc static lib
488 # NOTE: The above 4 values are unused if BLD_TYPE= calc-dynamic-only
490 # CCOPT are flags given to ${CC} for optimization
491 # CCWARN are flags given to ${CC} for warning message control
492 # CCWERR are flags given to ${CC} to make warnings fatal errors
493 # NOTE: CCWERR is only set in development Makefiles and must only be
494 # used with ${CC}, not ${LCC}. If you do not want the compiler
495 # to abort on warnings, then leave CCWERR blank.
496 # CCMISC are misc flags given to ${CC}
498 # LCC how the C compiler is invoked on locally executed intermediate progs
499 # CC is how the C compiler is invoked (with an optional Purify)
501 # Specific target overrides or modifications to default values
503 ##########################################################################
504 # NOTE: If your target is not supported below and the default target #
505 # is not suitable for your needs, please send to the: #
507 # calc-contrib at asthe dot com #
509 # EMail address an "ifeq ($(target),YOUR_TARGET_NAME)" ... "endif" #
510 # set of lines so that we can consider them for the next release. #
511 ##########################################################################
513 #if 0 /* start of skip for non-Gnu makefiles */
514 ################
515 # Linux target #
516 ################
518 ifeq ($(target),Linux)
520 BLD_TYPE= calc-dynamic-only
522 CC_SHARE= -fPIC
523 DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
524 LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
525 "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
526 LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
527 ifdef ALLOW_CUSTOM
528 LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
529 else
530 LIBCUSTCALC_SHLIB=
531 endif
533 CC_STATIC=
534 LD_STATIC=
535 LIBCALC_STATIC=
536 LIBCUSTCALC_STATIC=
538 CCWARN= -Wall -W -Wno-comment
539 CCWERR=
540 CCOPT= ${DEBUG}
541 CCMISC=
543 LCC= gcc
544 CC= ${PURIFY} ${LCC} ${CCWERR}
546 endif
548 #################################
549 # Apple MacOS X / Darwin target #
550 #################################
552 ifeq ($(target),Darwin)
554 BLD_TYPE= calc-dynamic-only
556 CC_SHARE= -fPIC
557 DEFAULT_LIB_INSTALL_PATH= ${PWD}:${LIBDIR}:/usr/local/lib
558 LD_SHARE= ${DARWIN_ARCH}
559 LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib
560 ifdef ALLOW_CUSTOM
561 LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib
562 else
563 LIBCUSTCALC_SHLIB=
564 endif
566 CC_STATIC=
567 LD_STATIC= ${DARWIN_ARCH}
568 LIBCALC_STATIC=
569 LIBCUSTCALC_STATIC=
571 CCWARN= -Wall -W -Wno-comment
572 CCWERR=
573 CCOPT= ${DEBUG}
574 CCMISC= ${DARWIN_ARCH}
576 LCC= MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} gcc
577 CC= ${PURIFY} ${LCC} ${CCWERR}
579 # Darmin dynamic shared lib filenames
580 LIB_EXT:= .dylib
581 LIB_EXT_VERSION:= .${VERSION}${LIB_EXT}
582 LIB_EXT_VERS:= .${VERS}${LIB_EXT}
583 LIB_EXT_VER:= .${VER}${LIB_EXT}
584 LIB_EXT_VE:= .${VE}${LIB_EXT}
585 # LDCONFIG not required on this platform, so we redefine it to an empty string
586 LDCONFIG:=
587 # DARWIN_ARCH= -arch i386 -arch ppc # Universal binary
588 # DARWIN_ARCH= -arch i386 # Intel binary
589 # DARWIN_ARCH= -arch ppc # PPC binary
590 DARWIN_ARCH= # native binary
591 MACOSX_DEPLOYMENT_TARGET=10.8
593 endif
595 ##################
596 # FreeBSD target #
597 ##################
599 ########################################################################
600 # NOTE: You MUST either use gmake (GNU Make) or you must try your luck #
601 # with Makefile.simple and custom/Makefile.simple versions. #
602 # See HOWTO.INSTALL for more information. #
603 ########################################################################
605 ifeq ($(target),FreeBSD)
607 BLD_TYPE= calc-dynamic-only
609 CC_SHARE= -fPIC
610 DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
611 LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
612 "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
613 LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
614 ifdef ALLOW_CUSTOM
615 LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
616 else
617 LIBCUSTCALC_SHLIB=
618 endif
620 CC_STATIC=
621 LD_STATIC=
622 LIBCALC_STATIC=
623 LIBCUSTCALC_STATIC=
625 CCWARN= -Wall -W -Wno-comment
626 CCWERR=
627 CCOPT= ${DEBUG}
628 CCMISC=
630 LCC= gcc
631 CC= ${PURIFY} ${LCC} ${CCWERR}
633 MAKE= gmake
635 endif
637 ##################
638 # OpenBSD target #
639 ##################
641 ########################################################################
642 # NOTE: You MUST either use gmake (GNU Make) or you must try your luck #
643 # with Makefile.simple and custom/Makefile.simple versions. #
644 # See HOWTO.INSTALL for more information. #
645 ########################################################################
647 ifeq ($(target),OpenBSD)
649 BLD_TYPE= calc-dynamic-only
651 CC_SHARE= -fPIC
652 DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
653 LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
654 "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
655 LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
656 ifdef ALLOW_CUSTOM
657 LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
658 else
659 LIBCUSTCALC_SHLIB=
660 endif
662 CC_STATIC=
663 LD_STATIC=
664 LIBCALC_STATIC=
665 LIBCUSTCALC_STATIC=
667 CCWARN= -Wall
668 CCWERR=
669 CCOPT= ${DEBUG}
670 CCMISC=
672 LCC= gcc
673 CC= ${PURIFY} ${LCC} ${CCWERR}
675 MAKE= gmake
677 endif
679 ################
680 # SunOS target #
681 ################
683 # XXX - this needs to be tested
684 ifeq ($(target),SunOS)
686 BLD_TYPE= calc-dynamic-only
688 CC_SHARE= -fPIC
689 DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
690 LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
691 "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
692 LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
693 ifdef ALLOW_CUSTOM
694 LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
695 else
696 LIBCUSTCALC_SHLIB=
697 endif
699 CC_STATIC=
700 LIBCALC_STATIC=
701 LIBCUSTCALC_STATIC=
702 LD_STATIC=
704 CCWARN= -Wall -W -Wno-comment
705 CCWERR=
706 CCOPT= ${DEBUG}
707 CCMISC=
709 LCC= gcc
710 CC= ${PURIFY} ${LCC} ${CCWERR}
712 endif
714 #################
715 # Cygwin target #
716 #################
718 ifeq ($(target),Cygwin)
720 BLD_TYPE= calc-static-only
722 CC_SHARE= -fPIC
723 DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
724 LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
725 "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
726 LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
727 ifdef ALLOW_CUSTOM
728 LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
729 else
730 LIBCUSTCALC_SHLIB=
731 endif
733 CC_STATIC=
734 LIBCALC_STATIC=
735 LIBCUSTCALC_STATIC=
736 LD_STATIC=
738 CCWARN= -Wall -W -Wno-comment
739 CCWERR=
740 CCOPT= ${DEBUG}
741 CCMISC=
743 LCC= gcc
744 CC= ${PURIFY} ${LCC} ${CCWERR}
746 endif
748 #######################################################
749 # simple target - values used to form Makefile.simple #
750 #######################################################
752 # NOTE: This is not a real host target. The simple target
753 # exists only to form the Makefile.simple file.
755 ifeq ($(target),simple)
756 #endif /* end of skip for non-Gnu makefiles */
758 BLD_TYPE= calc-static-only
760 CC_SHARE= -fPIC
761 DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
762 LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
763 "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
764 LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
765 LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
767 CC_STATIC=
768 LD_STATIC=
769 LIBCALC_STATIC=
770 LIBCUSTCALC_STATIC=
772 CCWARN= -Wall -W -Wno-comment
773 CCWERR=
774 CCOPT= ${DEBUG}
775 CCMISC=
777 LCC= cc
778 CC= ${PURIFY} ${LCC} ${CCWERR}
780 # The simple makefile forces the use of static ${CC} flags
782 # ICFLAGS are given to ${CC} for intermediate progs used to help compile calc
783 # CFLAGS are given to ${CC} for calc progs other than intermediate progs
784 # ILDFLAGS for ${CC} in linking intermediate progs used to help compile calc
785 # LDFLAGS for ${CC} in linking calc progs other than intermediate progs
787 ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC}
788 CFLAGS= ${ICFLAGS} ${CCOPT}
790 ILDFLAGS= ${COMMON_LDFLAGS} ${LD_STATIC}
791 LDFLAGS= ${LD_DEBUG} ${ILDFLAGS} ${LIBCALC_STATIC} ${LIBCUSTCALC_STATIC}
793 #if 0 /* start of skip for non-Gnu makefiles */
794 endif
796 ###################################################
797 # MINGW32_NT-5.0 target #
798 ###################################################
801 ifeq ($(target),MINGW32_NT-5.0)
803 EXT=.exe
804 TERMCONTROL= -DUSE_WIN32
805 ifdef ALLOW_CUSTOM
806 #endif /* end of skip for non-Gnu makefiles */
807 CALCPATH= .;./cal;~/.cal;${CALC_SHAREDIR};${CUSTOMCALDIR}
808 #if 0 /* start of skip for non-Gnu makefiles */
809 else
810 CALCPATH= .;./cal;~/.cal;${CALC_SHAREDIR}
811 endif
812 CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit
814 BLD_TYPE= calc-static-only
816 CC_SHARE= -fPIC
817 DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
818 LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
819 "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
820 LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
821 ifdef ALLOW_CUSTOM
822 LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
823 else
824 LIBCUSTCALC_SHLIB=
825 endif
827 CC_STATIC= -DSTATIC_ONLY
828 LIBCALC_STATIC=
829 LIBCUSTCALC_STATIC=
830 LD_STATIC=
832 CCWARN= -Wall -W -Wno-comment
833 CCWERR=
834 CCOPT= ${DEBUG}
835 CCMISC= -DNOTCYGWIN
837 LCC= gcc
838 CC= ${PURIFY} ${LCC} ${CCWERR}
840 endif
842 ###################################################
843 # default target - when no specific target exists #
844 ###################################################
846 # NOTE: This is the default generic host target. Used when no other
847 # host target matches.
849 ifeq ($(target),)
851 BLD_TYPE= calc-static-only
853 CC_SHARE= -fPIC
854 DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib
855 LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \
856 "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}"
857 LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}"
858 ifdef ALLOW_CUSTOM
859 LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}"
860 else
861 LIBCUSTCALC_SHLIB=
862 endif
864 CC_STATIC=
865 LIBCALC_STATIC=
866 LIBCUSTCALC_STATIC=
867 LD_STATIC=
869 CCWARN= -Wall -W -Wno-comment
870 CCWERR=
871 CCOPT= ${DEBUG}
872 CCMISC=
874 LCC= gcc
875 CC= ${PURIFY} ${LCC} ${CCWERR}
877 endif
879 ###########################################
880 # Set the default compile flags for ${CC} #
881 ###########################################
883 # Required flags to compile C files for calc
885 # ICFLAGS are given to ${CC} for intermediate progs used to help compile calc
886 # CFLAGS are given to ${CC} for calc progs other than intermediate progs
888 # NOTE: This does not work for: make-XYZ-only and BLD_TYPE != make-XYZ-only
890 ifeq ($(BLD_TYPE),calc-static-only)
891 ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC}
892 else
893 ICFLAGS= ${COMMON_CFLAGS} ${CC_SHARE}
894 endif
895 CFLAGS= ${ICFLAGS} ${CCOPT}
897 # Required flags to link files for calc
899 # ILDFLAGS for ${CC} in linking intermediate progs used to help compile calc
900 # LDFLAGS for ${CC} in linking calc progs other than intermediate progs
902 ILDFLAGS= ${COMMON_LDFLAGS}
903 LDFLAGS= ${LD_DEBUG} ${ILDFLAGS}
904 #endif /* end of skip for non-Gnu makefiles */
906 #######################################################################
907 #-=-=-=-=-=- end of target section - only make rules below -=-=-=-=-=-#
908 #######################################################################
909 # end of host target cut - Do not remove this line
910 ##############################################################################
911 #-=-=-=-=-=-=-=-=- Be careful if you change something below -=-=-=-=-=-=-=-=-#
912 ##############################################################################
914 # These .c files are required for the main custom interface and
915 # for the custom support functions for libcustcalc${LIB_EXT_VERSION}.
917 # There MUST be a .c for every .o in REQUIRED_OBJ.
919 REQUIRED_SRC= custtbl.c
921 # These .o files correspond to the .c files in REQUIRED_SRC
922 # for libcustcalc${LIB_EXT_VERSION}.
924 # There MUST be a .o for every .c in REQUIRED_SRC.
926 REQUIRED_OBJ= custtbl.o
928 # These .h files are installed under ${CUSTOMCALDIR} by the install rule.
930 INSTALL_H_SRC= ${CUSTOM_H_SRC}
932 # These .c files are used to form libcustcalc${LIB_EXT_VERSION}.
934 CUSTCALC_SRC= ${REQUIRED_SRC} ${CUSTOM_SRC}
936 # These .o files are used to form libcustcalc${LIB_EXT_VERSION}.
938 CUSTCALC_OBJ= ${REQUIRED_OBJ} ${CUSTOM_OBJ}
940 # These .c files are used to build the dependency list
942 C_SRC= ${REQUIRED_SRC} ${CUSTOM_SRC}
944 # These .h files are used to build the dependecy list
946 H_SRC= ${CUSTOM_H_SRC}
948 # These files are found (but not built) in the distribution
950 # The CUSTOM_CAL and HOW_TO_ADD are files distributed from this
951 # directory but are installed as help files from the help/Makefile.
953 DISTLIST= ${CUSTCALC_SRC} ${CUSTOM_CALC_FILES} ${CUSTOM_HELP} \
954 ${INSTALL_H_SRC} CUSTOM_CAL HOW_TO_ADD ${MAKE_FILE}.head \
955 ${MAKE_FILE}.tail
957 # These files are used to make (but not built) a calc .a link library
959 CALCLIBLIST= ${CUSTCALC_SRC} ${INSTALL_H_SRC} ${MAKE_FILE} HOW_TO_ADD
961 # This is the custom dynbamic shared library that is build
963 CALC_DYNAMIC_LIBCUSTCALC= libcustcalc${LIB_EXT_VERSION}
965 # This is the custom static library that is build
967 CALC_STATIC_LIBCUSTCALC= libcustcalc.a
969 # complete list of targets
971 TARGETS= ${BLD_TYPE} Makefile.simple
975 # The reason for this Makefile :-)
979 all: ${TARGETS} ${INSTALL_H_SRC} ${CUSTOM_CALC_FILES} \
980 ${CUSTOM_HELP} ${MAKE_FILE} .all
982 calc-dynamic-only: ${CUSTCALC_OBJ} ${CALC_DYNAMIC_LIBCUSTCALC}
984 calc-static-only: ${CUSTCALC_OBJ} ${CALC_STATIC_LIBCUSTCALC}
986 custom/libcustcalc${LIB_EXT_VERSION}: libcustcalc${LIB_EXT_VERSION} \
987 ${CALC_STATIC_LIBCUSTCALC}
989 libcustcalc${LIB_EXT_VERSION}: ${CUSTCALC_OBJ} ${MAKE_FILE}
990 ${CC} ${LIBCUSTCALC_SHLIB} ${CUSTCALC_OBJ} -o $@
994 # Special .o files
998 c_sysinfo.o: c_sysinfo.c ${MAKE_FILE}
999 ${CC} ${CFLAGS} c_sysinfo.c -c
1003 # used by the upper level Makefile
1007 # to determine of we have done all
1009 .all:
1010 ${RM} -f .all
1011 ${TOUCH} .all
1015 # building calc-static and static lib*.a libraires
1019 libcustcalc.a: ${CUSTCALC_OBJ} ${MAKE_FILE}
1020 ${RM} -f libcustcalc.a
1021 ${AR} qc libcustcalc.a ${CUSTCALC_OBJ}
1022 ${RANLIB} libcustcalc.a
1023 ${CHMOD} 0644 libcustcalc.a
1027 # File list generation. You can ignore this section.
1030 # We will form the names of source files as if they were in a
1031 # sub-directory called calc/lib.
1033 # NOTE: Due to bogus shells found on one common system we must have
1034 # an non-emoty else clause for every if condition. *sigh*
1038 distlist: ${DISTLIST}
1039 ${Q} for i in ${DISTLIST} /dev/null; do \
1040 if [ X"$$i" != X"/dev/null" ]; then \
1041 echo custom/$$i; \
1042 fi; \
1043 done
1045 distdir:
1046 ${Q} echo custom
1048 calcliblist: ${CALCLIBLIST}
1049 ${Q} for i in ${CALCLIBLIST} /dev/null; do \
1050 if [ X"$$i" != X"/dev/null" ]; then \
1051 echo custom/$$i; \
1052 fi; \
1053 done
1055 #if 0 /* start of skip for non-Gnu makefiles */
1056 Makefile.simple: ${MAKE_FILE}
1057 ${V} echo '=-=-=-=-= custom/${MAKE_FILE} start of $@ rule =-=-=-=-='
1058 ${Q} ${RM} -f $@
1059 ${Q} ${AWK} '/^#if 0/{skp=1} {if(!skp){print $$0}} /^#endif/{skp=0}' \
1060 ${MAKE_FILE} > $@
1061 ${Q} echo >> $@
1062 ${Q} echo 'Makefile.simple:' >> $@
1063 ${Q} echo ' $${Q} if [ ! -f Makefile.simple ]; then '"\\" >> $@
1064 ${Q} echo ' $${CP} -f $${MAKE_FILE} $$@; fi' >> $@
1065 ${V} echo '=-=-=-=-= custom/${MAKE_FILE} end of $@ rule =-=-=-=-='
1066 #endif /* end of skip for non-Gnu makefiles */
1070 # Home grown make dependency rules. Your system make not support
1071 # or have the needed tools. You can ignore this section.
1073 # We will form a skelaton tree of *.c files containing only #include "foo.h"
1074 # lines and .h files containing the same lines surrounded by multiple include
1075 # prevention lines. This allows us to build a static depend list that will
1076 # satisfy all possible cpp symbol definition combinations.
1080 depend:
1081 ${Q} if [ -f ${MAKE_FILE}.bak ]; then \
1082 echo "${MAKE_FILE}.bak exists, remove or move it"; \
1083 exit 1; \
1084 else \
1085 ${TRUE}; \
1087 ${Q} echo forming custom/skel
1088 ${Q} ${RM} -rf skel
1089 ${Q} ${MKDIR} skel
1090 ${Q} ${MKDIR} skel/custom
1091 -${Q} for i in ${C_SRC} /dev/null; do \
1092 if [ X"$$i" != X"/dev/null" ]; then \
1093 ${SED} -n '/^#[ ]*include[ ]*"/p' \
1094 "$$i" > "skel/custom/$$i"; \
1095 fi; \
1096 done
1097 -${Q} for i in ${H_SRC} /dev/null; do \
1098 if [ "$$i" = "/dev/null" ]; then \
1099 continue; \
1100 fi; \
1101 tag="`echo $$i | ${SED} 's/[\.+,:]/_/g'`"; \
1102 echo "#if !defined($$tag)" > "skel/custom/$$i"; \
1103 echo "#define $$tag" >> "skel/custom/$$i"; \
1104 ${SED} -n '/^#[ ]*include[ ]*"/p' "$$i" \
1105 >> "skel/custom/$$i"; \
1106 echo '#endif /* '"$$tag"' */' >> "skel/custom/$$i"; \
1107 done
1108 ${Q} (cd ..; ${MAKE} -f ${TOP_MAKE_FILE} hsrc)
1109 ${Q} for i in `cd ..; ${MAKE} -f ${TOP_MAKE_FILE} h_list 2>&1 | \
1110 ${SED} -e '/Entering directory/d' \
1111 -e '/Nothing to be done/d' \
1112 -e '/Leaving directory/d'` /dev/null; do \
1113 if [ "$$i" = "/dev/null" ]; then \
1114 continue; \
1115 fi; \
1116 tag="`echo $$i | ${SED} 's/[\.+,:]/_/g'`"; \
1117 echo "#if !defined($$tag)" > "skel/$$i"; \
1118 echo "#define $$tag" >> "skel/$$i"; \
1119 ${SED} -n '/^#[ ]*include[ ]*"/p' "../$$i" \
1120 >> "skel/$$i"; \
1121 echo '#endif /* '"$$tag"' */' >> "skel/$$i"; \
1122 done
1123 ${Q} ${RM} -f skel/custom/makedep.out
1124 ${Q} echo custom/skel formed
1125 ${Q} echo forming custom dependency list
1126 ${Q} :> skel/custom/makedep.out
1127 ${Q} cd skel/custom; ${MAKEDEPEND} -I.. -w 1 -f makedep.out ${C_SRC}
1128 -${Q} for i in ${C_SRC} /dev/null; do \
1129 if [ X"$$i" != X"/dev/null" ]; then \
1130 echo "$$i" | ${SED} 's/^\(.*\)\.c/\1.o: \1.c/'; \
1131 fi; \
1132 done >> skel/custom/makedep.out
1133 ${Q} LANG=C ${SORT} -u skel/custom/makedep.out \
1134 -o skel/custom/makedep.out
1135 ${Q} echo custom dependency list formed
1136 ${Q} echo forming new custom/${MAKE_FILE}
1137 ${Q} ${RM} -f ${MAKE_FILE}.bak
1138 ${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
1139 ${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' \
1140 ${MAKE_FILE}.bak > ${MAKE_FILE}
1141 ${Q} ${GREP} -v '^#' skel/custom/makedep.out >> ${MAKE_FILE}
1142 ${Q} ${RM} -rf skel
1143 -${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \
1144 echo 'custom ${MAKE_FILE} was already up to date'; \
1145 ${MV} -f ${MAKE_FILE}.bak ${MAKE_FILE}; \
1146 else \
1147 ${RM} -f ${MAKE_FILE}.tmp; \
1148 ${MV} ${MAKE_FILE} ${MAKE_FILE}.tmp; \
1149 if [ -d RCS -a ! -w "${MAKE_FILE}" ]; then \
1150 ${CO} -l ${MAKE_FILE}; \
1151 fi ;\
1152 ${MV} ${MAKE_FILE}.tmp ${MAKE_FILE}; \
1153 if [ -d RCS ]; then \
1154 echo '****************************************************'; \
1155 echo 'new custom ${MAKE_FILE} formed -- you to check it in'; \
1156 echo '****************************************************'; \
1157 fi; \
1162 # rpm rules
1166 echo_inst_files:
1167 ${Q} for i in ${INSTALL_H_SRC} /dev/null; do \
1168 if [ X"$$i" != X"/dev/null" ]; then \
1169 echo __file__ ${CUSTOMINCDIR}/$$i; \
1170 fi; \
1171 done
1172 ${Q} for i in ${CUSTOM_HELP} /dev/null; do \
1173 if [ X"$$i" != X"/dev/null" ]; then \
1174 echo __file__ ${CUSTOMHELPDIR}/$$i; \
1175 fi; \
1176 done
1177 ${Q} for i in ${CUSTOM_CALC_FILES} /dev/null; do \
1178 if [ X"$$i" != X"/dev/null" ]; then \
1179 echo __file__ ${CUSTOMCALDIR}/$$i; \
1180 fi; \
1181 done
1182 ${Q} for i in ${CALC_DYNAMIC_LIBCUSTCALC} /dev/null; do \
1183 if [ X"$$i" != X"/dev/null" ]; then \
1184 echo __file__ ${CUSTOMCALDIR}/$$i; \
1185 fi; \
1186 done
1190 # Utility rules
1194 clean:
1195 ${RM} -f ${CUSTCALC_OBJ}
1197 clobber: clean
1198 ${RM} -f ${BLD_TYPE}
1199 ${RM} -f .all ${MAKE_FILE}.tmp ${MAKE_FILE}.bak
1200 ${RM} -f libcustcalc${LIB_EXT_VERSION}
1201 ${RM} -f libcustcalc${LIB_EXT_VERS}
1202 ${RM} -f libcustcalc${LIB_EXT_VER}
1203 ${RM} -f libcustcalc${LIB_EXT_VE}
1204 ${RM} -f libcustcalc${LIB_EXT}
1205 ${RM} -f libcustcalc.a
1206 #if 0 /* start of skip for non-Gnu makefiles */
1207 ${RM} -f Makefile.simple
1208 #endif /* end of skip for non-Gnu makefiles */
1210 # install everything
1212 # NOTE: Keep the uninstall rule in reverse order to the install rule
1214 install: all
1215 -${Q} if [ ! -d ${T}${INCDIR} ]; then \
1216 echo ${MKDIR} ${T}${INCDIR}; \
1217 ${MKDIR} ${T}${INCDIR}; \
1218 if [ ! -d "${T}${INCDIR}" ]; then \
1219 echo ${MKDIR} -p "${T}${INCDIR}"; \
1220 ${MKDIR} -p "${T}${INCDIR}"; \
1221 fi; \
1222 echo ${CHMOD} 0755 ${T}${INCDIR}; \
1223 ${CHMOD} 0755 ${T}${INCDIR}; \
1224 else \
1225 ${TRUE}; \
1227 -${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \
1228 echo ${MKDIR} ${T}${CALC_SHAREDIR}; \
1229 ${MKDIR} ${T}${CALC_SHAREDIR}; \
1230 if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \
1231 echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
1232 ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
1233 fi; \
1234 echo ${CHMOD} 0755 ${T}${CALC_SHAREDIR}; \
1235 ${CHMOD} 0755 ${T}${CALC_SHAREDIR}; \
1236 else \
1237 ${TRUE}; \
1239 -${Q} if [ ! -d ${T}${CALC_INCDIR} ]; then \
1240 echo ${MKDIR} ${T}${CALC_INCDIR}; \
1241 ${MKDIR} ${T}${CALC_INCDIR}; \
1242 if [ ! -d "${T}${CALC_INCDIR}" ]; then \
1243 echo ${MKDIR} -p "${T}${CALC_INCDIR}"; \
1244 ${MKDIR} -p "${T}${CALC_INCDIR}"; \
1245 fi; \
1246 echo ${CHMOD} 0755 ${T}${CALC_INCDIR}; \
1247 ${CHMOD} 0755 ${T}${CALC_INCDIR}; \
1248 else \
1249 ${TRUE}; \
1251 -${Q} if [ ! -d ${T}${HELPDIR} ]; then \
1252 echo ${MKDIR} ${T}${HELPDIR}; \
1253 ${MKDIR} ${T}${HELPDIR}; \
1254 if [ ! -d "${T}${HELPDIR}" ]; then \
1255 echo ${MKDIR} -p "${T}${HELPDIR}"; \
1256 ${MKDIR} -p "${T}${HELPDIR}"; \
1257 fi; \
1258 echo ${CHMOD} 0755 ${T}${HELPDIR}; \
1259 ${CHMOD} 0755 ${T}${HELPDIR}; \
1260 else \
1261 ${TRUE}; \
1263 -${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \
1264 echo ${MKDIR} ${T}${CUSTOMCALDIR}; \
1265 ${MKDIR} ${T}${CUSTOMCALDIR}; \
1266 if [ ! -d "${T}${CUSTOMCALDIR}" ]; then \
1267 echo ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \
1268 ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \
1269 fi; \
1270 echo ${CHMOD} 0755 ${T}${CUSTOMCALDIR}; \
1271 ${CHMOD} 0755 ${T}${CUSTOMCALDIR}; \
1272 else \
1273 ${TRUE}; \
1275 -${Q} if [ ! -d ${T}${CUSTOMHELPDIR} ]; then \
1276 echo ${MKDIR} ${T}${CUSTOMHELPDIR}; \
1277 ${MKDIR} ${T}${CUSTOMHELPDIR}; \
1278 if [ ! -d "${T}${CUSTOMHELPDIR}" ]; then \
1279 echo ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \
1280 ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \
1281 fi; \
1282 echo ${CHMOD} 0755 ${T}${CUSTOMHELPDIR}; \
1283 ${CHMOD} 0755 ${T}${CUSTOMHELPDIR}; \
1284 else \
1285 ${TRUE}; \
1287 -${Q} if [ ! -d ${T}${CUSTOMINCDIR} ]; then \
1288 echo ${MKDIR} ${T}${CUSTOMINCDIR}; \
1289 ${MKDIR} ${T}${CUSTOMINCDIR}; \
1290 if [ ! -d "${T}${CUSTOMINCDIR}" ]; then \
1291 echo ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \
1292 ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \
1293 fi; \
1294 echo ${CHMOD} 0755 ${T}${CUSTOMINCDIR}; \
1295 ${CHMOD} 0755 ${T}${CUSTOMINCDIR}; \
1296 else \
1297 ${TRUE}; \
1299 -${Q} for i in ${INSTALL_H_SRC} /dev/null; do \
1300 if [ "$$i" = "/dev/null" ]; then \
1301 continue; \
1302 fi; \
1303 if ${CMP} -s "$$i" ${T}${CUSTOMINCDIR}/$$i; then \
1304 ${TRUE}; \
1305 else \
1306 ${RM} -f ${T}${CUSTOMINCDIR}/$$i.new; \
1307 ${CP} -f $$i ${T}${CUSTOMINCDIR}/$$i.new; \
1308 ${CHMOD} 0444 ${T}${CUSTOMINCDIR}/$$i.new; \
1309 ${MV} -f ${T}${CUSTOMINCDIR}/$$i.new ${T}${CUSTOMINCDIR}/$$i; \
1310 echo "installed ${T}${CUSTOMINCDIR}/$$i"; \
1311 fi; \
1312 done
1313 -${Q} for i in ${CUSTOM_CALC_FILES} /dev/null; do \
1314 if [ "$$i" = "/dev/null" ]; then \
1315 continue; \
1316 fi; \
1317 if ${CMP} -s $$i ${T}${CUSTOMCALDIR}/$$i; then \
1318 ${TRUE}; \
1319 else \
1320 ${RM} -f ${T}${CUSTOMCALDIR}/$$i.new; \
1321 ${CP} -f $$i ${T}${CUSTOMCALDIR}/$$i.new; \
1322 ${CHMOD} 0444 ${T}${CUSTOMCALDIR}/$$i.new; \
1323 ${MV} -f ${T}${CUSTOMCALDIR}/$$i.new ${T}${CUSTOMCALDIR}/$$i; \
1324 echo "installed ${T}${CUSTOMCALDIR}/$$i"; \
1325 fi; \
1326 done
1327 -${Q} for i in ${CUSTOM_HELP} /dev/null; do \
1328 if [ "$$i" = "/dev/null" ]; then \
1329 continue; \
1330 fi; \
1331 if ${CMP} -s $$i ${T}${CUSTOMHELPDIR}/$$i; then \
1332 ${TRUE}; \
1333 else \
1334 ${RM} -f ${T}${CUSTOMHELPDIR}/$$i.new; \
1335 ${CP} -f $$i ${T}${CUSTOMHELPDIR}/$$i.new; \
1336 ${CHMOD} 0444 ${T}${CUSTOMHELPDIR}/$$i.new; \
1337 ${MV} -f ${T}${CUSTOMHELPDIR}/$$i.new \
1338 ${T}${CUSTOMHELPDIR}/$$i; \
1339 echo "installed ${T}${CUSTOMHELPDIR}/$$i"; \
1340 fi; \
1341 done
1342 -${Q} if [ -f "${T}${CUSTOMCALDIR}/libcustcalc.a" ]; then \
1343 ${RM} -f ${T}${CUSTOMCALDIR}/libcustcalc.a; \
1344 echo "removed old ${T}${CUSTOMCALDIR}/libcustcalc.a"; \
1346 -${Q} if [ ! -z ${ALLOW_CUSTOM} ]; then \
1347 if [ -f libcustcalc.a ]; then \
1348 if ${CMP} -s libcustcalc.a ${T}${LIBDIR}/libcustcalc.a; then \
1349 ${TRUE}; \
1350 else \
1351 ${RM} -f ${T}${LIBDIR}/libcustcalc.a.new; \
1352 ${CP} -f libcustcalc.a ${T}${LIBDIR}/libcustcalc.a.new; \
1353 ${CHMOD} 0644 ${T}${LIBDIR}/libcustcalc.a.new; \
1354 ${MV} -f ${T}${LIBDIR}/libcustcalc.a.new \
1355 ${T}${LIBDIR}/libcustcalc.a; \
1356 ${RANLIB} ${T}${LIBDIR}/libcustcalc.a; \
1357 echo "installed ${T}${LIBDIR}/libcustcalc.a"; \
1358 fi; \
1359 fi; \
1361 ${Q}# NOTE: The upper level makefile installs the file
1362 ${Q}# libcustcalc${LIB_EXT_VERSION} because we only want to
1363 ${Q}# perform one ${LDCONFIG} for both libcalc${LIB_EXT_VERSION}
1364 ${Q}# and libcustcalc${LIB_EXT_VERSION}.
1366 # Try to remove everything that was installed
1368 # NOTE: Keep the uninstall rule in reverse order to the install rule
1370 uninstall:
1371 -${Q} if [ -f "${T}${CUSTOMCALDIR}/libcustcalc.a" ]; then \
1372 ${RM} -f "${T}${CUSTOMCALDIR}/libcustcalc.a"; \
1373 if [ -f "${T}${CUSTOMCALDIR}/libcustcalc.a" ]; then \
1374 echo "cannot uninstall ${T}${CUSTOMCALDIR}/libcustcalc.a"; \
1375 else \
1376 echo "uninstalled ${T}${CUSTOMCALDIR}/libcustcalc.a"; \
1377 fi; \
1379 -${Q} for i in ${CUSTOM_HELP} /dev/null; do \
1380 if [ "$$i" = "/dev/null" ]; then \
1381 continue; \
1382 fi; \
1383 if [ -f "${T}${CUSTOMHELPDIR}/$$i" ]; then \
1384 ${RM} -f "${T}${CUSTOMHELPDIR}/$$i"; \
1385 if [ -f "${T}${CUSTOMHELPDIR}/$$i" ]; then \
1386 echo "cannot uninstall ${T}${CUSTOMHELPDIR}/$$i"; \
1387 else \
1388 echo "uninstalled ${T}${CUSTOMHELPDIR}/$$i"; \
1389 fi; \
1390 fi; \
1391 done
1392 -${Q} for i in ${CUSTOM_CALC_FILES} /dev/null; do \
1393 if [ "$$i" = "/dev/null" ]; then \
1394 continue; \
1395 fi; \
1396 if [ -f "${T}${CUSTOMCALDIR}/$$i" ]; then \
1397 ${RM} -f "${T}${CUSTOMCALDIR}/$$i"; \
1398 if [ -f "${T}${CUSTOMCALDIR}/$$i" ]; then \
1399 echo "cannot uninstall ${T}${CUSTOMCALDIR}/$$i"; \
1400 else \
1401 echo "uninstalled ${T}${CUSTOMCALDIR}/$$i"; \
1402 fi; \
1403 fi; \
1404 done
1405 -${Q} for i in ${INSTALL_H_SRC} /dev/null; do \
1406 if [ "$$i" = "/dev/null" ]; then \
1407 continue; \
1408 fi; \
1409 if [ -f "${T}${CUSTOMINCDIR}/$$i" ]; then \
1410 ${RM} -f "${T}${CUSTOMINCDIR}/$$i"; \
1411 if [ -f "${T}${CUSTOMINCDIR}/$$i" ]; then \
1412 echo "cannot uninstall ${T}${CUSTOMINCDIR}/$$i"; \
1413 else \
1414 echo "uninstalled ${T}${CUSTOMINCDIR}/$$i"; \
1415 fi; \
1416 fi; \
1417 done
1418 -${Q} for i in ${CUSTOMINCDIR} ${CUSTOMHELPDIR} ${CUSTOMCALDIR} \
1419 ${HELPDIR} ${CALC_INCDIR} ${CALC_SHAREDIR} ${INCDIR}; do \
1420 if [ -d "${T}$$i" ]; then \
1421 ${RMDIR} "${T}$$i" 2>/dev/null; \
1422 echo "cleaned up ${T}$$i"; \
1423 fi; \
1424 done
1428 # make depend stuff
1432 # DO NOT DELETE THIS LINE -- make depend depends on it.
1434 c_argv.o: ../alloc.h
1435 c_argv.o: ../block.h
1436 c_argv.o: ../byteswap.h
1437 c_argv.o: ../calc.h
1438 c_argv.o: ../calcerr.h
1439 c_argv.o: ../cmath.h
1440 c_argv.o: ../config.h
1441 c_argv.o: ../custom.h
1442 c_argv.o: ../decl.h
1443 c_argv.o: ../endian_calc.h
1444 c_argv.o: ../hash.h
1445 c_argv.o: ../have_const.h
1446 c_argv.o: ../have_memmv.h
1447 c_argv.o: ../have_newstr.h
1448 c_argv.o: ../have_stdlib.h
1449 c_argv.o: ../have_string.h
1450 c_argv.o: ../have_unused.h
1451 c_argv.o: ../longbits.h
1452 c_argv.o: ../nametype.h
1453 c_argv.o: ../qmath.h
1454 c_argv.o: ../sha1.h
1455 c_argv.o: ../str.h
1456 c_argv.o: ../value.h
1457 c_argv.o: ../zmath.h
1458 c_argv.o: c_argv.c
1459 c_devnull.o: ../alloc.h
1460 c_devnull.o: ../block.h
1461 c_devnull.o: ../byteswap.h
1462 c_devnull.o: ../calcerr.h
1463 c_devnull.o: ../cmath.h
1464 c_devnull.o: ../config.h
1465 c_devnull.o: ../custom.h
1466 c_devnull.o: ../decl.h
1467 c_devnull.o: ../endian_calc.h
1468 c_devnull.o: ../hash.h
1469 c_devnull.o: ../have_const.h
1470 c_devnull.o: ../have_memmv.h
1471 c_devnull.o: ../have_newstr.h
1472 c_devnull.o: ../have_stdlib.h
1473 c_devnull.o: ../have_string.h
1474 c_devnull.o: ../have_unistd.h
1475 c_devnull.o: ../have_unused.h
1476 c_devnull.o: ../longbits.h
1477 c_devnull.o: ../nametype.h
1478 c_devnull.o: ../qmath.h
1479 c_devnull.o: ../sha1.h
1480 c_devnull.o: ../str.h
1481 c_devnull.o: ../value.h
1482 c_devnull.o: ../zmath.h
1483 c_devnull.o: c_devnull.c
1484 c_help.o: ../alloc.h
1485 c_help.o: ../block.h
1486 c_help.o: ../byteswap.h
1487 c_help.o: ../calcerr.h
1488 c_help.o: ../cmath.h
1489 c_help.o: ../config.h
1490 c_help.o: ../custom.h
1491 c_help.o: ../decl.h
1492 c_help.o: ../endian_calc.h
1493 c_help.o: ../hash.h
1494 c_help.o: ../have_const.h
1495 c_help.o: ../have_memmv.h
1496 c_help.o: ../have_newstr.h
1497 c_help.o: ../have_stdlib.h
1498 c_help.o: ../have_string.h
1499 c_help.o: ../have_unistd.h
1500 c_help.o: ../have_unused.h
1501 c_help.o: ../longbits.h
1502 c_help.o: ../nametype.h
1503 c_help.o: ../qmath.h
1504 c_help.o: ../sha1.h
1505 c_help.o: ../str.h
1506 c_help.o: ../value.h
1507 c_help.o: ../zmath.h
1508 c_help.o: c_help.c
1509 c_pmodm127.o: ../alloc.h
1510 c_pmodm127.o: ../block.h
1511 c_pmodm127.o: ../byteswap.h
1512 c_pmodm127.o: ../calcerr.h
1513 c_pmodm127.o: ../cmath.h
1514 c_pmodm127.o: ../config.h
1515 c_pmodm127.o: ../custom.h
1516 c_pmodm127.o: ../decl.h
1517 c_pmodm127.o: ../endian_calc.h
1518 c_pmodm127.o: ../hash.h
1519 c_pmodm127.o: ../have_const.h
1520 c_pmodm127.o: ../have_memmv.h
1521 c_pmodm127.o: ../have_newstr.h
1522 c_pmodm127.o: ../have_stdlib.h
1523 c_pmodm127.o: ../have_string.h
1524 c_pmodm127.o: ../have_unused.h
1525 c_pmodm127.o: ../longbits.h
1526 c_pmodm127.o: ../nametype.h
1527 c_pmodm127.o: ../qmath.h
1528 c_pmodm127.o: ../sha1.h
1529 c_pmodm127.o: ../str.h
1530 c_pmodm127.o: ../value.h
1531 c_pmodm127.o: ../zmath.h
1532 c_pmodm127.o: c_pmodm127.c
1533 c_pzasusb8.o: ../alloc.h
1534 c_pzasusb8.o: ../block.h
1535 c_pzasusb8.o: ../byteswap.h
1536 c_pzasusb8.o: ../calcerr.h
1537 c_pzasusb8.o: ../cmath.h
1538 c_pzasusb8.o: ../config.h
1539 c_pzasusb8.o: ../custom.h
1540 c_pzasusb8.o: ../decl.h
1541 c_pzasusb8.o: ../endian_calc.h
1542 c_pzasusb8.o: ../hash.h
1543 c_pzasusb8.o: ../have_const.h
1544 c_pzasusb8.o: ../have_memmv.h
1545 c_pzasusb8.o: ../have_newstr.h
1546 c_pzasusb8.o: ../have_stdlib.h
1547 c_pzasusb8.o: ../have_string.h
1548 c_pzasusb8.o: ../have_unused.h
1549 c_pzasusb8.o: ../longbits.h
1550 c_pzasusb8.o: ../nametype.h
1551 c_pzasusb8.o: ../qmath.h
1552 c_pzasusb8.o: ../sha1.h
1553 c_pzasusb8.o: ../str.h
1554 c_pzasusb8.o: ../value.h
1555 c_pzasusb8.o: ../zmath.h
1556 c_pzasusb8.o: c_pzasusb8.c
1557 c_register.o: ../alloc.h
1558 c_register.o: ../block.h
1559 c_register.o: ../byteswap.h
1560 c_register.o: ../calc.h
1561 c_register.o: ../calcerr.h
1562 c_register.o: ../cmath.h
1563 c_register.o: ../config.h
1564 c_register.o: ../custom.h
1565 c_register.o: ../decl.h
1566 c_register.o: ../endian_calc.h
1567 c_register.o: ../hash.h
1568 c_register.o: ../have_const.h
1569 c_register.o: ../have_memmv.h
1570 c_register.o: ../have_newstr.h
1571 c_register.o: ../have_stdlib.h
1572 c_register.o: ../have_string.h
1573 c_register.o: ../have_unused.h
1574 c_register.o: ../longbits.h
1575 c_register.o: ../nametype.h
1576 c_register.o: ../qmath.h
1577 c_register.o: ../sha1.h
1578 c_register.o: ../str.h
1579 c_register.o: ../value.h
1580 c_register.o: ../zmath.h
1581 c_register.o: c_register.c
1582 c_sysinfo.o: ../alloc.h
1583 c_sysinfo.o: ../block.h
1584 c_sysinfo.o: ../byteswap.h
1585 c_sysinfo.o: ../calc.h
1586 c_sysinfo.o: ../calcerr.h
1587 c_sysinfo.o: ../cmath.h
1588 c_sysinfo.o: ../conf.h
1589 c_sysinfo.o: ../config.h
1590 c_sysinfo.o: ../custom.h
1591 c_sysinfo.o: ../decl.h
1592 c_sysinfo.o: ../endian_calc.h
1593 c_sysinfo.o: ../fposval.h
1594 c_sysinfo.o: ../hash.h
1595 c_sysinfo.o: ../have_const.h
1596 c_sysinfo.o: ../have_memmv.h
1597 c_sysinfo.o: ../have_newstr.h
1598 c_sysinfo.o: ../have_stdlib.h
1599 c_sysinfo.o: ../have_string.h
1600 c_sysinfo.o: ../have_unused.h
1601 c_sysinfo.o: ../hist.h
1602 c_sysinfo.o: ../lib_calc.h
1603 c_sysinfo.o: ../longbits.h
1604 c_sysinfo.o: ../nametype.h
1605 c_sysinfo.o: ../prime.h
1606 c_sysinfo.o: ../qmath.h
1607 c_sysinfo.o: ../sha1.h
1608 c_sysinfo.o: ../str.h
1609 c_sysinfo.o: ../value.h
1610 c_sysinfo.o: ../zmath.h
1611 c_sysinfo.o: ../zrand.h
1612 c_sysinfo.o: ../zrandom.h
1613 c_sysinfo.o: c_sysinfo.c
1614 custtbl.o: ../alloc.h
1615 custtbl.o: ../block.h
1616 custtbl.o: ../byteswap.h
1617 custtbl.o: ../calcerr.h
1618 custtbl.o: ../cmath.h
1619 custtbl.o: ../config.h
1620 custtbl.o: ../custom.h
1621 custtbl.o: ../decl.h
1622 custtbl.o: ../endian_calc.h
1623 custtbl.o: ../hash.h
1624 custtbl.o: ../have_const.h
1625 custtbl.o: ../have_memmv.h
1626 custtbl.o: ../have_newstr.h
1627 custtbl.o: ../have_stdlib.h
1628 custtbl.o: ../have_string.h
1629 custtbl.o: ../longbits.h
1630 custtbl.o: ../nametype.h
1631 custtbl.o: ../qmath.h
1632 custtbl.o: ../sha1.h
1633 custtbl.o: ../str.h
1634 custtbl.o: ../value.h
1635 custtbl.o: ../zmath.h
1636 custtbl.o: custtbl.c