home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / bc-1.03-src.tgz / tar.out / fsf / bc / Makefile.in < prev    next >
Makefile  |  1996-09-28  |  9KB  |  335 lines

  1. # Makefile for GNU bc and dc.    -*- Indented-Text -*-
  2. # Copyright (C) 1993, 1994 Free Software Foundation, Inc.
  3.  
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8.  
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13.  
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. # @configure_input@
  19.  
  20. #### Start of system configuration section. ####
  21.  
  22. srcdir = @srcdir@
  23. VPATH = @srcdir@
  24.  
  25. prefix = @prefix@
  26. exec_prefix = @exec_prefix@
  27.  
  28. bindir = $(exec_prefix)/bin
  29. datadir = $(prefix)/lib
  30. libdir = $(prefix)/lib
  31. infodir = $(prefix)/info
  32. guidedir = $(prefix)/guide
  33. dvidir = $(prefix)/dvi
  34. psdir = $(prefix)/ps
  35.  
  36. # Where to install the manual pages.
  37. mandir = $(prefix)/man/man1
  38. # Extension (not including `.') for the installed manual page filenames.
  39. manext = 1
  40.  
  41. #
  42. # This is the name of the library file, if needed.  This definition should
  43. # not be deleted.
  44. #
  45. LIBFILE = $(libdir)/libmath.b
  46.  
  47. #
  48. # Programs definitions for use by make.
  49. #
  50.  
  51. SHELL = /bin/sh
  52. YACC = @YACC@
  53. LEX = @LEX@
  54. CC = @CC@
  55.  
  56. INSTALL = @INSTALL@
  57. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  58. INSTALL_DATA = @INSTALL_DATA@
  59.  
  60. UUENCODE = uue
  61.  
  62. LIBS = @LIBS@ @LEXLIB@
  63.  
  64. CPPFLAGS = @CPPFLAGS@
  65. LDFLAGS = @LDFLAGS@
  66.  
  67. MAKEINFO = makeinfo
  68. TEXI2DVI = texi2dvi
  69. DVIPS = dvips
  70.  
  71. # stuff for cflags
  72.  
  73. STDDEFS = -D_POSIX_SOURCE -DDOT_IS_LAST
  74. INCDIR = -I. -I$(srcdir)
  75.  
  76. #
  77. #  The following are the standard definitions.  For MINIX PC, you need to
  78. #  comment these out and select one of the MINIX PC definition sets.
  79. #  Other configuration defines are generated automatically.  See the 
  80. #  README file for more details.
  81. #
  82. O=o
  83. CFLAGS = -O $(INCDIR) $(STDDEFS) @CFLAGS@
  84. LDFLAGS = 
  85. #
  86. # For the PC version of MINIX (K&R compiler), use the following lines.
  87. #O=s
  88. #CFLAGS = -O $(INCDIR) $(STDDEFS) @CFLAGS@
  89. #LDFLAGS = -i
  90. #
  91. # For the PC version of MINIX (ANSI compiler), use the following lines:
  92. #O=o
  93. #CFLAGS = -m $(INCDIR) $(STDDEFS) @CFLAGS@
  94. #LDFLAGS = -i
  95. #
  96. #
  97. DISTFILES = COPYING Makefile.in Install bc.y bcdefs.h const.h version.h \
  98.             execute.c global.c global.h load.c main.c number.c storage.c \
  99.         number.h proto.h scan.l util.c vfprintf.c README bc.1 sbc.y \
  100.         fix_libmath.h libmath.b configure configure.in config.h.in \
  101.         acconfig.h ChangeLog \
  102.         dc.1 dc.texinfo dc.guide dc.dvi dc.ps \
  103.          dc-array.c dc-eval.c dc-misc.c dc-number.c dc-stack.c \
  104.         dc-string.c dc.h dc-proto.h dc-regdef.h dc-version.h \
  105.         install-sh
  106. #
  107. BCOFILES = scan.$O util.$O main.$O number.$O storage.$O load.$O execute.$O 
  108. DCOFILES = dc-misc.$O dc-eval.$O dc-stack.$O dc-array.$O dc-string.$O \
  109.        dc-number.$O
  110. #
  111. SUBDIRS = Examples Test
  112. #
  113. EXTRAFILES = bc.c.dist scan.c.dist y.tab.h.dist libmath.h dc.info dc.guide dc.dvi dc.ps
  114. #
  115.  
  116. all: bc dc dc.info dc.guide dc.dvi dc.ps
  117.  
  118. ### targets required by GNU Coding standards ###
  119.  
  120. Makefile: Makefile.in config.status
  121.     ./config.status
  122.  
  123. #config.status: configure
  124. #    $(srcdir)/configure --srcdir=$(srcdir) --no-create
  125. #
  126. #configure: configure.in
  127. #    cd $(srcdir); autoconf
  128.  
  129. bc: $& config.h bc.$O $(BCOFILES) global.$O
  130.     $(CC) $(LDFLAGS) -o bc bc.$O $(BCOFILES) global.$O $(LIBS)
  131.  
  132. dc: $(DCOFILES) number.o
  133.     $(CC) $(LDFLAGS) -o dc $(DCOFILES) number.o $(LIBS)
  134.  
  135. sbc: sbc.$O $(BCOFILES) global.$O
  136.     $(CC) -o sbc $(LDFLAGS) sbc.$O $(BCOFILES) global.$O $(LIBS)
  137.  
  138. config.h.in:
  139.     autoheader
  140.  
  141. config.h:    config.h.in configure
  142.     $(SHELL) $(srcdir)/configure
  143.  
  144. libmath.h: libmath.b
  145.     $(MAKE) fbc
  146.     ./fbc -c libmath.b </dev/null >libmath.h
  147.     ./fix_libmath.h
  148.     rm -f ./fbc
  149.  
  150. fbc: $(BCOFILES) bc.$O
  151.     echo \"\" > libmath.h
  152.     $(CC) -c $(CFLAGS) global.c
  153.     $(CC) -o fbc $(LDFLAGS) bc.$O $(BCOFILES) global.$O $(LEXLIB)
  154.  
  155. install: installdirs bc libmath.b config.h
  156.     rm -f $(bindir)/bc $(bindir)/dc
  157.     $(INSTALL_PROGRAM) bc $(bindir)
  158.     $(INSTALL_PROGRAM) dc $(bindir)
  159.     chmod 555 $(bindir)/bc $(bindir)/dc
  160.     if grep -s "define BC_MATH_FILE" config.h; \
  161.       then rm -f $(libdir)/libmath.b; \
  162.       $(INSTALL_DATA) $(srcdir)/libmath.b $(libdir); \
  163.       chmod 444 $(libdir)/libmath.b; \
  164.       else true; \
  165.     fi
  166.     $(INSTALL_DATA) $(srcdir)/bc.1 $(mandir)
  167.     $(INSTALL_DATA) $(srcdir)/dc.1 $(mandir)
  168.     $(INSTALL_DATA) dc.info $(infodir)
  169.     $(INSTALL_DATA) dc.guide $(guidedir)
  170.     $(INSTALL_DATA) dc.dvi $(dvidir)
  171.     $(INSTALL_DATA) dc.ps $(psdir)
  172.  
  173. installdirs:
  174.     if [ -d $(prefix) ]; then true; else mkdir $(prefix); fi
  175.     if [ -d $(bindir) ]; then true; else mkdir $(bindir); fi
  176.     -if grep -s "define BC_MATH_FILE" config.h; \
  177.       then if [ -d $(libdir) ]; then true; else mkdir $(libdir); fi; \
  178.       else true; \
  179.     fi
  180.     if [ -d $(prefix) ]; then true; else mkdir $(mandir); fi
  181.     if [ -d $(infodir) ]; then true; else mkdir $(infodir); fi
  182.     if [ -d $(guidedir) ]; then true; else mkdir $(guidedir); fi
  183.     if [ -d $(dvidir) ]; then true; else mkdir $(dvidir); fi
  184.     if [ -d $(psdir) ]; then true; else mkdir $(psdir); fi
  185.  
  186. uninstall: 
  187.     rm -f $(bindir)/bc $(bindir)/dc
  188.     if grep -s "define BC_MATH_FILE" config.h; \
  189.       then rm -f $(libdir)/libmath.b; \
  190.       else true; \
  191.     fi
  192.     rm -f $(mandir)/bc1 $(mandir)/dc.1
  193.     rm -f $(infodir)/dc.info
  194.     rm -f $(guidedir)/dc.guide
  195.     rm -f $(dvidir)/dc.dvi
  196.     rm -f $(psdir)/dc.ps
  197.  
  198. dist: $(EXTRAFILES)
  199.     OF=`sed -n 's/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/bc-\1/p' version.h` \
  200.     ; rm -rf $$OF \
  201.     ; mkdir $$OF \
  202.     ; chmod 777 $$OF \
  203.     ; for file in $(DISTFILES) ; do ln $(srcdir)/$$file $$OF/$$file; done \
  204.     ; for file in $(EXTRAFILES) ; do ln $$file $$OF/$$file; done \
  205.     ; for dir in $(SUBDIRS); do \
  206.        mkdir $$OF/$$dir ; chmod 777 $$OF/$$dir ; \
  207.        cp $(srcdir)/$$dir/* $$OF/$$dir; done \
  208.     ; tar cf $$OF.tar $$OF \
  209.     ; gzip $$OF.tar \
  210.     ; rm -rf $$OF
  211.  
  212. shars: dist
  213.     OF=`sed -n 's/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/bc-\1/p' version.h` \
  214.     ; $(UUENCODE) $$OF.tar.Z - > $$OF.uue \
  215.     ; split -775 $$OF.uue $$OF-u. \
  216.     ; for file in $$OF-u.a?; do shar $$file > $$file.sh; done
  217.  
  218. minixdist: $(EXTRAFILES)
  219.     OF=`sed -n 's/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/bc-\1/p' version.h` \
  220.     ; rm -rf $$OF \
  221.     ; mkdir $$OF \
  222.     ; cd $$OF \
  223.     ; for file in $(DISTFILES) $(EXTRAFILES); do ln ../$$file; done \
  224.     ; cd .. \
  225.     ; tar cf $$OF.tar $$OF \
  226.     ; gzip $$OF.tar \
  227.     ; rm -rf $$OF
  228.  
  229. minixshars: minixdist
  230.     OF=`sed -n 's/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/bc-\1/p' version.h` \
  231.     ; $(UUENCODE) $$OF.tar.Z - > $$OF.uue \
  232.     ; split -775 $$OF.uue $$OF-u. \
  233.     ; for file in $$OF-u.a?; do shar $$file > $$file.sh; done
  234.  
  235. csrshars: $(EXTRAFILES)
  236.     findsrc -dy $(DISTFILES) $(EXTRAFILES) $(SUBDIRS) | \
  237.     makekit -npart -oMANIFEST
  238.  
  239. bc.c.dist: bc.c
  240.     cp bc.c bc.c.dist
  241.  
  242. scan.c.dist: scan.c
  243.     cp scan.c scan.c.dist
  244.  
  245. y.tab.h.dist: y.tab.h
  246.     cp y.tab.h y.tab.h.dist
  247.  
  248. extra:  $(EXTRAFILES)
  249.  
  250. # assumes that the extra files exist!
  251. derived: 
  252.     @if [ ! -f $(srcdir)/bc.c.dist ] ; then \
  253.       echo "You do not have a complete distribution.  Get a new copy or"; \
  254.       echo "see if you can make the derived files using lex and yacc."; \
  255.       exit 1; \
  256.     fi
  257.     cp $(srcdir)/bc.c.dist bc.c
  258.     cp $(srcdir)/scan.c.dist scan.c
  259.     cp $(srcdir)/y.tab.h.dist y.tab.h
  260.  
  261. clean:
  262.     rm -f *.$O core ERRS *~ *.bak *.Z 
  263.  
  264. distclean: clean
  265.     rm -f scan.c y.tab.h bc.c sbc.c bc sbc bc-dist* config.h  bc-*.* \
  266.     dc part?? MANIFEST* config.h config.status config.log config.cache \
  267.     Makefile *.aux *.cp *.dvi *.fn *.ky *.log *.pg *.toc *.tp *.vr
  268.  
  269. mostlyclean: distclean
  270.  
  271. realclean: distclean
  272.     rm -rf *.dist configure libmath.h dc.info dc.guide dc.dvi dc.ps config.h.in
  273.  
  274. scan.c: scan.l
  275.     $(LEX) $(srcdir)/scan.l
  276.     mv lex.yy.c scan.c
  277.  
  278. y.tab.h bc.c: bc.y
  279.     @echo "expect 1 shift/reduce conflict"
  280.     $(YACC) -d $(srcdir)/bc.y
  281.     mv y.tab.c bc.c
  282.  
  283. sbc.c: sbc.y
  284.     $(YACC) -d $(srcdir)/sbc.y
  285.     mv y.tab.c sbc.c
  286.  
  287. # Information files
  288. info: dc.info
  289. guide: dc.guide
  290. dvi: dc.dvi
  291. ps: dc.ps
  292.  
  293. #bc.info: bc.texinfo
  294. #    $(MAKEINFO) -I$(srcdir) --no-split bc.texinfo
  295. #
  296. #bc.dvi: bc.texinfo
  297. #    $(TEXI2DVI) $(srcdir)/bc.texinfo
  298.  
  299. dc.info: dc.texinfo
  300.     $(MAKEINFO) -I$(srcdir) --no-split dc.texinfo
  301.  
  302. dc.guide: dc.texinfo
  303.     $(MAKEINFO) -I$(srcdir) --no-split dc.texinfo --amiga -o $@
  304.  
  305. dc.dvi: dc.texinfo
  306.     $(TEXI2DVI) $(srcdir)/dc.texinfo
  307.  
  308. dc.ps: dc.dvi
  309.     $(DVIPS) -o $@ $?
  310.  
  311. global.$O:  bcdefs.h global.h libmath.h global.c
  312. bc.$O:        bcdefs.h global.h bc.y
  313. execute.$O: bcdefs.h global.h execute.c
  314. load.$O:    bcdefs.h global.h load.c
  315. main.$O:    bcdefs.h global.h version.h main.c
  316. number.$O:  bcdefs.h Makefile number.c
  317. sbc.$O:     bcdefs.h global.h sbc.y
  318. scan.$O:    bcdefs.h global.h y.tab.h scan.c
  319. storage.$O: bcdefs.h global.h storage.c
  320. util.$O:    bcdefs.h global.h version.h util.c
  321.  
  322. bcdefs.h: number.h const.h config.h
  323.     touch bcdefs.h
  324.  
  325. dc-array.$O : dc-array.c config.h dc.h dc-proto.h dc-regdef.h 
  326. dc-eval.$O : dc-eval.c config.h dc.h dc-proto.h 
  327. dc-misc.$O : dc-misc.c config.h dc.h dc-proto.h dc-version.h 
  328. dc-number.$O : dc-number.c config.h bcdefs.h const.h version.h number.h \
  329.   proto.h global.h dc.h dc-proto.h 
  330. dc-stack.$O : dc-stack.c config.h dc.h dc-proto.h dc-regdef.h 
  331. dc-string.$O : dc-string.c config.h dc.h dc-proto.h 
  332. number.$O : number.c bcdefs.h config.h const.h version.h number.h proto.h 
  333.