Simple command line calculator http://amath.innolan.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configure 29KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292
  1. #!/bin/sh
  2. #
  3. # Copyright {c} 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
  4. # All rights reserved.
  5. #
  6. # Redistribution and use in source and binary forms, with or without
  7. # modification, are permitted provided that the following conditions
  8. # are met:
  9. # 1. Redistributions of source code must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. # 2. Redistributions in binary form must reproduce the above copyright
  12. # notice, this list of conditions and the following disclaimer in the
  13. # documentation and/or other materials provided with the distribution.
  14. #
  15. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  16. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  17. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  18. # ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
  19. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  20. # DAMAGES {INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  21. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION}
  22. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  23. # LIABILITY, OR TORT {INCLUDING NEGLIGENCE OR OTHERWISE} ARISING IN ANY WAY
  24. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  25. # SUCH DAMAGE.
  26. #
  27. set -e
  28. version="1.8.4"
  29. clang=false
  30. debugsym=false
  31. regtest=true
  32. openlibm=false
  33. stdlibm=false
  34. stdlibc=false
  35. useldconfig=false
  36. fpic=false
  37. prefix="/usr"
  38. pkgconfigdir="lib/pkgconfig"
  39. mandir="share/man"
  40. cflags=""
  41. cxxflags=""
  42. ldflags=""
  43. gcclib="-lstdc++"
  44. libm=""
  45. libc=""
  46. for arg in "$@"; do
  47. unknown=true
  48. case "$arg" in
  49. --prefix=*)
  50. prefix=`echo $arg | sed 's/--prefix=//'`
  51. unknown=false
  52. ;;
  53. --pkgconfig=*)
  54. pkgconfigdir=`echo $arg | sed 's/--pkgconfig=//'`
  55. unknown=false
  56. ;;
  57. --mandir=*)
  58. mandir=`echo $arg | sed 's/--mandir=//'`
  59. unknown=false
  60. ;;
  61. --man-dir=*)
  62. mandir=`echo $arg | sed 's/--mandir=//'`
  63. unknown=false
  64. ;;
  65. --doc-dir=*)
  66. unknown=false
  67. ;;
  68. --cross-compile=*)
  69. crosscompile=`echo $arg | sed 's/--cross-compile=//'`
  70. crosscompile="${crosscompile}-"
  71. unknown=false
  72. ;;
  73. CFLAGS=*)
  74. cflags=`echo $arg | sed 's/CFLAGS=//'`
  75. cflags="${cflags} "
  76. unknown=false
  77. ;;
  78. CXXFLAGS=*)
  79. cxxflags=`echo $arg | sed 's/CXXFLAGS=//'`
  80. cxxflags="${cxxflags} "
  81. unknown=false
  82. ;;
  83. LDFLAGS=*)
  84. ldflags=`echo $arg | sed 's/LDFLAGS=//'`
  85. ldflags="${ldflags} "
  86. unknown=false
  87. ;;
  88. --enable-clang)
  89. clang=true
  90. unknown=false
  91. ;;
  92. --disable-clang)
  93. clang=false
  94. unknown=false
  95. ;;
  96. --enable-ldconfig)
  97. useldconfig=true
  98. unknown=false
  99. ;;
  100. --disable-ldconfig)
  101. useldconfig=false
  102. unknown=false
  103. ;;
  104. --enable-pic)
  105. fpic=true
  106. unknown=false
  107. ;;
  108. --disable-pic)
  109. fpic=false
  110. unknown=false
  111. ;;
  112. --enable-debug)
  113. debugsym=true
  114. unknown=false
  115. ;;
  116. --disable-debug)
  117. debugsym=false
  118. unknown=false
  119. ;;
  120. --enable-test)
  121. regtest=true
  122. unknown=false
  123. ;;
  124. --disable-test)
  125. regtest=false
  126. unknown=false
  127. ;;
  128. --with-libm)
  129. stdlibm=true
  130. unknown=false
  131. ;;
  132. --without-libm)
  133. stdlibm=false
  134. unknown=false
  135. ;;
  136. --with-openlibm)
  137. openlibm=true
  138. unknown=false
  139. ;;
  140. --without-openlibm)
  141. openlibm=false
  142. unknown=false
  143. ;;
  144. --with-stdc++)
  145. gcclib="-lstdc++"
  146. unknown=false
  147. ;;
  148. --without-stdc++)
  149. gcclib=""
  150. unknown=false
  151. ;;
  152. --with-libc)
  153. stdlibc=true
  154. unknown=false
  155. ;;
  156. --without-libc)
  157. stdlibc=false
  158. unknown=false
  159. ;;
  160. --help)
  161. echo "amath configure script ${version}"
  162. echo
  163. echo 'usage: ./configure [options]'
  164. echo 'options:'
  165. echo ' --prefix=<path>: installation prefix'
  166. echo ' --pkgconfig=<path>: pkg-config path (without prefix)'
  167. echo ' --mandir=<path>: manpage path (without prefix)'
  168. echo ' --cross-compile=<prefix>: cross compiler prefix'
  169. echo ' --enable-debug: include debug symbols'
  170. echo ' --disable-debug: do not include debug symbols'
  171. echo ' --enable-test: build code with regression tests'
  172. echo ' --disable-test: do not include regression test'
  173. echo ' --enable-clang: build explicit with clang compiler'
  174. echo ' --disable-clang: do not explicit build with clang compiler'
  175. echo ' --enable-ldconfig: use ldconfig to registre libraries'
  176. echo ' --disable-ldconfig: do not use ldconfig to registre libraries'
  177. echo ' --enable-pic: build with Position Independent Code (-fPIC)'
  178. echo ' --disable-pic: do not build static libraries with Position Independent Code'
  179. echo ' --with-libm: link with libm library (-lm)'
  180. echo ' --without-libm: do not link with libm library'
  181. echo ' --with-openlibm: link with openlibm library (-lopenlibm)'
  182. echo ' --without-openlibm: do not link with openlibm library'
  183. echo ' --with-stdc++: link with stdc++ library (-lstdc++)'
  184. echo ' --without-stdc++: do not link with stdc++ library'
  185. echo ' --with-libc: explicit link with libc library (-lc)'
  186. echo ' --without-libc: do not link with libc library'
  187. echo
  188. echo ' CFLAGS=<flags>: additional compiler flags'
  189. echo ' CXXFLAGS=<flags>: additional compiler flags'
  190. echo ' LDFLAGS=<flags>: additional linker flags'
  191. echo
  192. exit 0
  193. ;;
  194. esac
  195. if $unknown; then
  196. echo "Invalid option $arg"
  197. exit 1
  198. fi
  199. done
  200. if $clang; then
  201. ccompiler="clang"
  202. cxxcompiler="clang++"
  203. else
  204. ccompiler="gcc"
  205. cxxcompiler="g++"
  206. fi
  207. if $regtest; then
  208. options=" -DWITHTEST"
  209. else
  210. options=" "
  211. fi
  212. if $debugsym; then
  213. appop="-O0 -g"
  214. libop="-O0 -g"
  215. exestrip=""
  216. debugflag="-DDEBUG "
  217. else
  218. appop="-O2"
  219. libop="-O3"
  220. exestrip="-s"
  221. debugflag=""
  222. fi
  223. dlibm=false
  224. mflags=""
  225. if $stdlibm; then
  226. libm="-lm "
  227. mflags="-DLIBM "
  228. dlibm=true
  229. fi
  230. if $openlibm; then
  231. libm="-lopenlibm "
  232. mflags="-DLIBM "
  233. dlibm=true
  234. fi
  235. if $useldconfig; then
  236. soverion=".${version}"
  237. else
  238. soverion=""
  239. fi
  240. if $stdlibc; then
  241. gcclib="${gcclib} -lc"
  242. libc="-lc"
  243. fi
  244. if $fpic; then
  245. fPIC=" -fPIC"
  246. else
  247. fPIC=""
  248. fi
  249. cflags="${cflags}${debugflag}${mflags}"
  250. cxxflags="${cflags} ${cxxflags}"
  251. APPSRCS='
  252. evaluator.cpp
  253. functionlist.cpp
  254. fgrid.cpp
  255. lexer.cpp
  256. nodes.cpp
  257. operators.cpp
  258. optimizer.cpp
  259. parser.cpp
  260. token.cpp
  261. userfunction.cpp
  262. values.cpp
  263. viewer.cpp
  264. '
  265. SYSSRCS='
  266. console.cpp
  267. console_amiga.cpp
  268. console_stdc.cpp
  269. console_termios.cpp
  270. console_windows.cpp
  271. filesystem_amiga.cpp
  272. filesystem_stdc.cpp
  273. language.cpp
  274. language_amiga.cpp
  275. language_stdc.cpp
  276. preferences.cpp
  277. preferences_amiga.cpp
  278. preferences_stdc.cpp
  279. program.cpp
  280. program_amiga.cpp
  281. program_haiku.cpp
  282. program_stdc.cpp
  283. program_test.cpp
  284. window_amiga.cpp
  285. window_haiku.cpp
  286. '
  287. FUNCTIONSRC='
  288. absolute.cpp
  289. aexcosecant.cpp
  290. aexsecant.cpp
  291. arcchord.cpp
  292. arccos.cpp
  293. arcsin.cpp
  294. arctan.cpp
  295. arccosecant.cpp
  296. arccotangent.cpp
  297. arcsecant.cpp
  298. arccovercosine.cpp
  299. arccoversine.cpp
  300. archacovercosine.cpp
  301. archacoversine.cpp
  302. archavercosine.cpp
  303. archaversine.cpp
  304. arcvercosine.cpp
  305. arcversine.cpp
  306. ceil.cpp
  307. chord.cpp
  308. cosecant.cpp
  309. cosine.cpp
  310. cotangent.cpp
  311. covercos.cpp
  312. coversin.cpp
  313. cube.cpp
  314. excosecant.cpp
  315. exsecant.cpp
  316. floor.cpp
  317. hacovercos.cpp
  318. hacoversin.cpp
  319. havercos.cpp
  320. haversin.cpp
  321. hyparccosecant.cpp
  322. hyparccosine.cpp
  323. hyparccotangent.cpp
  324. hyparcsecant.cpp
  325. hyparcsine.cpp
  326. hyparctangent.cpp
  327. hypcosecant.cpp
  328. hypcosine.cpp
  329. hypcotangent.cpp
  330. hypsecant.cpp
  331. hypsine.cpp
  332. hyptangent.cpp
  333. ln.cpp
  334. log10.cpp
  335. log2.cpp
  336. node.cpp
  337. round.cpp
  338. secant.cpp
  339. signum.cpp
  340. sine.cpp
  341. square.cpp
  342. tangent.cpp
  343. trunc.cpp
  344. user.cpp
  345. vercos.cpp
  346. versin.cpp
  347. '
  348. STATEMENTSRCS='
  349. about.cpp
  350. clear.cpp
  351. delete.cpp
  352. digits.cpp
  353. draw.cpp
  354. empty.cpp
  355. eval.cpp
  356. execute.cpp
  357. exit.cpp
  358. funcdef.cpp
  359. funclist.cpp
  360. help.cpp
  361. input.cpp
  362. license.cpp
  363. list.cpp
  364. load.cpp
  365. memory.cpp
  366. node.cpp
  367. output.cpp
  368. plot.cpp
  369. prefs.cpp
  370. prompt.cpp
  371. save.cpp
  372. show.cpp
  373. silent.cpp
  374. version.cpp
  375. '
  376. LIBAPPSRCS='
  377. aengine.cpp
  378. bigint.cpp
  379. charbuf.cpp
  380. cplex.cpp
  381. nnumb.cpp
  382. ntext.cpp
  383. ntextd.cpp
  384. ntextp.cpp
  385. real.cpp
  386. '
  387. LIBREALSRCS='
  388. acos.c
  389. acosh.c
  390. asin.c
  391. asinh.c
  392. atan.c
  393. atan2.c
  394. atanh.c
  395. cbrt.c
  396. ceil.c
  397. csign.c
  398. cos.c
  399. cosh.c
  400. exp.c
  401. expm1.c
  402. fabs.c
  403. floor.c
  404. fmod.c
  405. hypot.c
  406. kcos.c
  407. kremp2.c
  408. ksin.c
  409. ktan.c
  410. log.c
  411. log10.c
  412. log1p.c
  413. pow.c
  414. remp2.c
  415. round.c
  416. scalbn.c
  417. sin.c
  418. sinh.c
  419. sqrt.c
  420. tan.c
  421. tanh.c
  422. trunc.c
  423. '
  424. LIBREAL2SRCS='
  425. acot.c
  426. acoth.c
  427. acrd.c
  428. acsc.c
  429. acsch.c
  430. acvc.c
  431. acvs.c
  432. aexc.c
  433. aexs.c
  434. ahcc.c
  435. ahcv.c
  436. ahv.c
  437. ahvc.c
  438. asec.c
  439. asech.c
  440. avcs.c
  441. aver.c
  442. cot.c
  443. coth.c
  444. crd.c
  445. csc.c
  446. csch.c
  447. cvc.c
  448. cvs.c
  449. exc.c
  450. exs.c
  451. hcc.c
  452. hcv.c
  453. hv.c
  454. hvc.c
  455. log2i.c
  456. log2p.c
  457. sec.c
  458. sech.c
  459. vcs.c
  460. ver.c
  461. '
  462. LIBCPLEXSRCS='
  463. cacos.c
  464. cacosh.c
  465. casin.c
  466. casinh.c
  467. catan.c
  468. catanh.c
  469. ccos.c
  470. ccosh.c
  471. cexp.c
  472. clog.c
  473. cpow.c
  474. csin.c
  475. csinh.c
  476. csqrt.c
  477. ctan.c
  478. ctanh.c
  479. '
  480. LIBCPLEX2SRCS='
  481. cacot.c
  482. cacoth.c
  483. cacsc.c
  484. cacsch.c
  485. casec.c
  486. casech.c
  487. ccbrt.c
  488. ccot.c
  489. ccoth.c
  490. ccsc.c
  491. ccsch.c
  492. clogb.c
  493. clog10.c
  494. csec.c
  495. csech.c
  496. csgn.c
  497. prim.c
  498. '
  499. LIBC1SRCS='
  500. alloccpy.c
  501. mem.c
  502. memcpy.c
  503. memset.c
  504. strcmp.c
  505. strlen.c
  506. untag.c
  507. '
  508. FLXSRCS='
  509. asprintf.c
  510. createcat.c
  511. createcatsrc.c
  512. createct.c
  513. globals.c
  514. locale_other.c
  515. main.c
  516. openlibs.c
  517. readprefs.c
  518. scancd.c
  519. scanct.c
  520. scanpo.c
  521. showfuncs.c
  522. strptime.c
  523. swapfuncs.c
  524. utils.c
  525. vastubs.c
  526. '
  527. if $dlibm; then
  528. LIBREALSRCS="${LIBREAL2SRCS}"
  529. else
  530. LIBREALSRCS="${LIBREALSRCS}${LIBREAL2SRCS}"
  531. fi
  532. if $dlibm; then
  533. LIBCPLEXSRCS="${LIBCPLEX2SRCS}"
  534. else
  535. LIBCPLEXSRCS="${LIBCPLEXSRCS}${LIBCPLEX2SRCS}"
  536. fi
  537. amathc="amathc"
  538. amath="amath"
  539. amathcplex="amathcplex"
  540. amathapp="amathapp"
  541. appmain="appmain"
  542. appfunction="functions"
  543. appstatement="statement"
  544. appsystem="appsystem"
  545. program="src/main"
  546. ldsysflags="-l${appsystem} -l${appfunction} -l${appstatement} -l${appmain} -l${appfunction} -l${appstatement} -l${appmain} "
  547. ldlibflags="-l${amathapp} ${libm}-l${amathcplex} ${libm}-l${amath} -l${amathc} ${gcclib}"
  548. ############################ Main Application ###########################
  549. {
  550. echo "CXX = ${crosscompile}${cxxcompiler}"
  551. echo "CXXFLAGS = ${appop}${options} ${cxxflags}${fPIC} -I. -I.. -Wall"
  552. echo "AR = ${crosscompile}ar"
  553. echo "RANLIB = ${crosscompile}ranlib"
  554. echo "DEL = rm -f"
  555. echo
  556. echo "all: lib"
  557. echo "static: lib"
  558. echo
  559. files=""
  560. for f in ${APPSRCS}
  561. do
  562. b=`basename $f .cpp`
  563. echo "${b}.o: ${f}"
  564. echo " \${CXX} \${CXXFLAGS} -c ${f}"
  565. echo
  566. files="${files} ${b}.o"
  567. done
  568. echo "lib: ${files}"
  569. echo " \${AR} rcs lib${appmain}.a ${files}"
  570. echo " \${RANLIB} lib${appmain}.a"
  571. echo
  572. echo "clean:"
  573. echo " \${DEL} lib${appmain}.a ${files}"
  574. echo
  575. } > src/main/Makefile
  576. #########################################################################
  577. ########################### Functions Library ###########################
  578. {
  579. echo "CXX = ${crosscompile}${cxxcompiler}"
  580. echo "CXXFLAGS = ${appop}${options} ${cxxflags}${fPIC} -I. -I../.. -Wall"
  581. echo "AR = ${crosscompile}ar"
  582. echo "RANLIB = ${crosscompile}ranlib"
  583. echo "DEL = rm -f"
  584. echo
  585. echo "all: lib"
  586. echo "static: lib"
  587. echo
  588. files=""
  589. for f in ${FUNCTIONSRC}
  590. do
  591. b=`basename $f .cpp`
  592. echo "${b}.o: ${f}"
  593. echo " \${CXX} \${CXXFLAGS} -c ${f}"
  594. echo
  595. files="${files} ${b}.o"
  596. done
  597. echo "lib: ${files}"
  598. echo " \${AR} rcs lib${appfunction}.a ${files}"
  599. echo " \${RANLIB} lib${appfunction}.a"
  600. echo
  601. echo "clean:"
  602. echo " \${DEL} lib${appfunction}.a ${files}"
  603. echo
  604. } > src/main/function/Makefile
  605. #########################################################################
  606. ########################### Statement Library ###########################
  607. {
  608. echo "CXX = ${crosscompile}${cxxcompiler}"
  609. echo "CXXFLAGS = ${appop}${options} ${cxxflags}${fPIC} -I. -I../.. -Wall"
  610. echo "AR = ${crosscompile}ar"
  611. echo "RANLIB = ${crosscompile}ranlib"
  612. echo "DEL = rm -f"
  613. echo
  614. echo "all: lib"
  615. echo "static: lib"
  616. echo
  617. files=""
  618. for f in ${STATEMENTSRCS}
  619. do
  620. b=`basename $f .cpp`
  621. echo "${b}.o: ${f}"
  622. echo " \${CXX} \${CXXFLAGS} -c ${f}"
  623. echo
  624. files="${files} ${b}.o"
  625. done
  626. echo "lib: ${files}"
  627. echo " \${AR} rcs lib${appstatement}.a ${files}"
  628. echo " \${RANLIB} lib${appstatement}.a"
  629. echo
  630. echo "clean:"
  631. echo " \${DEL} lib${appstatement}.a ${files}"
  632. echo
  633. } > src/main/statement/Makefile
  634. #########################################################################
  635. ############################ System Library #############################
  636. {
  637. echo "CXX = ${crosscompile}${cxxcompiler}"
  638. echo "CXXFLAGS = ${appop}${options} ${cxxflags}${fPIC} -I. -I.. -Wall"
  639. echo "AR = ${crosscompile}ar"
  640. echo "RANLIB = ${crosscompile}ranlib"
  641. echo "DEL = rm -f"
  642. echo
  643. echo "all: lib"
  644. echo "static: lib"
  645. echo
  646. files=""
  647. for f in ${SYSSRCS}
  648. do
  649. b=`basename $f .cpp`
  650. echo "${b}.o: ${f}"
  651. echo " \${CXX} \${CXXFLAGS} -c ${f}"
  652. echo
  653. files="${files} ${b}.o"
  654. done
  655. echo "lib: ${files}"
  656. echo " \${AR} rcs lib${appsystem}.a ${files}"
  657. echo " \${RANLIB} lib${appsystem}.a"
  658. echo
  659. echo "clean:"
  660. echo " \${DEL} lib${appsystem}.a ${files}"
  661. echo
  662. } > src/system/Makefile
  663. #########################################################################
  664. ########################## Application Library ##########################
  665. {
  666. echo "CXX = ${crosscompile}${cxxcompiler}"
  667. echo "CXXFLAGS = ${libop}${options} ${cxxflags}-I. -I.. -Wall"
  668. echo "AR = ${crosscompile}ar"
  669. echo "RANLIB = ${crosscompile}ranlib"
  670. echo "MKDIR = mkdir -p"
  671. echo "RMDIR = rm -Rf"
  672. echo "DEL = rm -f"
  673. echo "INSTALL = install -m 0644"
  674. echo "LDCONFIG = ldconfig"
  675. echo "DOXYGEN = doxygen"
  676. echo "PREFIX = ${prefix}"
  677. echo "INSTDIR = \${DESTDIR}\${PREFIX}/lib/amath"
  678. echo "INSTDIRI = \${DESTDIR}\${PREFIX}/include/amath"
  679. echo "INSTDIRPC = \${DESTDIR}\${PREFIX}/${pkgconfigdir}"
  680. echo "alib = lib${amathapp}.a"
  681. echo "solib = lib${amathapp}.so"
  682. echo "pkgconfig = amatha.pc"
  683. echo
  684. echo "all: static shared"
  685. echo
  686. echo "static: \${alib}"
  687. echo
  688. echo "shared: \${solib}"
  689. echo
  690. files=""
  691. files2=""
  692. for f in ${LIBAPPSRCS}
  693. do
  694. b=`basename $f .cpp`
  695. echo "static/${b}.o: ${f}"
  696. echo " \${CXX} \${CXXFLAGS}${fPIC} -c ${f} -o static/${b}.o"
  697. echo
  698. echo "shared/${b}.o: ${f}"
  699. echo " \${CXX} \${CXXFLAGS} -fPIC -c ${f} -o shared/${b}.o"
  700. echo
  701. files="${files} static/${b}.o"
  702. files2="${files2} shared/${b}.o"
  703. done
  704. echo ".PHONY: build"
  705. echo "build:"
  706. echo " \${MKDIR} static"
  707. echo " \${MKDIR} shared"
  708. echo
  709. echo "\${solib}: build ${files2}"
  710. echo " \${CXX} \${CXXFLAGS} -shared ${exestrip} -fPIC -Wl,-soname,\${solib}${soverion} -o \${solib} ${files2}"
  711. echo
  712. echo "\${alib}: build ${files}"
  713. echo " \${AR} rcs static/\${alib} ${files}"
  714. echo " \${RANLIB} static/\${alib}"
  715. echo
  716. echo ".PHONY: doc"
  717. echo "doc:"
  718. echo " \${DOXYGEN} amatha.dox"
  719. echo
  720. echo ".PHONY: install"
  721. echo "install: \${alib} \${solib}"
  722. echo " \${MKDIR} \${INSTDIR}"
  723. echo " \${MKDIR} \${INSTDIRPC}"
  724. echo " \${MKDIR} \${INSTDIRI}"
  725. echo " \${INSTALL} static/\${alib} \${INSTDIR}/\${alib}"
  726. echo " \${INSTALL} \${solib} \${INSTDIR}/\${solib}"
  727. echo " \${INSTALL} \${pkgconfig} \${INSTDIRPC}/\${pkgconfig}"
  728. echo " \${INSTALL} aengine.h \${INSTDIRI}/aengine.h"
  729. echo " \${INSTALL} bigint.h \${INSTDIRI}/bigint.h"
  730. echo " \${INSTALL} charbuf.h \${INSTDIRI}/charbuf.h"
  731. echo " \${INSTALL} cplex.h \${INSTDIRI}/cplex.h"
  732. echo " \${INSTALL} nnumb.h \${INSTDIRI}/nnumb.h"
  733. echo " \${INSTALL} ntext.h \${INSTDIRI}/ntext.h"
  734. echo " \${INSTALL} ntext.h \${INSTDIRI}/ntextd.h"
  735. echo " \${INSTALL} ntext.h \${INSTDIRI}/ntextp.h"
  736. echo " \${INSTALL} numb.h \${INSTDIRI}/numb.h"
  737. echo " \${INSTALL} real.h \${INSTDIRI}/real.h"
  738. if ${useldconfig}; then
  739. echo " \${LDCONFIG} \${INSTDIR}"
  740. fi
  741. echo
  742. echo ".PHONY: uninstall"
  743. echo "uninstall:"
  744. echo " \${DEL} \${INSTDIR}/\${alib}"
  745. echo " \${DEL} \${INSTDIR}/\${solib}"
  746. echo " \${DEL} \${INSTDIRPC}/\${pkgconfig}"
  747. echo " \${DEL} \${INSTDIRI}/aengine.h"
  748. echo " \${DEL} \${INSTDIRI}/charbuf.h"
  749. echo " \${DEL} \${INSTDIRI}/cplex.h"
  750. echo " \${DEL} \${INSTDIRI}/integer.h"
  751. echo " \${DEL} \${INSTDIRI}/nnumb.h"
  752. echo " \${DEL} \${INSTDIRI}/ntext.h"
  753. echo " \${DEL} \${INSTDIRI}/numb.h"
  754. echo " \${DEL} \${INSTDIRI}/real.h"
  755. if ${useldconfig}; then
  756. echo " \${LDCONFIG}"
  757. fi
  758. echo
  759. echo "clean:"
  760. echo " \${DEL} static/\${alib} \${solib} ${files} ${files2}"
  761. echo
  762. echo "very-clean: clean"
  763. echo " \${DEL} doxygen.warn"
  764. echo " \${RMDIR} man"
  765. echo " \${RMDIR} static"
  766. echo " \${RMDIR} shared"
  767. echo
  768. } > src/lib/Makefile
  769. #########################################################################
  770. ############################### C Library ###############################
  771. {
  772. echo "CC = ${crosscompile}${ccompiler}"
  773. echo "CFLAGS = -std=c9x ${libop}${options} ${cflags}-I. -I.. -Wall"
  774. echo "AR = ${crosscompile}ar"
  775. echo "RANLIB = ${crosscompile}ranlib"
  776. echo "MKDIR = mkdir -p"
  777. echo "RMDIR = rm -Rf"
  778. echo "DEL = rm -f"
  779. echo "INSTALL = install -m 0644"
  780. echo "LDCONFIG = ldconfig"
  781. echo "DOXYGEN = doxygen"
  782. echo "PREFIX = ${prefix}"
  783. echo "INSTDIR = \${DESTDIR}\${PREFIX}/lib/amath"
  784. echo "INSTDIRI = \${DESTDIR}\${PREFIX}/include/amath"
  785. echo "INSTDIRPC = \${DESTDIR}\${PREFIX}/${pkgconfigdir}"
  786. echo "INSTDIRM = \${DESTDIR}\${PREFIX}/${mandir}/man3"
  787. echo "alib = lib${amathc}.a"
  788. echo "solib = lib${amathc}.so"
  789. echo "pkgconfig = amathc.pc"
  790. echo "manpage = amathc.3"
  791. echo
  792. echo "all: static shared"
  793. echo
  794. echo "static: \${alib}"
  795. echo
  796. echo "shared: \${solib}"
  797. echo
  798. libc=""
  799. libcs=""
  800. for f in ${LIBC1SRCS}
  801. do
  802. b=`basename $f .c`
  803. echo "static/${b}.o: ${f}"
  804. echo " \${CC} \${CFLAGS}${fPIC} -fno-builtin -c ${f} -o static/${b}.o"
  805. echo
  806. echo "shared/${b}.o: ${f}"
  807. echo " \${CC} \${CFLAGS} -fPIC -fno-builtin -c ${f} -o shared/${b}.o"
  808. echo
  809. libc="${libc} static/${b}.o"
  810. libcs="${libcs} shared/${b}.o"
  811. done
  812. echo ".PHONY: build"
  813. echo "build:"
  814. echo " \${MKDIR} static"
  815. echo " \${MKDIR} shared"
  816. echo
  817. echo "\${solib}: build ${libcs}"
  818. echo " \${CC} \${CFLAGS} -shared ${exestrip} -fPIC -Wl,-soname,\${solib}${soverion} -o \${solib} ${libcs}"
  819. echo
  820. echo "\${alib}: build ${libc}"
  821. echo " \${AR} rcs static/\${alib} ${libc}"
  822. echo " \${RANLIB} static/\${alib}"
  823. echo
  824. echo ".PHONY: doc"
  825. echo "doc:"
  826. echo " \${DOXYGEN} amathc.dox"
  827. echo
  828. echo ".PHONY: install"
  829. echo "install: \${alib} \${solib}"
  830. echo " \${MKDIR} \${INSTDIR}"
  831. echo " \${MKDIR} \${INSTDIRPC}"
  832. echo " \${MKDIR} \${INSTDIRI}"
  833. echo " \${INSTALL} static/\${alib} \${INSTDIR}/\${alib}"
  834. echo " \${INSTALL} \${solib} \${INSTDIR}/\${solib}"
  835. echo " \${INSTALL} \${pkgconfig} \${INSTDIRPC}/\${pkgconfig}"
  836. echo " \${INSTALL} \${manpage} \${INSTDIRM}/\${manpage}"
  837. echo " \${INSTALL} ../amath.h \${INSTDIRI}"
  838. echo " \${INSTALL} ../amathc.h \${INSTDIRI}"
  839. if ${useldconfig}; then
  840. echo " \${LDCONFIG} \${INSTDIR}"
  841. fi
  842. echo
  843. echo ".PHONY: uninstall"
  844. echo "uninstall:"
  845. echo " \${DEL} \${INSTDIR}/\${alib}"
  846. echo " \${DEL} \${INSTDIR}/\${solib}"
  847. echo " \${DEL} \${INSTDIRPC}/\${pkgconfig}"
  848. echo " \${DEL} \${INSTDIRM}/\${manpage}"
  849. echo " \${DEL} \${INSTDIRI}/amath.h"
  850. echo " \${DEL} \${INSTDIRI}/amathc.h"
  851. if ${useldconfig}; then
  852. echo " \${LDCONFIG}"
  853. fi
  854. echo
  855. echo "clean:"
  856. echo " \${DEL} static/\${alib} \${solib} ${libc} ${libcs}"
  857. echo
  858. echo "very-clean: clean"
  859. echo " \${DEL} doxygen.warn"
  860. echo " \${RMDIR} man"
  861. echo " \${RMDIR} static"
  862. echo " \${RMDIR} shared"
  863. echo
  864. } > src/clib/Makefile
  865. #########################################################################
  866. ############################# Real Numbers ##############################
  867. {
  868. echo "CC = ${crosscompile}${ccompiler}"
  869. echo "CFLAGS = -std=c9x ${libop}${options} ${cflags}-I. -I.. -Wall"
  870. echo "AR = ${crosscompile}ar"
  871. echo "RANLIB = ${crosscompile}ranlib"
  872. echo "MKDIR = mkdir -p"
  873. echo "RMDIR = rm -Rf"
  874. echo "DEL = rm -f"
  875. echo "INSTALL = install -m 0644"
  876. echo "LDCONFIG = ldconfig"
  877. echo "DOXYGEN = doxygen"
  878. echo "PREFIX = ${prefix}"
  879. echo "INSTDIR = \${DESTDIR}\${PREFIX}/lib/amath"
  880. echo "INSTDIRI = \${DESTDIR}\${PREFIX}/include/amath"
  881. echo "INSTDIRPC = \${DESTDIR}\${PREFIX}/${pkgconfigdir}"
  882. echo "INSTDIRM = \${DESTDIR}\${PREFIX}/${mandir}/man3"
  883. echo "alib = lib${amath}.a"
  884. echo "solib = lib${amath}.so"
  885. echo "pkgconfig = amathr.pc"
  886. echo "manpage = amathr.3"
  887. echo
  888. echo "all: static shared"
  889. echo
  890. echo "static: \${alib}"
  891. echo
  892. echo "shared: \${solib}"
  893. echo
  894. libamath=""
  895. libamaths=""
  896. for f in ${LIBREALSRCS}
  897. do
  898. b=`basename $f .c`
  899. echo "static/${b}.o: ${f}"
  900. echo " \${CC} \${CFLAGS}${fPIC} -fno-builtin -c ${f} -o static/${b}.o"
  901. echo
  902. echo "shared/${b}.o: ${f}"
  903. echo " \${CC} \${CFLAGS} -fPIC -fno-builtin -c ${f} -o shared/${b}.o"
  904. echo
  905. libamath="${libamath} static/${b}.o"
  906. libamaths="${libamaths} shared/${b}.o"
  907. done
  908. echo ".PHONY: build"
  909. echo "build:"
  910. echo " \${MKDIR} static"
  911. echo " \${MKDIR} shared"
  912. echo
  913. echo "\${solib}: build ${libamaths}"
  914. echo " \${CC} \${CFLAGS} -shared ${exestrip} -fPIC -Wl,-soname,\${solib}${soverion} -o \${solib} ${libamaths}"
  915. echo
  916. echo "\${alib}: build ${libamath}"
  917. echo " \${AR} rcs static/\${alib} ${libamath}"
  918. echo " \${RANLIB} static/\${alib}"
  919. echo
  920. echo ".PHONY: doc"
  921. echo "doc:"
  922. echo " \${DOXYGEN} amathr.dox"
  923. echo
  924. echo ".PHONY: install"
  925. echo "install: \${alib} \${solib}"
  926. echo " \${MKDIR} \${INSTDIR}"
  927. echo " \${MKDIR} \${INSTDIRPC}"
  928. echo " \${MKDIR} \${INSTDIRI}"
  929. echo " \${INSTALL} static/\${alib} \${INSTDIR}/\${alib}"
  930. echo " \${INSTALL} \${solib} \${INSTDIR}/\${solib}"
  931. echo " \${INSTALL} \${pkgconfig} \${INSTDIRPC}/\${pkgconfig}"
  932. echo " \${INSTALL} \${manpage} \${INSTDIRM}/\${manpage}"
  933. echo " \${INSTALL} ../mathr.h \${INSTDIRI}/mathr.h"
  934. if ${useldconfig}; then
  935. echo " \${LDCONFIG} \${INSTDIR}"
  936. fi
  937. echo
  938. echo ".PHONY: uninstall"
  939. echo "uninstall:"
  940. echo " \${DEL} \${INSTDIR}/\${alib}"
  941. echo " \${DEL} \${INSTDIR}/\${solib}"
  942. echo " \${DEL} \${INSTDIRPC}/\${pkgconfig}"
  943. echo " \${DEL} \${INSTDIRM}/\${manpage}"
  944. echo " \${DEL} \${INSTDIRI}/mathr.h"
  945. if ${useldconfig}; then
  946. echo " \${LDCONFIG}"
  947. fi
  948. echo
  949. echo "clean:"
  950. echo " \${DEL} static/\${alib} \${solib} ${libamath} ${libamaths}"
  951. echo
  952. echo "very-clean: clean"
  953. echo " \${DEL} doxygen.warn"
  954. echo " \${RMDIR} man"
  955. echo " \${RMDIR} static"
  956. echo " \${RMDIR} shared"
  957. echo
  958. } > src/real/Makefile
  959. #########################################################################
  960. ############################ Complex Numbers ############################
  961. {
  962. echo "CC = ${crosscompile}${ccompiler}"
  963. echo "CFLAGS = -std=c9x ${libop}${options} ${cxxflags}-I. -I.. -Wall"
  964. echo "AR = ${crosscompile}ar"
  965. echo "RANLIB = ${crosscompile}ranlib"
  966. echo "MKDIR = mkdir -p"
  967. echo "RMDIR = rm -Rf"
  968. echo "DEL = rm -f"
  969. echo "INSTALL = install -m 0644"
  970. echo "LDCONFIG = ldconfig"
  971. echo "DOXYGEN = doxygen"
  972. echo "PREFIX = ${prefix}"
  973. echo "INSTDIR = \${DESTDIR}\${PREFIX}/lib/amath"
  974. echo "INSTDIRI = \${DESTDIR}\${PREFIX}/include/amath"
  975. echo "INSTDIRPC = \${DESTDIR}\${PREFIX}/${pkgconfigdir}"
  976. echo "INSTDIRM = \${DESTDIR}\${PREFIX}/${mandir}/man3"
  977. echo "alib = lib${amathcplex}.a"
  978. echo "solib = lib${amathcplex}.so"
  979. echo "pkgconfig = amathi.pc"
  980. echo "manpage = amathi.3"
  981. echo
  982. echo "all: static shared"
  983. echo
  984. echo "static: \${alib}"
  985. echo
  986. echo "shared: \${solib}"
  987. echo
  988. libcomplex=""
  989. libcomplexs=""
  990. for f in ${LIBCPLEXSRCS}
  991. do
  992. b=`basename $f .c`
  993. echo "static/${b}.o: ${f}"
  994. echo " \${CC} \${CFLAGS}${fPIC} -fno-builtin -c ${f} -o static/${b}.o"
  995. echo
  996. echo "shared/${b}.o: ${f}"
  997. echo " \${CC} \${CFLAGS} -fPIC -fno-builtin -c ${f} -o shared/${b}.o"
  998. echo
  999. libcomplex="${libcomplex} static/${b}.o"
  1000. libcomplexs="${libcomplexs} shared/${b}.o"
  1001. done
  1002. echo ".PHONY: build"
  1003. echo "build:"
  1004. echo " \${MKDIR} static"
  1005. echo " \${MKDIR} shared"
  1006. echo
  1007. echo "\${solib}: build ${libcomplexs}"
  1008. echo " \${CC} \${CFLAGS} -shared ${exestrip} -fPIC -Wl,-soname,\${solib}${soverion} -o \${solib} ${libcomplexs}"
  1009. echo
  1010. echo "\${alib}: build ${libcomplex}"
  1011. echo " \${AR} rcs static/\${alib} ${libcomplex}"
  1012. echo " \${RANLIB} static/\${alib}"
  1013. echo
  1014. echo ".PHONY: doc"
  1015. echo "doc:"
  1016. echo " \${DOXYGEN} amathi.dox"
  1017. echo
  1018. echo ".PHONY: install"
  1019. echo "install: \${alib} \${solib}"
  1020. echo " \${MKDIR} \${INSTDIR}"
  1021. echo " \${MKDIR} \${INSTDIRPC}"
  1022. echo " \${MKDIR} \${INSTDIRI}"
  1023. echo " \${INSTALL} static/\${alib} \${INSTDIR}/\${alib}"
  1024. echo " \${INSTALL} \${solib} \${INSTDIR}/\${solib}"
  1025. echo " \${INSTALL} \${pkgconfig} \${INSTDIRPC}/\${pkgconfig}"
  1026. echo " \${INSTALL} \${manpage} \${INSTDIRM}/\${manpage}"
  1027. echo " \${INSTALL} ../mathi.h \${INSTDIRI}/mathi.h"
  1028. if ${useldconfig}; then
  1029. echo " \${LDCONFIG} \${INSTDIR}"
  1030. fi
  1031. echo
  1032. echo ".PHONY: uninstall"
  1033. echo "uninstall:"
  1034. echo " \${DEL} \${INSTDIR}/\${alib}"
  1035. echo " \${DEL} \${INSTDIR}/\${solib}"
  1036. echo " \${DEL} \${INSTDIRPC}/\${pkgconfig}"
  1037. echo " \${DEL} \${INSTDIRM}/\${manpage}"
  1038. echo " \${DEL} \${INSTDIRPC}/amathi.pc"
  1039. echo " \${DEL} \${INSTDIRI}/mathi.h"
  1040. if ${useldconfig}; then
  1041. echo " \${LDCONFIG}"
  1042. fi
  1043. echo
  1044. echo "clean:"
  1045. echo " \${DEL} static/\${alib} \${solib} ${libcomplex} ${libcomplexs}"
  1046. echo
  1047. echo "very-clean: clean"
  1048. echo " \${DEL} doxygen.warn"
  1049. echo " \${RMDIR} man"
  1050. echo " \${RMDIR} static"
  1051. echo " \${RMDIR} shared"
  1052. echo
  1053. } > src/cplex/Makefile
  1054. #########################################################################
  1055. ################################# Main ##################################
  1056. {
  1057. echo
  1058. echo "CC = ${crosscompile}${ccompiler}"
  1059. echo "CXX = ${crosscompile}${cxxcompiler}"
  1060. echo "CFLAGS = ${appop}${options} ${cflags}-Wall -Isrc -Isrc/main"
  1061. echo "CXXFLAGS = ${appop}${options} ${cxxflags}-Wall -Isrc -Isrc/main"
  1062. echo "AR = ${crosscompile}ar"
  1063. echo "RANLIB = ${crosscompile}ranlib"
  1064. echo "LFLAGS = ${ldflags}${ldsysflags}${ldlibflags}"
  1065. echo "LPATH = -Lsrc/lib -Lsrc/clib -Lsrc/real -Lsrc/cplex -Lsrc/main/function -Lsrc/main/statement -Lsrc/main -Lsrc/system"
  1066. echo "LPATHS = -Lsrc/lib/static -Lsrc/clib/static -Lsrc/real/static -Lsrc/cplex/static -Lsrc/main/function -Lsrc/main/statement -Lsrc/main -Lsrc/system"
  1067. echo "FLXCAT = build/flexcat/flexcat"
  1068. echo "MKDIR = mkdir -p"
  1069. echo "DEL = rm -f"
  1070. echo "INSTALLP = install -m 0755"
  1071. echo "INSTALLM = install -m 0644"
  1072. echo "PREFIX = ${prefix}"
  1073. echo "INSTDIRP = \${DESTDIR}\${PREFIX}/bin"
  1074. echo "INSTDIRM = \${DESTDIR}\${PREFIX}/${mandir}/man1"
  1075. echo
  1076. echo "all: shared-libs static-libs static-app"
  1077. echo "amath: shared-libs static-libs shared-app"
  1078. echo "static: static-app"
  1079. echo "app: ${appmain} ${appfunction} ${appstatement} ${appsystem}"
  1080. echo "libs: ${amathapp} ${amath} ${amathc} ${amathcplex}"
  1081. echo
  1082. echo "${program}.o: ${program}.cpp"
  1083. echo " \${CXX} \${CXXFLAGS} -c ${program}.cpp -o ${program}.o"
  1084. echo
  1085. echo "${appmain}:"
  1086. echo " cd src/main && \${MAKE}"
  1087. echo
  1088. echo "${appsystem}:"
  1089. echo " cd src/system && \${MAKE}"
  1090. echo
  1091. echo "${appfunction}:"
  1092. echo " cd src/main/function && \${MAKE}"
  1093. echo
  1094. echo "${appstatement}:"
  1095. echo " cd src/main/statement && \${MAKE}"
  1096. echo
  1097. echo "${amathapp}:"
  1098. echo " cd src/lib && \${MAKE}"
  1099. echo
  1100. echo "${amath}:"
  1101. echo " cd src/real && \${MAKE}"
  1102. echo
  1103. echo "${amathc}:"
  1104. echo " cd src/clib && \${MAKE}"
  1105. echo
  1106. echo "${amathcplex}:"
  1107. echo " cd src/cplex && \${MAKE}"
  1108. echo
  1109. echo "locale:"
  1110. echo " cd build/flexcat && \${MAKE}"
  1111. echo " \${FLXCAT} text/keyword.cd src/loc/kword.h=text/keyword.sd"
  1112. echo " \${FLXCAT} text/help.cd src/loc/help.h=text/help.sd"
  1113. echo " \${FLXCAT} text/ident.cd src/loc/ident.h=text/ident.sd"
  1114. echo " \${FLXCAT} text/text.cd src/loc/text.h=text/text.sd"
  1115. echo
  1116. echo "doc:"
  1117. echo " cd src/clib && \${MAKE} doc"
  1118. echo " cd src/real && \${MAKE} doc"
  1119. echo " cd src/cplex && \${MAKE} doc"
  1120. echo
  1121. echo "catalogs:"
  1122. echo " cd build/flexcat && \${MAKE}"
  1123. echo " \${MKDIR} dist/catalog/english"
  1124. echo " \${FLXCAT} text/help.cd catalog/english/amath-help.ct CATALOG dist/catalog/english/amath-help.catalog"
  1125. echo " \${FLXCAT} text/ident.cd catalog/english/amath-ident.ct CATALOG dist/catalog/english/amath-ident.catalog"
  1126. echo " \${FLXCAT} text/text.cd catalog/english/amath-text.ct CATALOG dist/catalog/english/amath-text.catalog"
  1127. echo
  1128. echo "shared-libs:"
  1129. echo " cd src/lib && \${MAKE} shared"
  1130. echo " cd src/clib && \${MAKE} shared"
  1131. echo " cd src/real && \${MAKE} shared"
  1132. echo " cd src/cplex && \${MAKE} shared"
  1133. echo
  1134. echo "static-libs:"
  1135. echo " cd src/lib && \${MAKE} static"
  1136. echo " cd src/clib && \${MAKE} static"
  1137. echo " cd src/real && \${MAKE} static"
  1138. echo " cd src/cplex && \${MAKE} static"
  1139. echo
  1140. echo "shared-app: app shared-libs ${program}.o"
  1141. echo " \${CC} \${CFLAGS} ${exestrip} ${program}.o -o amath \${LPATH} \${LFLAGS}"
  1142. echo
  1143. echo "static-app: app static-libs ${program}.o"
  1144. echo " \${CC} \${CFLAGS} ${exestrip} ${program}.o -o amath \${LPATHS} \${LFLAGS}"
  1145. echo
  1146. echo ".PHONY: test"
  1147. echo "test: amath"
  1148. echo " LD_LIBRARY_PATH=src/clib/:src/lib:src/cplex:scr/real"
  1149. echo " ./amath --test"
  1150. echo
  1151. echo ".PHONY: install"
  1152. echo "install:"
  1153. echo " cd src/lib && \${MAKE} install"
  1154. echo " cd src/clib && \${MAKE} install"
  1155. echo " cd src/real && \${MAKE} install"
  1156. echo " cd src/cplex && \${MAKE} install"
  1157. echo " \${INSTALLP} amath \${INSTDIRP}/amath"
  1158. echo " \${INSTALLM} amath.1 \${INSTDIRM}/amath.1"
  1159. echo
  1160. echo ".PHONY: uninstall"
  1161. echo "uninstall:"
  1162. echo " cd src/lib && \${MAKE} uninstall"
  1163. echo " cd src/clib && \${MAKE} uninstall"
  1164. echo " cd src/real && \${MAKE} uninstall"
  1165. echo " cd src/cplex && \${MAKE} uninstall"
  1166. echo " \${DEL} \${INSTDIRP}/amath"
  1167. echo " \${DEL} \${INSTDIRM}/amath.1"
  1168. echo
  1169. echo ".PHONY: clean"
  1170. echo "clean:"
  1171. echo " cd src/lib && \${MAKE} clean"
  1172. echo " cd src/clib && \${MAKE} clean"
  1173. echo " cd src/real && \${MAKE} clean"
  1174. echo " cd src/cplex && \${MAKE} clean"
  1175. echo " cd src/main && \${MAKE} clean"
  1176. echo " cd src/system && \${MAKE} clean"
  1177. echo " cd src/main/function && \${MAKE} clean"
  1178. echo " cd src/main/statement && \${MAKE} clean"
  1179. echo " cd build/flexcat && \${MAKE} clean"
  1180. echo " \${DEL} ${program}.o amath"
  1181. echo
  1182. echo ".PHONY: very-clean"
  1183. echo "very-clean: clean"
  1184. echo " cd src/lib && \${MAKE} very-clean"
  1185. echo " cd src/clib && \${MAKE} very-clean"
  1186. echo " cd src/real && \${MAKE} very-clean"
  1187. echo " cd src/cplex && \${MAKE} very-clean"
  1188. echo
  1189. } > Makefile
  1190. #########################################################################
  1191. ################################ Flexcat ################################
  1192. {
  1193. echo 'all: flexcat'
  1194. echo ''
  1195. echo "CFLAGS += -I. -Wall"
  1196. echo ''
  1197. l=""
  1198. for f in ${FLXSRCS}
  1199. do
  1200. b=`basename $f .c`
  1201. echo "${b}.o: ${f}"
  1202. echo " \${CC} \${CFLAGS} -c ${f}"
  1203. echo
  1204. l="${l} ${b}.o"
  1205. done
  1206. echo
  1207. echo "flexcat: ${l}"
  1208. echo " \${CC} \${CFLAGS} -o flexcat ${l} -lm"
  1209. echo
  1210. echo "clean:"
  1211. echo " rm -f ${l} flexcat"
  1212. echo
  1213. } > build/flexcat/Makefile
  1214. #########################################################################
  1215. echo "Makefile generated"