limit fstBC to 30bp in Python3 ver.
[GalaxyCodeBases.git] / c_cpp / etc / calc / cscript / Makefile
blob9a75550363c0c7bb2df8f41502da5c0ae17967d3
2 # cscript - makefile for calc shell script files
4 # Copyright (C) 1999-2006 Landon Curt Noll
6 # Calc is open software; you can redistribute it and/or modify it under
7 # the terms of the version 2.1 of the GNU Lesser General Public License
8 # as published by the Free Software Foundation.
10 # Calc is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
13 # Public License for more details.
15 # A copy of version 2.1 of the GNU Lesser General Public License is
16 # distributed with calc under the filename COPYING-LGPL. You should have
17 # received a copy with calc; if not, write to Free Software Foundation, Inc.
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 # @(#) $Revision: 30.4 $
21 # @(#) $Id: Makefile,v 30.4 2013/08/11 08:41:38 chongo Exp $
22 # @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/Makefile,v $
24 # Under source code control: 1999/11/29 11:10:26
25 # File existed as early as: 1999
27 # chongo <was here> /\oo/\ http://www.isthe.com/chongo/
28 # Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
30 # calculator by David I. Bell with help/mods from others
31 # 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 CHMOD= chmod
173 SED= sed
174 SORT= sort
175 FMT= fmt
176 CMP= cmp
177 MKDIR= mkdir
178 RMDIR= rmdir
179 RM= rm
180 TOUCH= touch
181 MV= mv
182 CP= cp
183 CO= co
184 TRUE= true
186 # The ${SCRIPT} list is the list of calc shell script files (without the .calc
187 # extension) which will be installed.
189 # The ${SCRIPT_SRC} is built from ${SCRIPT} and has the .calc extensions.
191 # This list is produced by the detaillist rule when no WARNINGS are detected.
192 # To add a script:
194 # 1) Name the file with a .calc filename extension
195 # 2) Place that file under RCS control
196 # 3) Add the name, without the .calc extension to the ${SCRIPT} below
197 # 4) Write out this Makefile
198 # 5) Replace the ${SCRIPT} and ${SCRIPT_SRC} lines with the output of:
200 # make detaillist
202 SCRIPT= 4dsphere fproduct mersenne piforever plus powerterm \
203 simple square
205 SCRIPT_SRC= 4dsphere.calc fproduct.calc mersenne.calc \
206 piforever.calc plus.calc powerterm.calc simple.calc square.calc
208 # These files are found (but not built) in the distribution
210 DISTLIST= ${SCRIPT_SRC} ${MAKE_FILE} README.src
212 # These files are used to make (but not build) a calc .a library
214 CALCLIBLIST=
216 # complete list of targets
218 # NOTE: This list MUST be coordinated with the ${CSCRIPT_TARGETS} variable
219 # in the upper level ../Makefile
221 CSCRIPT_TARGETS= ${SCRIPT}
222 TARGETS= ${CSCRIPT_TARGETS} README
224 # The reason for this Makefile
226 all: ${TARGETS} .all
228 README: README.src
229 @${RM} -f $@
230 @${SED} -e "s:#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
232 # used by the upper level Makefile to determine if we have done all
234 # NOTE: Due to bogus shells found on one common system we must have
235 # a non-empty else clause for every if condition. *sigh*
237 .all:
238 ${RM} -f .all
239 ${TOUCH} .all
243 # File list generation. You can ignore this section.
246 # We will form the names of source files as if they were in a
247 # sub-directory called calc/cscript.
251 distlist: ${DISTLIST}
252 ${Q} for i in ${DISTLIST} /dev/null; do \
253 if [ X"$$i" != X"/dev/null" ]; then \
254 echo cscript/$$i; \
255 fi; \
256 done | LANG=C ${SORT}
258 distdir:
259 ${Q} echo cscript
261 calcliblist:
263 # These next rule help me form the ${SCRIPT} and ${SCRIPT_SRC} makefile
264 # variables above.
266 detaillist:
267 ${Q} -(echo "xxxxxxx"; \
268 for i in ${SCRIPT} /dev/null; do \
269 if [ X"$$i" != X"/dev/null" ]; then \
270 if [ ! -f RCS/$$i.calc,v ]; then \
271 echo "WARNING: $$i.calc not under RCS control" 1>&2; \
272 else \
273 echo $$i; \
274 fi; \
275 fi; \
276 done | LANG=C ${SORT}) | ${FMT} -70 | \
277 ${SED} -e '1s/xxxxxxx/SCRIPT=/' -e '2,$$s/^/ /' \
278 -e 's/$$/ \\/' -e '$$s/ \\$$//'
279 ${Q} echo
280 ${Q} -(echo "xxxxxxxxxxx"; \
281 for i in ${SCRIPT} /dev/null; do \
282 if [ X"$$i" != X"/dev/null" ]; then \
283 if [ ! -f RCS/$$i.calc,v ]; then \
284 echo "WARNING: $$i.calc not under RCS control" 1>&2; \
285 else \
286 echo $$i.calc; \
287 fi; \
288 fi; \
289 done | LANG=C ${SORT}) | ${FMT} -70 | \
290 ${SED} -e '1s/xxxxxxxxxxx/SCRIPT_SRC=/' -e '2,$$s/^/ /' \
291 -e 's/$$/ \\/' -e '$$s/ \\$$//'
295 # Home grown make dependency rules. Your system make not support
296 # or have the needed tools. You can ignore this section.
298 # We will form a skelaton tree of *.c files containing only #include "foo.h"
299 # lines and .h files containing the same lines surrounded by multiple include
300 # prevention lines. This allows us to build a static depend list that will
301 # satisfy all possible cpp symbol definition combinations.
305 depend:
306 ${Q} if [ -f ${MAKE_FILE}.bak ]; then \
307 echo "${MAKE_FILE}.bak exists, remove or move it"; \
308 exit 1; \
309 else \
310 ${TRUE}; \
312 ${Q} ${RM} -f makedep.out
313 ${Q} echo forming cscript dependency list
314 ${Q} for i in ${SCRIPT} /dev/null; do \
315 if [ X"$$i" != X"/dev/null" ]; then \
316 echo "$$i: $$i.calc"; \
317 echo ' @$${RM} -f $$@'; \
318 echo -n ' @$${SED} -e "1s:'; \
319 echo "^#!/usr/local/src/cmd/calc/calc:#!$${BINDIR}/calc:" \
320 $$?>$$@'; \
321 echo ' @$${CHMOD} +x $$@'; \
322 fi; \
323 done >> makedep.out
324 ${Q} echo sample dependency list formed
325 ${Q} echo forming new cscript/${MAKE_FILE}
326 ${Q} ${RM} -f ${MAKE_FILE}.bak
327 ${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
328 ${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' \
329 ${MAKE_FILE}.bak > ${MAKE_FILE}
330 ${Q} echo "" >> ${MAKE_FILE}
331 ${Q} ${CAT} makedep.out >> ${MAKE_FILE}
332 ${Q} ${RM} -f makedep.out
333 -${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \
334 echo 'sample ${MAKE_FILE} was already up to date'; \
335 ${MV} -f ${MAKE_FILE}.bak ${MAKE_FILE}; \
336 else \
337 ${RM} -f ${MAKE_FILE}.tmp; \
338 ${MV} ${MAKE_FILE} ${MAKE_FILE}.tmp; \
339 if [ -d RCS -a ! -w "${MAKE_FILE}" ]; then \
340 ${CO} -l ${MAKE_FILE}; \
341 fi; \
342 ${MV} ${MAKE_FILE}.tmp ${MAKE_FILE}; \
343 if [ -d RCS ]; then \
344 echo '*****************************************************'; \
345 echo 'new sample ${MAKE_FILE} formed -- need to check it in'; \
346 echo '*****************************************************'; \
347 fi; \
352 # rpm rules
356 echo_inst_files:
357 ${Q} for i in ${SCRIPT} /dev/null; do \
358 if [ X"$$i" != X"/dev/null" ]; then \
359 echo __file__ ${SCRIPTDIR}/$$i; \
360 fi; \
361 done
365 # Utility rules
369 clean:
370 ${RM} -f makedep.out
372 clobber: clean
373 ${RM} -f .all
374 ${RM} -f ${TARGETS}
376 # install everything
378 # NOTE: Keep the uninstall rule in reverse order to the install rule
380 install: all
381 -${Q} if [ ! -d ${T}${BINDIR} ]; then \
382 echo ${MKDIR} ${T}${BINDIR}; \
383 ${MKDIR} ${T}${BINDIR}; \
384 if [ ! -d "${T}${BINDIR}" ]; then \
385 echo ${MKDIR} -p "${T}${BINDIR}"; \
386 ${MKDIR} -p "${T}${BINDIR}"; \
387 fi; \
388 echo ${CHMOD} 0755 ${T}${BINDIR}; \
389 ${CHMOD} 0755 ${T}${BINDIR}; \
390 else \
391 ${TRUE}; \
393 -${Q} if [ ! -d ${T}${SCRIPTDIR} ]; then \
394 echo ${MKDIR} ${T}${SCRIPTDIR}; \
395 ${MKDIR} ${T}${SCRIPTDIR}; \
396 if [ ! -d "${T}${SCRIPTDIR}" ]; then \
397 echo ${MKDIR} -p "${T}${SCRIPTDIR}"; \
398 ${MKDIR} -p "${T}${SCRIPTDIR}"; \
399 fi; \
400 echo ${CHMOD} 0755 ${T}${SCRIPTDIR}; \
401 ${CHMOD} 0755 ${T}${SCRIPTDIR}; \
402 else \
403 ${TRUE}; \
405 ${Q} for i in ${SCRIPT} /dev/null; do \
406 if [ "$$i" = "/dev/null" ]; then \
407 continue; \
408 fi; \
409 if ${CMP} -s $$i ${T}${SCRIPTDIR}/$$i; then \
410 ${TRUE}; \
411 else \
412 ${RM} -f ${T}${SCRIPTDIR}/$$i.new; \
413 ${CP} -f $$i ${T}${SCRIPTDIR}/$$i.new; \
414 ${CHMOD} 0755 ${T}${SCRIPTDIR}/$$i.new; \
415 ${MV} -f ${T}${SCRIPTDIR}/$$i.new ${T}${SCRIPTDIR}/$$i; \
416 echo "installed ${T}${SCRIPTDIR}/$$i"; \
417 fi; \
418 done
420 # Try to remove everything that was installed
422 # NOTE: Keep the uninstall rule in reverse order to the install rule
424 uninstall:
425 -${Q} for i in ${SCRIPT} /dev/null; do \
426 if [ "$$i" = "/dev/null" ]; then \
427 continue; \
428 fi; \
429 if [ -f "${T}${SCRIPTDIR}/$$i" ]; then \
430 ${RM} -f "${T}${SCRIPTDIR}/$$i"; \
431 if [ -f "${T}${SCRIPTDIR}/$$i" ]; then \
432 echo "cannot uninstall ${T}${SCRIPTDIR}/$$i"; \
433 else \
434 echo "uninstalled ${T}${SCRIPTDIR}/$$i"; \
435 fi; \
436 fi; \
437 done
438 -${Q} for i in ${SCRIPTDIR} ${BINDIR}; do \
439 if [ -d "${T}$$i" ]; then \
440 ${RMDIR} "${T}$$i" 2>/dev/null; \
441 echo "cleaned up ${T}$$i"; \
442 fi; \
443 done
445 # DO NOT DELETE THIS LINE -- make depend depends on it.
447 4dsphere: 4dsphere.calc
448 @${RM} -f $@
449 @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
450 @${CHMOD} +x $@
451 fproduct: fproduct.calc
452 @${RM} -f $@
453 @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
454 @${CHMOD} +x $@
455 mersenne: mersenne.calc
456 @${RM} -f $@
457 @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
458 @${CHMOD} +x $@
459 piforever: piforever.calc
460 @${RM} -f $@
461 @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
462 @${CHMOD} +x $@
463 plus: plus.calc
464 @${RM} -f $@
465 @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
466 @${CHMOD} +x $@
467 powerterm: powerterm.calc
468 @${RM} -f $@
469 @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
470 @${CHMOD} +x $@
471 simple: simple.calc
472 @${RM} -f $@
473 @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
474 @${CHMOD} +x $@
475 square: square.calc
476 @${RM} -f $@
477 @${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
478 @${CHMOD} +x $@