home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / awk / gawk215s.zip / gawk2154 / Makefile.in < prev    next >
Makefile  |  1993-12-29  |  8KB  |  267 lines

  1. # Makefile for GNU Awk.
  2. #
  3. # Copyright (C) 1986, 1988-1993 the Free Software Foundation, Inc.
  4. # This file is part of GAWK, the GNU implementation of the
  5. # AWK Progamming Language.
  6. # GAWK is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. # GAWK is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14. # You should have received a copy of the GNU General Public License
  15. # along with GAWK; see the file COPYING.  If not, write to
  16. # the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. # User tunable macros -- CHANGE THESE IN Makefile.in RATHER THAN IN 
  19. # Makefile, OR configure WILL OVERWRITE YOUR CHANGES
  20.  
  21. prefix = /usr/local
  22. exec_prefix = $(prefix)
  23. binprefix =
  24. manprefix =
  25.  
  26. bindir = $(exec_prefix)/bin
  27. libdir = $(exec_prefix)/lib
  28. mandir = $(prefix)/man/man1
  29. manext = .1
  30. infodir = $(prefix)/info
  31.  
  32. #    The provided "configure" is used to turn a config file (samples in
  33. #    the "config" directory into commands to edit config.in into
  34. #    a suitable config.h and to edit Makefile.in into Makefile.
  35. #    To port GAWK, create an appropriate config file using the ones in
  36. #    the config directory as examples and using the comments in config.in
  37. #    as a guide.
  38.  
  39. CC=         gcc -g
  40. ##MAKE_CC## CC = cc
  41.  
  42. PROFILE=    #-pg
  43. DEBUG=        #-DMALLOCDEBUG #-DDEBUG #-DFUNC_TRACE #-DMPROF
  44. LINKSTATIC=    #-Bstatic
  45. WARN=        #-W -Wunused -Wimplicit -Wreturn-type -Wcomment    # for gcc only
  46.  
  47. # Parser to use on grammar - any one of the following will work
  48. PARSER = bison -y
  49. #PARSER = yacc
  50. #PARSER = byacc
  51.  
  52. # Set LIBS to any libraries that are machine specific
  53. LIBS =
  54.  
  55. # Cray 2 running Unicos 5.0.7
  56. ##MAKE_LIBNET## LIBS = -lnet
  57.  
  58.  
  59. # Systems with alloca in /lib/libPW.a
  60. ##MAKE_ALLOCA_PW## LIBS = -lPW
  61.  
  62. # ALLOCA - only needed if you use bison
  63. #    Set equal to alloca.o if your system is S5 and you don't have
  64. #    alloca. Uncomment one of the rules below to make alloca.o from
  65. #    either alloca.s or alloca.c.
  66. #    This should have already been done automatically by configure.
  67. #
  68. #    Some systems have alloca in libPW.a, so LIBS=-lPW may work, too.
  69. ##MAKE_ALLOCA_C## ALLOCA= alloca.o
  70. ##MAKE_ALLOCA_S## ALLOCA= alloca.o
  71.  
  72. VFLAGS=
  73.  
  74. # VMS POSIX, VAXC V3.2
  75. ##MAKE_VMS-Posix## VFLAGS = -UVMS -D__STDC__=0
  76.  
  77. # HP/Apollo running cc version 6.7 or earlier
  78. ##MAKE_Apollo## VFLAGS = -U__STDC__ -A run,sys5.3
  79. ##MAKE_Apollo## LIBS = -A sys,any
  80.  
  81. # SGI IRIX 4.0.5 cc flags
  82. ##MAKE_SGI## VFLAGS = -cckr
  83.  
  84. ##MAKE_NeXT## VFLAGS = -DGFMT_WORKAROUND
  85.  
  86. CFLAGS = -O
  87. FLAGS = -DGAWK -DHAVE_CONFIG_H $(VFLAGS) $(DEBUG) $(PROFILE) $(WARN)
  88. LDFLAGS = $(LINKSTATIC) $(PROFILE)
  89.  
  90. .c.o:
  91.     $(CC) $(CFLAGS) $(FLAGS) -c $<
  92.  
  93. # object files
  94. AWKOBJS = main.o eval.o builtin.o msg.o iop.o io.o field.o array.o \
  95.     node.o version.o missing.o re.o getopt.o getopt1.o
  96.  
  97. ALLOBJS = $(AWKOBJS) awktab.o
  98.  
  99. # GNUOBJS
  100. #    GNU stuff that gawk uses as library routines.
  101. GNUOBJS= regex.o dfa.o $(ALLOCA)
  102.  
  103. # source and documentation files
  104. SRC =    main.c eval.c builtin.c msg.c version.c \
  105.     iop.c io.c field.c array.c node.c missing.c re.c getopt.c getopt1.c
  106.  
  107. ALLSRC= $(SRC) awktab.c
  108.  
  109. AWKSRC= awk.h awk.y $(ALLSRC) patchlevel.h protos.h config.in getopt.h
  110.  
  111. GNUSRC = alloca.c alloca.s dfa.c dfa.h regex.c regex.h
  112.  
  113. COPIES = missing/system.c missing/tzset.c \
  114.     missing/memcmp.c missing/memcpy.c missing/memset.c \
  115.     missing/random.c missing/strncasecmp.c missing/strchr.c \
  116.     missing/strerror.c missing/strtod.c \
  117.     missing/strftime.c missing/strftime.3 
  118.  
  119. SUPPORT = support/texindex.c support/texinfo.tex
  120.  
  121. DOCS= gawk.1 gawk.texi
  122.  
  123. TEXFILES= gawk.aux gawk.cp gawk.cps gawk.fn gawk.fns gawk.ky gawk.kys \
  124.        gawk.pg gawk.pgs gawk.toc gawk.tp gawk.tps gawk.vr gawk.vrs
  125.  
  126. MISC =    NEWS COPYING FUTURES Makefile.* PROBLEMS README* PORTS POSIX \
  127.     mungeconf configure ACKNOWLEDGMENT LIMITATIONS INSTALL
  128.  
  129. OTHERS= pc/* atari/* vms/*
  130.  
  131. ALLDOC= gawk.dvi $(TEXFILES) gawk.info*
  132.  
  133. # Release of gawk.  There can be no leading or trailing white space here!
  134. REL=2.15
  135.  
  136. # rules to build gawk
  137. gawk:    $(ALLOBJS) $(GNUOBJS) $(REOBJS)
  138.     $(CC) -o gawk $(LDFLAGS) $(ALLOBJS) $(GNUOBJS) $(REOBJS) -lm $(LIBS)
  139.  
  140. $(AWKOBJS) regex.o dfa.o:    awk.h dfa.h regex.h
  141.  
  142. getopt.o:    getopt.h
  143.  
  144. getopt1.o:    getopt.h
  145.  
  146. main.o:    patchlevel.h
  147.  
  148. awktab.c:    awk.y
  149.     $(PARSER) -v awk.y
  150. ##MAKE_VMS-Posix##     mv ytab.c awktab.c
  151. ##MAKE_VMS-Posix## dummy.awk_tab.target:
  152.     sed '/^extern char .malloc(), .realloc();$$/d' y.tab.c >awktab.c
  153.     rm y.tab.c
  154.  
  155. awktab.o:    awk.h
  156.  
  157. config.h:    config.in
  158.     @echo You must provide a config.h!
  159.     @echo Run \"./configure\" to build it for known systems
  160.     @echo or copy config.in to config.h and edit it.; exit 1
  161.  
  162. install:    gawk gawk.info
  163.     cp gawk $(bindir) && chmod 755 $(bindir)/gawk
  164.     cp gawk.1 $(mandir)/gawk$(manext) && chmod 644 $(mandir)/gawk$(manext)
  165.     cp gawk.info* $(infodir) && chmod 644 $(infodir)/gawk.info*
  166.  
  167. uninstall:
  168.     rm -f $(bindir)/gawk $(mandir)/gawk$(manext) $(infodir)/gawk.info*
  169.  
  170. # ALLOCA: uncomment this if your system (notably System V boxen)
  171. # does not have alloca in /lib/libc.a or /lib/libPW.a
  172. #
  173. # If your machine is not supported by the assembly version of alloca.s,
  174. # use the C version which follows instead.  It uses the default rules to
  175. # make alloca.o.
  176. #
  177. # One of these rules should have already been selected by running configure.
  178.  
  179.  
  180. ##MAKE_ALLOCA_S## alloca.o:    alloca.s
  181. ##MAKE_ALLOCA_S##     /lib/cpp < alloca.s | sed '/^#/d' > t.s
  182. ##MAKE_ALLOCA_S##     as t.s -o alloca.o
  183. ##MAKE_ALLOCA_S##     rm t.s
  184.  
  185. ##MAKE_ALLOCA_C## alloca.o:    alloca.c
  186.  
  187. # auxiliary rules for release maintenance
  188. lint:    $(ALLSRC)
  189.     lint -hcbax $(FLAGS) $(ALLSRC)
  190.  
  191. xref:
  192.     cxref -c $(FLAGS) $(ALLSRC) | grep -v '    /' >xref
  193.  
  194. clean:
  195.     rm -rf gawk *.o core
  196.     cd test && make clean
  197.  
  198. distclean:    clean
  199.     rm -f Makefile *.orig *.rej */*.orig */*.rej awk.output gmon.out \
  200.         make.out y.output config.h
  201.  
  202. mostlyclean:    clean
  203.  
  204. realclean:    distclean
  205.     rm -f awktab.c $(ALLDOC)
  206.  
  207. cleaner:    clean
  208.     rm -f gawk awktab.c Makefile config.h
  209.  
  210. clobber:    clean
  211.     rm -f $(ALLDOC) gawk.log config.h
  212.  
  213. gawk.dvi:    gawk.texi
  214.     cp support/texinfo.tex .
  215.     tex gawk.texi; texindex gawk.??
  216.     tex gawk.texi; texindex gawk.??
  217.     tex gawk.texi
  218.     rm -f texinfo.tex
  219.  
  220. gawk.info:    gawk.texi
  221.     makeinfo gawk.texi
  222.  
  223. dist:    $(AWKSRC) $(GNUSRC) $(DOCS) $(MISC) $(COPIES) $(SUPPORT) distclean
  224.     -rm -rf gawk-$(REL)*
  225.     dir=gawk-$(REL).`gawk '{print $$3}' patchlevel.h` && \
  226.     mkdir $$dir && \
  227.     cp -p $(AWKSRC) $(GNUSRC) $(DOCS) $(MISC) $$dir && \
  228.     mkdir $$dir/missing && cp -p $(COPIES) $$dir/missing && \
  229.     mkdir $$dir/atari && cp -p  atari/* $$dir/atari && \
  230.     mkdir $$dir/pc && cp -p pc/* $$dir/pc && \
  231.     mkdir $$dir/vms && cp -p vms/* $$dir/vms && \
  232.     mkdir $$dir/config && cp -p config/* $$dir/config && \
  233.     mkdir $$dir/support && cp -p support/* $$dir/support && \
  234.     cp -pr test $$dir && \
  235.     chmod -R a+r $$dir && \
  236.     chmod -R a-w $$dir && \
  237.     find $$dir -type d -exec chmod 755 {} ';' && \
  238.     find $$dir -print | doschk && \
  239.     tar -cf - $$dir | gzip > $$dir.tar.gz && \
  240.     rm -fr $$dir
  241.  
  242. gawk-doc-$(REL).tar.gz:    gawk.info gawk.dvi gawk.1
  243.     -rm -rf gawk-doc-$(REL) gawk-doc-$(REL).tar.gz
  244.     -mkdir gawk-doc-$(REL)
  245.     cp -p $(ALLDOC) gawk-doc-$(REL)
  246.     groff -Tascii -man gawk.1 > gawk-doc-$(REL)/gawk.1.pr
  247.     tar -cf - gawk-doc-$(REL) | gzip > gawk-doc-$(REL).tar.gz
  248.  
  249. gawk-ps-$(REL).tar.gz:    gawk.dvi gawk.1
  250.     -rm -rf gawk-ps-$(REL) gawk-ps-$(REL).tar.gz
  251.     -mkdir gawk-ps-$(REL)
  252.     dvips -o gawk-ps-$(REL)/gawk.postscript gawk.dvi
  253.     groff -man gawk.1 > gawk-ps-$(REL)/gawk.1.ps
  254.     tar -cf - gawk-ps-$(REL) | gzip > gawk-ps-$(REL).tar.gz
  255.  
  256. release:    dist gawk-doc-$(REL).tar.gz gawk-ps-$(REL).tar.gz
  257.  
  258. test:    gawk
  259.     cd test; make -k
  260.  
  261. check:    test
  262.  
  263.