home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / gnu / gawk213s.lzh / GAWK213S / MAKEFILE.-DI < prev    next >
Text File  |  1993-07-29  |  7KB  |  255 lines

  1. # Makefile for GNU Awk.
  2. #
  3. # Copyright (C) 1986, 1988, 1989 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 1, or (at your option)
  9. # 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, 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. # User tunable macros -- CHANGE THESE IN Makefile-dist RATHER THAN IN 
  19. # Makefile, OR configure WILL OVERWRITE YOUR CHANGES
  20.  
  21. DESTDIR=
  22. BINDIR=    /usr/local/bin
  23. MANDIR=    /usr/man/manl
  24. MANEXT=    l
  25.  
  26. # CFLAGS: options to the C compiler
  27. #
  28. #    -O    optimize
  29. #    -g    include dbx/sdb info
  30. #    -pg    include new (gmon) profiling info
  31. #
  32. #    The provided "configure" is used to turn a config file (samples in
  33. #    the "config" directory into commands to edit config.h-dist into
  34. #    a suitable config.h and to edit Makefile-dist 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.h-dist
  37. #    as a guide.
  38. #
  39.  
  40. CC=         cc
  41.  
  42. OPTIMIZE=    -g -O #-fstrength-reduce
  43. PROFILE=    #-pg
  44. DEBUG=        #-DMALLOCDEBUG #-DMEMDEBUG #-DDEBUG #-DFUNC_TRACE #-DMPROF
  45. LINKSTATIC=    #-Bstatic
  46. WARN=        #-W -Wunused -Wimplicit -Wreturn-type -Wcomment    # for gcc only
  47.  
  48. # Parser to use on grammar - any one of the following will work
  49. PARSER = yacc
  50. #PARSER = byacc
  51. #PARSER = bison -y
  52.  
  53. # Set LIBS to any libraries that are machine specific
  54. LIBS =
  55.  
  56. # Cray 2 running Unicos 5.0.7
  57. ##MAKE_LIBNET## LIBS = -lnet
  58.  
  59. ##MAKE_NeXT## FLAGS = -DGFMT_WORKAROUND
  60.  
  61. # Systems with alloca in /lib/libPW.a
  62. ##MAKE_ALLOCA_PW## LIBS = -lPW
  63.  
  64. # ALLOCA - only needed if you use bison
  65. #    Set equal to alloca.o if your system is S5 and you don't have
  66. #    alloca. Uncomment one of the rules below to make alloca.o from
  67. #    either alloca.s or alloca.c.
  68. #    This should have already been done automatically by configure.
  69. #
  70. #    Some systems have alloca in libPW.a, so LIBS=-lPW may work, too.
  71. ##MAKE_ALLOCA_C## ALLOCA= alloca.o
  72. ##MAKE_ALLOCA_S## ALLOCA= alloca.o
  73.  
  74. ##MAKE_RS6000## FLAGS = -qchars=signed
  75.  
  76. # HP/Apollo running cc version 6.7 or earlier
  77. ##MAKE_Apollo## FLAGS = -U__STDC__ -A run,sys5.3
  78. ##MAKE_Apollo## LIBS = -A sys,any
  79.  
  80. CFLAGS= $(FLAGS) $(DEBUG) $(LINKSTATIC) $(PROFILE) $(OPTIMIZE) $(WARN)
  81.  
  82. # object files
  83. AWKOBJS = main.o eval.o builtin.o msg.o iop.o io.o field.o array.o \
  84.     node.o version.o missing.o re.o
  85.  
  86. ALLOBJS = $(AWKOBJS) awk.tab.o
  87.  
  88. # GNUOBJS
  89. #    GNU stuff that gawk uses as library routines.
  90. GNUOBJS= regex.o dfa.o $(ALLOCA)
  91.  
  92. # source and documentation files
  93. SRC =    main.c eval.c builtin.c msg.c version.c \
  94.     iop.c io.c field.c array.c node.c missing.c re.c
  95.  
  96. ALLSRC= $(SRC) awk.tab.c
  97.  
  98. AWKSRC= awk.h awk.y $(ALLSRC) patchlevel.h protos.h config.h-dist
  99.  
  100. GNUSRC = alloca.c alloca.s dfa.c dfa.h regex.c regex.h
  101.  
  102. COPIES = missing/getopt.c missing/system.c missing/tzset.c \
  103.     missing/memcmp.c missing/memcpy.c missing/memset.c \
  104.     missing/random.c missing/strcase.c missing/strchr.c \
  105.     missing/strerror.c missing/strtod.c missing/vprintf.c \
  106.     missing/strftime.c missing/strftime.3 missing/strtol.c
  107.  
  108. SUPPORT = support/texindex.c support/texinfo.tex
  109.  
  110. DOCS= gawk.1 gawk.texinfo
  111.  
  112. INFOFILES= gawk-info gawk-info-1 gawk-info-2 gawk-info-3 gawk-info-4 \
  113.        gawk-info-5 gawk-info-6 gawk.aux gawk.cp gawk.cps gawk.fn \
  114.        gawk.fns gawk.ky gawk.kys gawk.pg gawk.pgs gawk.toc \
  115.        gawk.tp gawk.tps gawk.vr gawk.vrs
  116.  
  117. MISC =    CHANGES COPYING FUTURES Makefile-dist PROBLEMS README* PORTS mkconf \
  118.     mungeconf configure ACKNOWLEDGMENT LIMITATIONS
  119.  
  120. OTHERS= pc/* atari/* vms/*
  121.  
  122. ALLDOC= gawk.dvi $(INFOFILES)
  123.  
  124. ALLFILES= $(AWKSRC) $(GNUSRC) $(COPIES) $(MISC) $(DOCS) $(ALLDOC) $(OTHERS) \
  125.       $(SUPPORT)
  126.  
  127. # Release of gawk.  There can be no leading or trailing white space here!
  128. REL=2.13
  129.  
  130. # rules to build gawk
  131. gawk: $(ALLOBJS) $(GNUOBJS) $(REOBJS)
  132.     $(CC) -o gawk $(CFLAGS) $(ALLOBJS) $(GNUOBJS) $(REOBJS) -lm $(LIBS)
  133.  
  134. $(AWKOBJS): awk.h config.h
  135.  
  136. dfa.o:    awk.h config.h dfa.h
  137.  
  138. regex.o:    awk.h config.h regex.h
  139.  
  140. main.o: patchlevel.h
  141.  
  142. awk.tab.o: awk.h awk.tab.c
  143.  
  144. awk.tab.c: awk.y
  145.     $(PARSER) -v awk.y
  146.     sed '/^extern char .malloc(), .realloc();$$/d' y.tab.c >awk.tab.c
  147.     rm y.tab.c
  148.  
  149. config.h: config.h-dist
  150.     @echo You must provide a config.h!
  151.     @echo Run \"./configure\" to build it for known systems
  152.     @echo or copy config.h-dist to config.h and edit it.; exit 1
  153.  
  154. install: gawk
  155.     install -s gawk $(DESTDIR)$(BINDIR)
  156.     install -c gawk.1 $(DESTDIR)$(MANDIR)/gawk.$(MANEXT)
  157.  
  158. # ALLOCA: uncomment this if your system (notably System V boxen)
  159. # does not have alloca in /lib/libc.a or /lib/libPW.a
  160. #
  161. # If your machine is not supported by the assembly version of alloca.s,
  162. # use the C version which follows instead.  It uses the default rules to
  163. # make alloca.o.
  164. #
  165. # One of these rules should have already been selected by running configure.
  166.  
  167.  
  168. ##MAKE_ALLOCA_S## alloca.o: alloca.s
  169. ##MAKE_ALLOCA_S##     /lib/cpp < alloca.s | sed '/^#/d' > t.s
  170. ##MAKE_ALLOCA_S##     as t.s -o alloca.o
  171. ##MAKE_ALLOCA_S##     rm t.s
  172.  
  173. ##MAKE_ALLOCA_C## alloca.o: alloca.c
  174.  
  175. # auxiliary rules for release maintenance
  176. lint: $(ALLSRC)
  177.     lint -hcbax $(FLAGS) $(ALLSRC)
  178.  
  179. xref:
  180.     cxref -c $(FLAGS) $(ALLSRC) | grep -v '    /' >xref
  181.  
  182. clean:
  183.     rm -f *.o core awk.output gmon.out make.out y.output
  184.  
  185. cleaner:    clean
  186.     rm -f gawk awk.tab.c
  187.  
  188. clobber: clean
  189.     rm -f $(ALLDOC) gawk.log
  190.  
  191. gawk.dvi: gawk.texinfo
  192.     tex gawk.texinfo ; texindex gawk.??
  193.     tex gawk.texinfo ; texindex gawk.??
  194.     tex gawk.texinfo
  195.  
  196. $(INFOFILES): gawk.texinfo
  197.     makeinfo gawk.texinfo
  198.  
  199. gawk-test-$(REL).tar.Z::
  200.     -rm -f gawk-test-$(REL).tar.Z
  201.     tar -cf - test | compress >gawk-test-$(REL).tar.Z
  202.  
  203. dist:    $(AWKSRC) $(GNUSRC) $(DOCS) $(MISC) $(COPIES) $(SUPPORT)
  204.     configure msdos
  205.     mv config.h pc
  206.     -rm -rf gawk-$(REL) gawk-$(REL).*.tar.Z
  207.     -mkdir gawk-$(REL)
  208.     cp -p $(AWKSRC) $(GNUSRC) $(DOCS) $(MISC) gawk-$(REL)
  209.     -mkdir gawk-$(REL)/missing
  210.     cp -p $(COPIES) gawk-$(REL)/missing
  211.     -mkdir gawk-$(REL)/atari
  212.     cp -p  atari/* gawk-$(REL)/atari
  213.     -mkdir gawk-$(REL)/pc
  214.     cp -p pc/* gawk-$(REL)/pc
  215.     -mkdir gawk-$(REL)/vms
  216.     cp -p vms/* gawk-$(REL)/vms
  217.     -mkdir gawk-$(REL)/config
  218.     cp -p config/* gawk-$(REL)/config
  219.     -mkdir gawk-$(REL)/support
  220.     cp -p support/* gawk-$(REL)/support
  221.     ln -s ../test gawk-$(REL)
  222.     tar -cfh - gawk-$(REL) | compress > gawk-$(REL).`gawk '{print $$3}' patchlevel.h`.tar.Z
  223.  
  224. gawk-doc-$(REL).tar.Z: $(ALLDOC)
  225.     -rm -rf gawk-doc-$(REL) gawk-doc-$(REL).tar.Z
  226.     -mkdir gawk-doc-$(REL)
  227.     cp -p $(INFOFILES) gawk.dvi gawk-doc-$(REL)
  228.     nroff -man gawk.1 > gawk-doc-$(REL)/gawk.1.pr
  229.     tar -cf - gawk-$(REL)-doc | compress > gawk-doc-$(REL).tar.Z
  230.  
  231. gawk-ps-$(REL).tar.Z: gawk-ps-$(REL).tar.Z
  232.     -rm -rf gawk-ps-$(REL) gawk-ps-$(REL).tar.Z
  233.     -mkdir gawk-ps-$(REL)
  234.     dvips -o !cat gawk.dvi > gawk-ps-$(REL)/gawk.postscript
  235.     pstroff -man gawk.1 > gawk-ps-$(REL)/gawk.1.ps
  236.     tar -cf - gawk-ps-$(REL) | compress > gawk-ps-$(REL).tar.Z
  237.  
  238. release: gawk-src-$(REL).tar.Z gawk-doc-$(REL).tar.Z gawk-ps-$(REL).tar.Z \
  239.      gawk-test-$(REL).tar.Z
  240.  
  241. diff:
  242.     for i in RCS/*; do rcsdiff -c -b $$i > `basename $$i ,v`.diff; done
  243.  
  244. test::
  245.     make gawk
  246.     cd test; make -k
  247.  
  248. bigtest::
  249.     make gawk
  250.     cd test; make -k bigtest
  251.