home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / awk / gawk215s.zip / gawk2154 / Makefile.dec < prev    next >
Makefile  |  1993-12-29  |  8KB  |  270 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=         cc
  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 = -Olimit 1500
  87. FLAGS = -DGAWK -DHAVE_CONFIG_H $(VFLAGS) $(DEBUG) $(PROFILE) $(WARN) -Dconst=""
  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
  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. regex.o: regex.h awk.h
  141.     $(CC) $(FLAGS) -c regex.c
  142.  
  143. $(AWKOBJS) regex.o dfa.o:    awk.h dfa.h regex.h
  144.  
  145. getopt.o:    getopt.h
  146.  
  147. getopt1.o:    getopt.h
  148.  
  149. main.o:    patchlevel.h
  150.  
  151. awktab.c:    awk.y
  152.     $(PARSER) -v awk.y
  153. ##MAKE_VMS-Posix##     mv ytab.c awktab.c
  154. ##MAKE_VMS-Posix## dummy.awk_tab.target:
  155.     sed '/^extern char .malloc(), .realloc();$$/d' y.tab.c >awktab.c
  156.     rm y.tab.c
  157.  
  158. awktab.o:    awk.h
  159.  
  160. config.h:    config.in
  161.     @echo You must provide a config.h!
  162.     @echo Run \"./configure\" to build it for known systems
  163.     @echo or copy config.in to config.h and edit it.; exit 1
  164.  
  165. install:    gawk gawk.info
  166.     cp gawk $(bindir) && chmod 755 $(bindir)/gawk
  167.     cp gawk.1 $(mandir)/gawk$(manext) && chmod 644 $(mandir)/gawk$(manext)
  168.     cp gawk.info* $(infodir) && chmod 644 $(infodir)/gawk.info*
  169.  
  170. uninstall:
  171.     rm -f $(bindir)/gawk $(mandir)/gawk$(manext) $(infodir)/gawk.info*
  172.  
  173. # ALLOCA: uncomment this if your system (notably System V boxen)
  174. # does not have alloca in /lib/libc.a or /lib/libPW.a
  175. #
  176. # If your machine is not supported by the assembly version of alloca.s,
  177. # use the C version which follows instead.  It uses the default rules to
  178. # make alloca.o.
  179. #
  180. # One of these rules should have already been selected by running configure.
  181.  
  182.  
  183. ##MAKE_ALLOCA_S## alloca.o:    alloca.s
  184. ##MAKE_ALLOCA_S##     /lib/cpp < alloca.s | sed '/^#/d' > t.s
  185. ##MAKE_ALLOCA_S##     as t.s -o alloca.o
  186. ##MAKE_ALLOCA_S##     rm t.s
  187.  
  188. ##MAKE_ALLOCA_C## alloca.o:    alloca.c
  189.  
  190. # auxiliary rules for release maintenance
  191. lint:    $(ALLSRC)
  192.     lint -hcbax $(FLAGS) $(ALLSRC)
  193.  
  194. xref:
  195.     cxref -c $(FLAGS) $(ALLSRC) | grep -v '    /' >xref
  196.  
  197. clean:
  198.     rm -rf gawk *.o core
  199.     cd test && make clean
  200.  
  201. distclean:    clean
  202.     rm -f Makefile *.orig *.rej */*.orig */*.rej awk.output gmon.out \
  203.         make.out y.output config.h
  204.  
  205. mostlyclean:    clean
  206.  
  207. realclean:    distclean
  208.     rm -f awktab.c $(ALLDOC)
  209.  
  210. cleaner:    clean
  211.     rm -f gawk awktab.c Makefile config.h
  212.  
  213. clobber:    clean
  214.     rm -f $(ALLDOC) gawk.log config.h
  215.  
  216. gawk.dvi:    gawk.texi
  217.     cp support/texinfo.tex .
  218.     tex gawk.texi; texindex gawk.??
  219.     tex gawk.texi; texindex gawk.??
  220.     tex gawk.texi
  221.     rm -f texinfo.tex
  222.  
  223. gawk.info:    gawk.texi
  224.     makeinfo gawk.texi
  225.  
  226. dist:    $(AWKSRC) $(GNUSRC) $(DOCS) $(MISC) $(COPIES) $(SUPPORT) distclean
  227.     -rm -rf gawk-$(REL)*
  228.     dir=gawk-$(REL).`gawk '{print $$3}' patchlevel.h` && \
  229.     mkdir $$dir && \
  230.     cp -p $(AWKSRC) $(GNUSRC) $(DOCS) $(MISC) $$dir && \
  231.     mkdir $$dir/missing && cp -p $(COPIES) $$dir/missing && \
  232.     mkdir $$dir/atari && cp -p  atari/* $$dir/atari && \
  233.     mkdir $$dir/pc && cp -p pc/* $$dir/pc && \
  234.     mkdir $$dir/vms && cp -p vms/* $$dir/vms && \
  235.     mkdir $$dir/config && cp -p config/* $$dir/config && \
  236.     mkdir $$dir/support && cp -p support/* $$dir/support && \
  237.     cp -pr test $$dir && \
  238.     chmod -R a+r $$dir && \
  239.     chmod -R a-w $$dir && \
  240.     find $$dir -type d -exec chmod 755 {} ';' && \
  241.     find $$dir -print | doschk && \
  242.     tar -cf - $$dir | gzip > $$dir.tar.gz && \
  243.     rm -fr $$dir
  244.  
  245. gawk-doc-$(REL).tar.gz:    gawk.info gawk.dvi gawk.1
  246.     -rm -rf gawk-doc-$(REL) gawk-doc-$(REL).tar.gz
  247.     -mkdir gawk-doc-$(REL)
  248.     cp -p $(ALLDOC) gawk-doc-$(REL)
  249.     groff -Tascii -man gawk.1 > gawk-doc-$(REL)/gawk.1.pr
  250.     tar -cf - gawk-doc-$(REL) | gzip > gawk-doc-$(REL).tar.gz
  251.  
  252. gawk-ps-$(REL).tar.gz:    gawk.dvi gawk.1
  253.     -rm -rf gawk-ps-$(REL) gawk-ps-$(REL).tar.gz
  254.     -mkdir gawk-ps-$(REL)
  255.     dvips -o gawk-ps-$(REL)/gawk.postscript gawk.dvi
  256.     groff -man gawk.1 > gawk-ps-$(REL)/gawk.1.ps
  257.     tar -cf - gawk-ps-$(REL) | gzip > gawk-ps-$(REL).tar.gz
  258.  
  259. release:    dist gawk-doc-$(REL).tar.gz gawk-ps-$(REL).tar.gz
  260.  
  261. test:    gawk
  262.     cd test; make -k
  263.  
  264. check:    test
  265.  
  266.