modified: diffout.py
[GalaxyCodeBases.git] / c_cpp / etc / calc / help / Makefile
blobb9ea207531188672621a19701c0c3974aef410a0
1 #!/bin/make
3 # help - makefile for calc help files
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.5 $
22 # @(#) $Id: Makefile,v 30.5 2007/09/21 01:27:27 chongo Exp $
23 # @(#) $Source: /usr/local/src/cmd/calc/help/RCS/Makefile,v $
25 # Under source code control: 1991/07/23 06:47:57
26 # File existed as early as: 1991
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 # required vars
36 SHELL= /bin/sh
38 ####
39 # Normally, the upper level makefile will set these values. We provide
40 # a default here just in case you want to build from this directory.
41 ####
43 # Normally certain files depend on the Makefile. If the Makefile is
44 # changed, then certain steps should be redone. If MAKE_FILE is
45 # set to Makefile, then these files will depend on Makefile. If
46 # MAKE_FILE is empty, then they wont.
48 # If in doubt, set MAKE_FILE to Makefile
50 MAKE_FILE= Makefile
52 # Controlling file makefile basename (without the path)
54 # This is the basename same of the makefile that may/does/will drive
55 # this makefile.
57 # If in doubt, set TOP_MAKE_FILE to Makefile
59 TOP_MAKE_FILE= Makefile
61 # Where the system include (.h) files are kept
63 # For DJGPP, select:
65 # INCDIR= /dev/env/DJDIR/include
67 # If in doubt, set:
69 # INCDIR= /usr/include
72 #INCDIR= /usr/local/include
73 #INCDIR= /dev/env/DJDIR/include
74 INCDIR= /usr/include
76 # where to install calc realted things
78 # ${BINDIR} where to install calc binary files
79 # ${LIBDIR} where calc link library (*.a) files are installed
80 # ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files
82 # NOTE: The install rule prepends installation paths with ${T}, which
83 # by default is empty. If ${T} is non-empty, then installation
84 # locations will be relative to the ${T} directory.
86 # For DJGPP, select:
88 # BINDIR= /dev/env/DJDIR/bin
89 # LIBDIR= /dev/env/DJDIR/lib
90 # CALC_SHAREDIR= /dev/env/DJDIR/share/calc
92 # If in doubt, set:
94 # BINDIR= /usr/bin
95 # LIBDIR= /usr/lib
96 # CALC_SHAREDIR= /usr/share/calc
98 #BINDIR= /usr/local/bin
99 #BINDIR= /dev/env/DJDIR/bin
100 BINDIR= /usr/bin
102 #LIBDIR= /usr/local/lib
103 #LIBDIR= /dev/env/DJDIR/lib
104 LIBDIR= /usr/lib
106 #CALC_SHAREDIR= /usr/local/lib/calc
107 #CALC_SHAREDIR= /dev/env/DJDIR/share/calc
108 CALC_SHAREDIR= /usr/share/calc
110 # By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR
111 # ---------------------------------------------------------------
112 # ${HELPDIR} where the help directory is installed
113 # ${CALC_INCDIR} where the calc include files are installed
114 # ${SCRIPTDIR} where calc shell scripts are installed
116 # NOTE: The install rule prepends installation paths with ${T}, which
117 # by default is empty. If ${T} is non-empty, then installation
118 # locations will be relative to the ${T} directory.
120 # If in doubt, set:
122 # HELPDIR= ${CALC_SHAREDIR}/help
123 # CALC_INCDIR= ${INCDIR}/calc
124 # SCRIPTDIR= ${BINDIR}/cscript
126 HELPDIR= ${CALC_SHAREDIR}/help
127 CALC_INCDIR= ${INCDIR}/calc
128 SCRIPTDIR= ${BINDIR}/cscript
130 # T - top level directory under which calc will be installed
132 # The calc install is performed under ${T}, the calc build is
133 # performed under /. The purpose for ${T} is to allow someone
134 # to install calc somewhere other than into the system area.
136 # For example, if:
138 # BINDIR= /usr/bin
139 # LIBDIR= /usr/lib
140 # CALC_SHAREDIR= /usr/share/calc
142 # and if:
144 # T= /var/tmp/testing
146 # Then the installation locations will be:
148 # calc binary files: /var/tmp/testing/usr/bin
149 # calc link library: /var/tmp/testing/usr/lib
150 # calc help, .cal ...: /var/tmp/testing/usr/share/calc
151 # ... etc ... /var/tmp/testing/...
153 # If ${T} is empty, calc is installed under /, which is the same
154 # top of tree for which it was built. If ${T} is non-empty, then
155 # calc is installed under ${T}, as if one had to chroot under
156 # ${T} for calc to operate.
158 # If in doubt, use T=
162 # Makefile debug
164 # Q=@ do not echo internal makefile actions (quiet mode)
165 # Q= echo internal makefile actions (debug / verbose mode)
170 # standard tools
172 LCC= cc
173 ICFLAGS=
174 ILDFLAGS=
175 CHMOD= chmod
176 SED= sed
177 SORT= sort
178 FMT= fmt
179 CMP= cmp
180 CP= cp
181 MV= mv
182 TRUE= true
183 RM= rm
184 MKDIR= mkdir
185 RMDIR= rmdir
186 TOUCH= touch
187 CAT= cat
189 # Some out of date operating systems require / want an executable to
190 # end with a certain file extension. Some compile systems such as
191 # Cygwin build calc as calc.exe. The EXT variable is used to denote
192 # the extension required by such.
194 # EXT= # normal Un*x / Linux / GNU/Linux systems
195 # EXT=.exe # windoz / Cygwin
197 # If in doubt, use EXT=
199 EXT=
200 #EXT=.exe
202 # Standard and Builtin help files
204 STD_HELP_FILES_1= intro overview help
205 STD_HELP_FILES_2= assoc
207 BLT_HELP_FILES_3= builtin
209 STD_HELP_FILES_4= command config custom define environment expression
211 BLT_HELP_FILES_5= errorcodes
213 STD_HELP_FILES_6= file history interrupt list mat
215 # beacuse obj is built special (due to confusion with it as
216 # a symlink for some built environments, we treat obj specially
217 # and call it obj.file
219 SPECIAL_HELP_7= obj.file
221 STD_HELP_FILES_8= operator statement
223 BLT_HELP_FILES_9= resource
225 STD_HELP_FILES_10= types script
227 BLT_HELP_FILES_10a= usage cscript
229 STD_HELP_FILES_10b= unexpected variable
231 BLT_HELP_FILES_11= bindings custom_cal libcalc new_custom resource
233 STD_HELP_FILES_12= archive
235 BLT_HELP_FILES_13= bugs changes
237 STD_HELP_FILES_14= contrib credit
239 BLT_HELP_FILES_14= COPYING COPYING-LGPL
241 STD_HELP_FILES_15= wishlist todo
243 # These files are used in the following order to construct full
245 FULL_HELP_FILES= ${STD_HELP_FILES_1} ${STD_HELP_FILES_2} \
246 ${BLT_HELP_FILES_3} ${STD_HELP_FILES_4} \
247 ${BLT_HELP_FILES_5} ${STD_HELP_FILES_6} \
248 ${SPECIAL_HELP_7} ${STD_HELP_FILES_8} \
249 ${BLT_HELP_FILES_9} ${STD_HELP_FILES_10} \
250 ${BLT_HELP_FILES_10a} ${STD_HELP_FILES_10b} \
251 ${BLT_HELP_FILES_11} ${STD_HELP_FILES_12} \
252 ${BLT_HELP_FILES_13} ${STD_HELP_FILES_14} \
253 ${BLT_HELP_FILES_14} ${STD_HELP_FILES_15}
255 # These full files are those who are not built or constrcuted
257 STD_HELP_FILES= ${STD_HELP_FILES_1} ${STD_HELP_FILES_2} \
258 ${STD_HELP_FILES_4} ${STD_HELP_FILES_6} \
259 ${STD_HELP_FILES_8} ${STD_HELP_FILES_10} \
260 ${STD_HELP_FILES_10b} \
261 ${STD_HELP_FILES_12} ${STD_HELP_FILES_14} \
262 ${STD_HELP_FILES_15}
264 # These full files are those who are built by this Makefile
266 # Note that ${SPECIAL_HELP_7} is not included in this list
267 # because of problems with its name.
269 BLT_HELP_FILES= ${BLT_HELP_FILES_3} ${BLT_HELP_FILES_5} \
270 ${BLT_HELP_FILES_9} \
271 ${BLT_HELP_FILES_10a} \
272 ${BLT_HELP_FILES_11} ${BLT_HELP_FILES_13} \
273 ${BLT_HELP_FILES_14}
275 # This list is prodiced by the detaillist rule when no WARNINGS are detected.
277 # Please use:
279 # make detaillist
281 # to keep this list in nice sorted order and to check that these
282 # non-special help files are under RCS control.
284 DETAIL_HELP= abs access acos acosh acot acoth acsc acsch address agd append \
285 appr arg argv arrow asec asech asin asinh assign atan atan2 atanh \
286 avg base base2 bernoulli bit blk blkcpy blkfree blocks bround btrunc \
287 calc_tty calclevel calcpath catalan ceil cfappr cfsim char cmdbuf \
288 cmp comb conj cos cosh cot coth count cp csc csch ctime delete den \
289 dereference det digit digits display dp epsilon errcount errmax \
290 errno error estr euler eval exp fact factor fclose fcnt feof ferror \
291 fflush fgetc fgetfield fgetfile fgetline fgets fgetstr fib files \
292 floor fopen forall fpathopen fprintf fputc fputs fputstr frac free \
293 freebernoulli freeeuler freeglobals freeredc freestatics frem freopen \
294 fscan fscanf fseek fsize ftell gcd gcdrem gd getenv hash head highbit \
295 hmean hnrmod hypot ilog ilog10 ilog2 im indices inputlevel insert int \
296 inverse iroot isassoc isatty isblk isconfig isdefined iserror iseven \
297 isfile ishash isident isint islist ismat ismult isnull isnum isobj \
298 isobjtype isodd isprime isptr isqrt isrand israndom isreal isrel \
299 issimple issq isstr istype jacobi join lcm lcmfact lfactor ln log \
300 lowbit ltol makelist matdim matfill matmax matmin matsum mattrace \
301 mattrans max memsize meq min minv mmin mne mod modify name near \
302 newerror nextcand nextprime norm null num oldvalue ord param perm \
303 pfact pi pix places pmod polar poly pop popcnt pound power prevcand \
304 prevprime printf prompt protect ptest push putenv quo quomod rand \
305 randbit random randombit randperm rcin rcmul rcout rcpow rcsq re \
306 remove reverse rewind rm root round rsearch runtime saveval scale \
307 scan scanf search sec sech seed segment select sgn sha1 sin \
308 sinh size sizeof sleep sort sqrt srand srandom ssq stoponerror \
309 str strcat strcmp strcpy strerror strlen strncmp strncpy strpos \
310 strprintf strscan strscanf substr sum swap system systime tail tan \
311 tanh test time trunc usertime version xor
313 # This list is of files that are clones of DETAIL_HELP files. They are
314 # built from DETAIL_HELP files.
316 DETAIL_CLONE= copy
318 # Singular files
320 # These files are copies of their plural form.
322 PLURAL_FILES= bindings bugs changes errorcodes types
323 SINGULAR_FILES= binding bug change errorcode type
325 # These files are found (but not built) in the distribution
327 DISTLIST= ${STD_HELP_FILES} ${DETAIL_HELP} ${MAKE_FILE} \
328 obj.file builtin.top builtin.end funclist.sed \
329 errorcodes.hdr errorcodes.sed
331 # These files are used to make (but not built) a calc .a link library
333 CALCLIBLIST=
335 all: ${FULL_HELP_FILES} full ${DETAIL_HELP} ${DETAIL_CLONE} \
336 ${SINGULAR_FILES} .all
338 # used by the upper level Makefile to determine of we have done all
340 # NOTE: Due to bogus shells found on one common system we must have
341 # an non-emoty else clause for every if condition. *sigh*
343 .all:
344 ${RM} -f .all
345 ${TOUCH} .all
347 bindings: ../cal/bindings
348 ${RM} -f $@
349 ${CP} ../cal/bindings $@
350 ${CHMOD} 0444 $@
351 -@if [ -z "${Q}" ]; then \
352 echo ''; \
353 echo '=-=-= skipping the ${CAT} of help/$@ =-=-='; \
354 echo ''; \
355 else \
356 ${TRUE}; \
359 resource: ../cal/README
360 ${RM} -f $@
361 ${CP} ../cal/README $@
362 ${CHMOD} 0444 $@
363 -@if [ -z "${Q}" ]; then \
364 echo ''; \
365 echo '=-=-= skipping the ${CAT} of help/$@ =-=-='; \
366 echo ''; \
367 else \
368 ${TRUE}; \
371 changes: ../CHANGES
372 ${RM} -f $@
373 ${CP} ../CHANGES $@
374 ${CHMOD} 0444 $@
375 -@if [ -z "${Q}" ]; then \
376 echo ''; \
377 echo '=-=-= skipping the ${CAT} of help/$@ =-=-='; \
378 echo ''; \
379 else \
380 ${TRUE}; \
383 libcalc: ../LIBRARY
384 ${RM} -f $@
385 ${SED} -e 's:$${LIBDIR}:${LIBDIR}:g' \
386 -e 's:$${CALC_INCDIR}:${CALC_INCDIR}:g' < ../LIBRARY > $@
387 ${CHMOD} 0444 $@
388 -@if [ -z "${Q}" ]; then \
389 echo ''; \
390 echo '=-=-= skipping the ${CAT} of help/$@ =-=-='; \
391 echo ''; \
392 else \
393 ${TRUE}; \
396 bugs: ../BUGS
397 ${RM} -f $@
398 ${CP} ../BUGS $@
399 ${CHMOD} 0444 $@
400 -@if [ -z "${Q}" ]; then \
401 echo ''; \
402 echo '=-=-= skipping the ${CAT} of help/$@ =-=-='; \
403 echo ''; \
404 else \
405 ${TRUE}; \
408 errorcodes: ../calcerr.h errorcodes.hdr errorcodes.sed
409 ${RM} -f $@
410 ${CAT} errorcodes.hdr > $@
411 ${SED} -n -f errorcodes.sed < ../calcerr.h >> $@
412 ${CHMOD} 0444 $@
413 -@if [ -z "${Q}" ]; then \
414 echo ''; \
415 echo '=-=-= skipping the ${CAT} of help/$@ =-=-='; \
416 echo ''; \
417 else \
418 ${TRUE}; \
421 usage: ../calc.usage
422 ${RM} -f $@
423 ${CP} ../calc.usage $@
424 ${CHMOD} 0444 $@
425 -@if [ -z "${Q}" ]; then \
426 echo ''; \
427 echo '=-=-= skipping the ${CAT} of help/$@ =-=-='; \
428 echo ''; \
429 else \
430 ${TRUE}; \
433 ../calc.usage:
434 (cd ..; ${MAKE} -f ${TOP_MAKE_FILE} calc.usage)
436 custom_cal: ../custom/CUSTOM_CAL
437 ${RM} -f $@
438 ${CP} ../custom/CUSTOM_CAL $@
439 ${CHMOD} 0444 $@
440 -@if [ -z "${Q}" ]; then \
441 echo ''; \
442 echo '=-=-= skipping the ${CAT} of help/$@ =-=-='; \
443 echo ''; \
444 else \
445 ${TRUE}; \
448 new_custom: ../custom/HOW_TO_ADD
449 ${RM} -f $@
450 ${CP} ../custom/HOW_TO_ADD $@
451 ${CHMOD} 0444 $@
452 -@if [ -z "${Q}" ]; then \
453 echo ''; \
454 echo '=-=-= skipping the ${CAT} of help/$@ =-=-='; \
455 echo ''; \
456 else \
457 ${TRUE}; \
460 copy: blkcpy
461 ${RM} -f $@
462 ${CP} blkcpy $@
463 ${CHMOD} 0444 $@
464 -@if [ -z "${Q}" ]; then \
465 echo ''; \
466 echo '=-=-= skipping the ${CAT} of help/$@ =-=-='; \
467 echo ''; \
468 else \
469 ${TRUE}; \
472 COPYING: ../COPYING
473 ${RM} -f $@
474 ${CP} ../COPYING $@
475 ${CHMOD} 0444 $@
476 -@if [ -z "${Q}" ]; then \
477 echo ''; \
478 echo '=-=-= skipping the ${CAT} of help/$@ =-=-='; \
479 echo ''; \
480 else \
481 ${TRUE}; \
484 COPYING-LGPL: ../COPYING-LGPL
485 ${RM} -f $@
486 ${CP} ../COPYING-LGPL $@
487 ${CHMOD} 0444 $@
488 -@if [ -z "${Q}" ]; then \
489 echo ''; \
490 echo '=-=-= skipping the ${CAT} of help/$@ =-=-='; \
491 echo ''; \
492 else \
493 ${TRUE}; \
496 cscript: ../cscript/README
497 ${RM} -f $@
498 ${CP} ../cscript/README $@
499 ${CHMOD} 0444 $@
500 -@if [ -z "${Q}" ]; then \
501 echo ''; \
502 echo '=-=-= skipping the ${CAT} of help/$@ =-=-='; \
503 echo ''; \
504 else \
505 ${TRUE}; \
508 ../cscript/README: ../cscript/README.src
509 ${Q} echo "forming cscript/README"
510 ${Q} ${RM} -f $@
511 (cd ../cscript; ${MAKE} -f Makefile README)
513 full: ${FULL_HELP_FILES} ${MAKE_FILE}
514 ${Q} echo "forming full"
515 ${Q} ${RM} -f $@
516 -${Q} for i in ${FULL_HELP_FILES}; do \
517 if [ Xintro != X"$$i" ]; then \
518 echo "\f"; \
519 else \
520 ${TRUE}; \
521 fi; \
522 if [ Xobj.file = X"$$i" ]; then \
523 j=obj; \
524 else \
525 j=$$i; \
526 fi; \
527 echo "*************"; \
528 echo "* $$j"; \
529 echo "*************"; \
530 echo ""; \
531 ${CAT} $$i; \
532 done > $@
533 ${Q} echo "full formed"
534 -@if [ -z "${Q}" ]; then \
535 echo ''; \
536 echo '=-=-= skipping the ${CAT} of help/$@ =-=-='; \
537 echo ''; \
538 else \
539 ${TRUE}; \
542 # Singular files are the same files as their plural form.
544 ${SINGULAR_FILES}: ${PLURAL_FILES}
545 ${Q} for i in ${SINGULAR_FILES} /dev/null; do \
546 if [ X"$$i" != X"/dev/null" ]; then \
547 echo "${RM} -f $${i}"; \
548 ${RM} -f $${i}; \
549 echo "${CP} $${i}s $${i}"; \
550 ${CP} $${i}s $${i}; \
551 fi; \
552 done
553 -@if [ -z "${Q}" ]; then \
554 echo ''; \
555 echo '=-=-= skipping the ${CAT} of help/SINGULAR_FILES =-=-='; \
556 echo ''; \
557 else \
558 ${TRUE}; \
561 # Form the builtin file
563 # We ave a "chicken-and-egg" problem. We want the builtn help file to
564 # accurately reflect the function list. It would be nice if we could
565 # just execute calc show builtin, but calc may not have been built or
566 # buildable at this point. The hack-a-round used is to convert ../func.c
567 # into a standalone program that generates a suitable function list
568 # that is standwiched between the top and bottom builtin help text.
570 # We form funclist.c by sedding out unwanted stuff from builtins table,
571 # converting NUMBER* and VALUE into harmless types and converting
572 # the showbuiltins() function into main(). Combined with the -DFUNCLIST
573 # we will avoid all of the complex calc types, macros and defines and
574 # be left with just main() and a mininal builtins table.
576 # Building funclist.o a portable fashion is ugly because some systems
577 # do not treat -I.. correctly!
579 builtin: builtin.top builtin.end ../func.c funclist.sed
580 ${Q} echo "forming builtin help file"
581 ${Q} ${RM} -f funclist.c
582 ${Q} ${SED} -n -f funclist.sed ../func.c > funclist.c
583 ${Q} ${RM} -f funclist.o funclist${EXT}
584 ${Q} ${LCC} ${ICFLAGS} -DFUNCLIST -I/usr/include \
585 -I.. funclist.c -c 2>/dev/null
586 ${Q} ${LCC} ${ILDFLAGS} funclist.o -o funclist${EXT}
587 ${Q} ${RM} -f builtin
588 ${Q} ${CAT} builtin.top > builtin
589 ${Q} ./funclist${EXT} | \
590 ${SED} -e 's/^/ /' -e 's/[ ][ ]*$$//' >> builtin
591 ${Q} ${CAT} builtin.end >> builtin
592 ${Q} echo "builtin help file formed"
593 -@if [ -z "${Q}" ]; then \
594 echo ''; \
595 echo '=-=-= skipping the ${CAT} of help/$@ =-=-='; \
596 echo ''; \
597 else \
598 ${TRUE}; \
603 # File list generation. You can ignore this section.
606 # We will form the names of source files as if they were in a
607 # sub-directory called calc/help.
611 distlist: ${DISTLIST}
612 ${Q} for i in ${DISTLIST} /dev/null; do \
613 if [ X"$$i" != X"/dev/null" ]; then \
614 echo help/$$i; \
615 fi; \
616 done | LANG=C ${SORT}
618 distdir:
619 ${Q} echo help
621 calcliblist:
622 ${Q} for i in ${CALCLIBLIST} /dev/null; do \
623 if [ X"$$i" != X"/dev/null" ]; then \
624 echo help/$$i; \
625 fi; \
626 done
628 # The BSDI cdrom makefile expects all help files to be pre-built. This rule
629 # creats these fils so that the release can be shipped off to BSDI. You can
630 # ignore this rule.
632 bsdi: all
633 ${RM} -f obj
634 ${CP} obj.file obj
636 # These next rule help me form the ${DETAIL_HELP} makefile variables above.
638 detaillist:
639 ${Q} -(echo "xxxxx"; \
640 for i in ${DETAIL_HELP} /dev/null; do \
641 if [ X"$$i" != X"/dev/null" ]; then \
642 if [ ! -f RCS/$$i,v ]; then \
643 echo "WARNING: $$i not under RCS control" 1>&2; \
644 else \
645 echo $$i; \
646 fi; \
647 fi; \
648 done | LANG=C ${SORT}) | ${FMT} -70 | \
649 ${SED} -e '1s/xxxxx/DETAIL_HELP=/' -e '2,$$s/^/ /' \
650 -e 's/$$/ \\/' -e '$$s/ \\$$//'
654 # rpm rules
658 echo_inst_files:
659 ${Q} for i in ${STD_HELP_FILES} full ${BLT_HELP_FILES} \
660 builtin ${DETAIL_HELP} ${SINGULAR_FILES} /dev/null; do \
661 if [ X"$$i" != X"/dev/null" ]; then \
662 echo __file__ ${HELPDIR}/$$i; \
663 fi; \
664 done
665 ${Q} echo __file__ ${HELPDIR}/obj
669 # Utility rules
673 clean:
674 ${RM} -f obj mkbuiltin funclist.c funclist.o funclist${EXT}
675 ${RM} -f COPYING COPYING-LGPL
677 clobber: clean
678 ${RM} -f ${BLT_HELP_FILES} full .all calc
679 ${RM} -f ${SINGULAR_FILES} ${DETAIL_CLONE}
681 # install everything
683 # NOTE: Keep the uninstall rule in reverse order to the install rule
685 install: all
686 -${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \
687 echo ${MKDIR} ${T}${CALC_SHAREDIR}; \
688 ${MKDIR} ${T}${CALC_SHAREDIR}; \
689 if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \
690 echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
691 ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
692 fi; \
693 echo ${CHMOD} 0755 ${T}${CALC_SHAREDIR}; \
694 ${CHMOD} 0755 ${T}${CALC_SHAREDIR}; \
695 else \
696 ${TRUE}; \
698 -${Q} if [ ! -d ${T}${HELPDIR} ]; then \
699 echo ${MKDIR} ${T}${HELPDIR}; \
700 ${MKDIR} ${T}${HELPDIR}; \
701 if [ ! -d "${T}${HELPDIR}" ]; then \
702 echo ${MKDIR} -p "${T}${HELPDIR}"; \
703 ${MKDIR} -p "${T}${HELPDIR}"; \
704 fi; \
705 echo ${CHMOD} 0755 ${T}${HELPDIR}; \
706 ${CHMOD} 0755 ${T}${HELPDIR}; \
707 else \
708 ${TRUE}; \
710 -${Q} for i in ${STD_HELP_FILES} ${BLT_HELP_FILES} builtin \
711 full ${DETAIL_HELP} ${SINGULAR_FILES} /dev/null; do \
712 if [ "$$i" = "/dev/null" ]; then \
713 continue; \
714 fi; \
715 if ${CMP} -s $$i ${T}${HELPDIR}/$$i; then \
716 ${TRUE}; \
717 else \
718 ${RM} -f ${T}${HELPDIR}/$$i.new; \
719 ${CP} -f $$i ${T}${HELPDIR}/$$i.new; \
720 ${CHMOD} 0444 ${T}${HELPDIR}/$$i.new; \
721 ${MV} -f ${T}${HELPDIR}/$$i.new ${T}${HELPDIR}/$$i; \
722 echo "installed ${T}${HELPDIR}/$$i"; \
723 fi; \
724 done
725 -${Q} if ${CMP} -s obj.file ${T}${HELPDIR}/obj; then \
726 ${TRUE}; \
727 else \
728 ${RM} -f ${T}${HELPDIR}/obj.new; \
729 ${CP} -f obj.file ${T}${HELPDIR}/obj.new; \
730 ${CHMOD} 0444 ${T}${HELPDIR}/obj.new; \
731 ${MV} -f ${T}${HELPDIR}/obj.new ${T}${HELPDIR}/obj; \
732 echo "installed ${T}${HELPDIR}/obj"; \
734 -${Q} if [ -f "${T}${HELPDIR}/sha" ]; then \
735 ${RM} -f ${T}${HELPDIR}/sha; \
736 echo "removed old ${T}${HELPDIR}/sha"; \
738 -${Q} if [ -f "${T}${HELPDIR}/md5" ]; then \
739 ${RM} -f ${T}${HELPDIR}/md5; \
740 echo "removed old ${T}${HELPDIR}/md5"; \
743 # Try to remove everything that was installed
745 # NOTE: Keep the uninstall rule in reverse order to the install rule
747 uninstall:
748 -${Q} if [ -f "${T}${HELPDIR}/obj" ]; then \
749 ${RM} -f "${T}${HELPDIR}/obj"; \
750 if [ -f "${T}${HELPDIR}/obj" ]; then \
751 echo "cannot uninstall ${T}${HELPDIR}/obj"; \
752 else \
753 echo "uninstalled ${T}${HELPDIR}/obj"; \
754 fi; \
756 -${Q} for i in ${SINGULAR_FILES} ${DETAIL_HELP} full builtin \
757 ${BLT_HELP_FILES} ${STD_HELP_FILES} /dev/null; do \
758 if [ "$$i" = "/dev/null" ]; then \
759 continue; \
760 fi; \
761 if [ -f "${T}${HELPDIR}/$$i" ]; then \
762 ${RM} -f "${T}${HELPDIR}/$$i"; \
763 if [ -f "${T}${HELPDIR}/$$i" ]; then \
764 echo "cannot uninstall ${T}${HELPDIR}/$$i"; \
765 else \
766 echo "uninstalled ${T}${HELPDIR}/$$i"; \
767 fi; \
768 fi; \
769 done
770 -${Q} for i in ${HELPDIR} ${CALC_SHAREDIR}; do \
771 if [ -d "${T}$$i" ]; then \
772 ${RMDIR} "${T}$$i" 2>/dev/null; \
773 echo "cleaned up ${T}$$i"; \
774 fi; \
775 done