home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / unix / gawk.sit / source / Makefile < prev    next >
Makefile  |  1990-07-29  |  7KB  |  234 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
  19.  
  20. # CFLAGS: options to the C compiler
  21. #
  22. #    -O    optimize
  23. #    -g    include dbx/sdb info
  24. #    -gg    include gdb debugging info; only for GCC (deprecated)
  25. #    -pg    include new (gmon) profiling info
  26. #    -p    include old style profiling info (System V)
  27. #
  28. #    To port GAWK, examine and adjust the following flags carefully.
  29. #    In addition, you will have to look at alloca below.
  30. #    The intent (eventual) is to not penalize the most-standard-conforming
  31. #    systems with a lot of #define's.
  32. #
  33. #    -DBCOPY_MISSING        - bcopy() et al. are missing; will replace
  34. #                  with a #define'd memcpy() et al. -- use at
  35. #                  your own risk (should really use a memmove())
  36. #    -DSPRINTF_INT        - sprintf() returns int (most USG systems)
  37. #    -DBLKSIZE_MISSING    - st_blksize missing from stat() structure
  38. #                  (most USG systems)
  39. #    -DBSDSTDIO        - has a BSD internally-compatible stdio
  40. #    -DDOPRNT_MISSING    - lacks doprnt() routine
  41. #    -DDUP2_MISSING        - lacks dup2() system call (S5Rn, n < 4)
  42. #    -DGCVT_MISSING        - lacks gcvt() routine
  43. #    -DGETOPT_MISSING    - lacks getopt() routine
  44. #    -DMEMCMP_MISSING    - lacks memcmp() routine
  45. #    -DMEMCPY_MISSING    - lacks memcpy() routine
  46. #    -DMEMSET_MISSING    - lacks memset() routine
  47. #    -DRANDOM_MISSING    - lacks random() routine
  48. #    -DSTRCASE_MISSING    - lacks strcasecmp() routine
  49. #    -DSTRCHR_MISSING    - lacks strchr() and strrchr() routines
  50. #    -DSTRERROR_MISSING    - lacks (ANSI C) strerror() routine
  51. #    -DSTRTOD_MISSING    - lacks strtod() routine
  52. #    -DTMPNAM_MISSING    - lacks or deficient tmpnam() routine
  53. #    -DVPRINTF_MISSING    - lacks vprintf and associated routines
  54. #    -DSIGTYPE=int        - signal routines return int (default void)
  55.  
  56. # Sun running SunOS 4.x
  57. MISSING = -DSTRERROR_MISSING -DSTRCASE_MISSING
  58.  
  59. # SGI Personal Iris (Sys V derived)
  60. # MISSING = -DSPRINTF_INT -DBLKSIZE_MISSING -DSTRERROR_MISSING -DRANDOM_MISSING
  61.  
  62. # VAX running Ultrix 3.x
  63. # MISSING = -DSTRERROR_MISSING
  64.  
  65. # A generic 4.2 BSD machine
  66. # (eliminate GETOPT_MISSING for 4.3 release)
  67. # (eliminate STRCASE_MISSING and TMPNAM_MISSING for Tahoe release)
  68. # MISSING = -DBSDSTDIO -DMEMCMP_MISSING -DMEMCPY_MISSING -DMEMSET_MISSING \
  69. #    -DSTRERROR_MISSING -DSTRTOD_MISSING -DVPRINTF_MISSING \
  70. #    -DSTRCASE_MISSING -DTMPNAM_MISSING \
  71. #    -DGETOPT_MISSING -DSTRCHR_MISSING -DSIGTYPE=int
  72.  
  73. # On Amdahl UTS, a SysVr2-derived system
  74. # MISSING = -DBCOPY_MISSING -DSPRINTF_INT -DRANDOM_MISSING -DSTRERROR_MISSING \
  75. #    -DSTRCASE_MISSING -DDUP2_MISSING # -DBLKSIZE_MISSING ??????
  76.  
  77. # Comment out the next line if you don't have gcc.
  78. # Also choose just one of -g and -O.
  79. CC=         gcc
  80.  
  81. OPTIMIZE=    -O -g
  82. PROFILE=    #-pg
  83. DEBUG=        #-DDEBUG #-DMEMDEBUG #-DFUNC_TRACE #-DMPROF
  84. DEBUGGER=    #-g -Bstatic
  85. WARN=        #-W -Wunused -Wimplicit -Wreturn-type -Wcomment    # for gcc only
  86.  
  87. # Parser to use on grammar -- if you don't have bison use the first one
  88. #PARSER = yacc
  89. PARSER = bison
  90.  
  91. # ALLOCA
  92. #    Set equal to alloca.o if your system is S5 and you don't have
  93. #    alloca. Uncomment one of the rules below to make alloca.o from
  94. #    either alloca.s or alloca.c.
  95. ALLOCA= #alloca.o
  96.  
  97. #
  98. # With the exception of the alloca rule referred to above, you shouldn't
  99. # need to customize this file below this point.
  100. #
  101.  
  102. FLAGS= $(MISSING) $(DEBUG)
  103. CFLAGS= $(FLAGS) $(DEBUGGER) $(PROFILE) $(OPTIMIZE) $(WARN)
  104.  
  105. # object files
  106. AWKOBJS = main.o eval.o builtin.o msg.o debug.o io.o field.o array.o node.o \
  107.         version.o missing.o
  108.  
  109. ALLOBJS = $(AWKOBJS) awk.tab.o
  110.  
  111. # GNUOBJS
  112. #    GNU stuff that gawk uses as library routines.
  113. GNUOBJS= regex.o $(ALLOCA)
  114.  
  115. # source and documentation files
  116. SRC =    main.c eval.c builtin.c msg.c \
  117.     debug.c io.c field.c array.c node.c missing.c
  118.  
  119. ALLSRC= $(SRC) awk.tab.c
  120.  
  121. AWKSRC= awk.h awk.y $(ALLSRC) version.sh patchlevel.h
  122.  
  123. GNUSRC = alloca.c alloca.s regex.c regex.h
  124.  
  125. COPIES = missing.d/dup2.c missing.d/gcvt.c missing.d/getopt.c \
  126.     missing.d/memcmp.c missing.d/memcpy.c missing.d/memset.c \
  127.     missing.d/random.c missing.d/strcase.c missing.d/strchr.c \
  128.     missing.d/strerror.c missing.d/strtod.c missing.d/tmpnam.c \
  129.     missing.d/vprintf.c
  130.  
  131. SUPPORT = support/texindex.c support/texinfo.tex
  132.  
  133. DOCS= gawk.1 gawk.texinfo
  134.  
  135. INFOFILES= gawk-info gawk-info-1 gawk-info-2 gawk-info-3 gawk-info-4 \
  136.        gawk-info-5 gawk-info-6 gawk.aux gawk.cp gawk.cps gawk.fn \
  137.        gawk.fns gawk.ky gawk.kys gawk.pg gawk.pgs gawk.toc \
  138.        gawk.tp gawk.tps gawk.vr gawk.vrs
  139.  
  140. MISC = CHANGES COPYING FUTURES Makefile PROBLEMS README
  141.  
  142. PCSTUFF= pc.d/Makefile.pc pc.d/popen.c pc.d/popen.h
  143.  
  144. ALLDOC= gawk.dvi $(INFOFILES)
  145.  
  146. ALLFILES= $(AWKSRC) $(GNUSRC) $(COPIES) $(MISC) $(DOCS) $(ALLDOC) $(PCSTUFF) $(SUPPORT)
  147.  
  148. # Release of gawk.  There can be no leading or trailing white space here!
  149. REL=2.11
  150.  
  151. # rules to build gawk
  152. gawk: $(ALLOBJS) $(GNUOBJS)
  153.     $(CC) -o gawk $(CFLAGS) $(ALLOBJS) $(GNUOBJS) -lm
  154.  
  155. $(AWKOBJS): awk.h
  156.  
  157. main.o: patchlevel.h
  158.  
  159. awk.tab.o: awk.h awk.tab.c
  160.  
  161. awk.tab.c: awk.y
  162.     $(PARSER) -v awk.y
  163.     -mv -f y.tab.c awk.tab.c
  164.  
  165. version.c: version.sh
  166.     sh version.sh $(REL) > version.c
  167.  
  168. # Alloca: uncomment this if your system (notably System V boxen)
  169. # does not have alloca in /lib/libc.a
  170. #
  171. #alloca.o: alloca.s
  172. #    /lib/cpp < alloca.s | sed '/^#/d' > t.s
  173. #    as t.s -o alloca.o
  174. #    rm t.s
  175.  
  176. # If your machine is not supported by the assembly version of alloca.s,
  177. # use the C version instead.  This uses the default rules to make alloca.o.
  178. #
  179. #alloca.o: alloca.c
  180.  
  181. # auxiliary rules for release maintenance
  182. lint: $(ALLSRC)
  183.     lint -hcbax $(FLAGS) $(ALLSRC)
  184.  
  185. xref:
  186.     cxref -c $(FLAGS) $(ALLSRC) | grep -v '    /' >xref
  187.  
  188. clean:
  189.     rm -f gawk *.o core awk.output awk.tab.c gmon.out make.out version.c
  190.  
  191. clobber: clean
  192.     rm -f $(ALLDOC) gawk.log
  193.  
  194. gawk.dvi: gawk.texinfo
  195.     tex gawk.texinfo ; texindex gawk.??
  196.     tex gawk.texinfo ; texindex gawk.??
  197.     tex gawk.texinfo
  198.  
  199. $(INFOFILES): gawk.texinfo
  200.     makeinfo gawk.texinfo
  201.  
  202. srcrelease: $(AWKSRC) $(GNUSRC) $(DOCS) $(MISC) $(COPIES) $(PCSTUFF) $(SUPPORT)
  203.     -mkdir gawk-$(REL)
  204.     cp -p $(AWKSRC) $(GNUSRC) $(DOCS) $(MISC) gawk-$(REL)
  205.     -mkdir gawk-$(REL)/missing.d
  206.     cp -p $(COPIES) gawk-$(REL)/missing.d
  207.     -mkdir gawk-$(REL)/pc.d
  208.     cp -p $(PCSTUFF) gawk-$(REL)/pc.d
  209.     -mkdir gawk-$(REL)/support
  210.     cp -p $(SUPPORT) gawk-$(REL)/support
  211.     tar -cf - gawk-$(REL) | compress > gawk-$(REL).tar.Z
  212.  
  213. docrelease: $(ALLDOC)
  214.     -mkdir gawk-$(REL)-doc
  215.     cp -p $(INFOFILES) gawk.dvi gawk-$(REL)-doc
  216.     nroff -man gawk.1 > gawk-$(REL)-doc/gawk.1.pr
  217.     tar -cf - gawk-$(REL)-doc | compress > gawk-doc-$(REL).tar.Z
  218.  
  219. psrelease: docrelease
  220.     -mkdir gawk-postscript
  221.     dvi2ps gawk.dvi > gawk-postscript/gawk.postscript
  222.     psroff -t -man gawk.1 > gawk-postscript/gawk.1.ps
  223.     tar -cf - gawk-postscript | compress > gawk.postscript.tar.Z
  224.  
  225. release: srcrelease docrelease psrelease
  226.     rm -fr gawk-postscript gawk-$(REL) gawk-$(REL)-doc
  227.  
  228. diff:
  229.     for i in RCS/*; do rcsdiff -c -b $$i > `basename $$i ,v`.diff; done
  230.