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