home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / unix / gawk.sit / source / pc.d / Makefile.pc next >
Makefile  |  1990-07-29  |  9KB  |  283 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. # for DOS
  81. CC= cl
  82. POPEN = popen.o
  83.  
  84. # for DOS, most of the missing symbols are defined in MISSING.C in order to
  85. # get around the command line length limitations
  86. MISSING = -DSPRINTF_INT -DBLKSIZE_MISSING -DBCOPY_MISSING
  87. LINKFLAGS= /MAP /CO /FAR /PACKC /NOE /NOIG /st:0x1800
  88.  
  89. # also give suffixes and explicit rule for DOS
  90. .SUFFIXES : .o .c
  91. .c.o:
  92.     $(CC) -c $(CFLAGS) -Ipc.d -W2 -AL -Fo$*.o $<
  93.     
  94. OPTIMIZE=    -Od -Zi
  95. PROFILE=    #-pg
  96. DEBUG=        #-DDEBUG #-DMEMDEBUG #-DFUNC_TRACE #-DMPROF
  97. DEBUGGER=    #-g -Bstatic
  98. WARN=        #-W -Wunused -Wimplicit -Wreturn-type -Wcomment    # for gcc only
  99.  
  100. # Parser to use on grammar -- if you don't have bison use the first one
  101. #PARSER = yacc
  102. PARSER = bison
  103.  
  104. # ALLOCA
  105. #    Set equal to alloca.o if your system is S5 and you don't have
  106. #    alloca. Uncomment one of the rules below to make alloca.o from
  107. #    either alloca.s or alloca.c.
  108. ALLOCA= #alloca.o
  109.  
  110. #
  111. # With the exception of the alloca rule referred to above, you shouldn't
  112. # need to customize this file below this point.
  113. #
  114.  
  115. FLAGS= $(MISSING) $(DEBUG)
  116. CFLAGS= $(FLAGS) $(DEBUGGER) $(PROFILE) $(OPTIMIZE) $(WARN)
  117.  
  118. # object files
  119. O1 = main.o eval.o builtin.o msg.o debug.o io.o field.o array.o node.o
  120. O2 = version.o missing.o $(POPEN)
  121.  
  122. AWKOBJS = $(O1) $(O2)
  123.  
  124.  
  125. # for unix
  126. # AWKTAB = awk.tab.o
  127. # for dos
  128. AWKTAB = awk_tab.o
  129.  
  130.  
  131.  
  132. ALLOBJS = $(AWKOBJS) $(AWKTAB)
  133.  
  134. # GNUOBJS
  135. #    GNU stuff that gawk uses as library routines.
  136. GNUOBJS= regex.o $(ALLOCA)
  137.  
  138. # source and documentation files
  139. SRC =    main.c eval.c builtin.c msg.c \
  140.     debug.c io.c field.c array.c node.c missing.c
  141.  
  142. ALLSRC= $(SRC) awk.tab.c
  143.  
  144. AWKSRC= awk.h awk.y $(ALLSRC) version.sh patchlevel.h
  145.  
  146. GNUSRC = alloca.c alloca.s regex.c regex.h
  147.  
  148. COPIES = missing.d/dup2.c missing.d/gcvt.c missing.d/getopt.c \
  149.     missing.d/memcmp.c missing.d/memcpy.c missing.d/memset.c \
  150.     missing.d/random.c missing.d/strcase.c missing.d/strchr.c \
  151.     missing.d/strerror.c missing.d/strtod.c missing.d/tmpnam.c \
  152.     missing.d/vprintf.c
  153.  
  154. SUPPORT = support/texindex.c support/texinfo.tex
  155.  
  156. DOCS= gawk.1 gawk.texinfo
  157.  
  158. INFOFILES= gawk-info gawk-info-1 gawk-info-2 gawk-info-3 gawk-info-4 \
  159.        gawk-info-5 gawk-info-6 gawk.aux gawk.cp gawk.cps gawk.fn \
  160.        gawk.fns gawk.ky gawk.kys gawk.pg gawk.pgs gawk.toc \
  161.        gawk.tp gawk.tps gawk.vr gawk.vrs
  162.  
  163. MISC = CHANGES COPYING FUTURES Makefile PROBLEMS README
  164.  
  165. PCSTUFF= pc.d/Makefile.pc pc.d/popen.c pc.d/popen.h
  166.  
  167. ALLDOC= gawk.dvi $(INFOFILES)
  168.  
  169. ALLFILES= $(AWKSRC) $(GNUSRC) $(COPIES) $(MISC) $(DOCS) $(ALLDOC) $(PCSTUFF) $(SUPPORT)
  170.  
  171. # Release of gawk.  There can be no leading or trailing white space here!
  172. REL=2.11
  173. # for unix
  174. # GAWK = gawk
  175. # for DOS
  176. GAWK = gawk.exe
  177. $(GAWK) : $(ALLOBJS) $(GNUOBJS) names.lnk
  178.     link @names.lnk
  179.  
  180. #GNULIB = ..\lib\lgnu.lib 
  181. GNULIB = 
  182. names.lnk : makefile
  183.     echo $(O1) + > $@
  184.     echo $(O2) + >> $@
  185.     echo $(AWKTAB) + >> $@
  186.     echo $(GNUOBJS) >> $@
  187.     echo $(GAWK) >> $@
  188.     echo gawk.map >> $@
  189.     echo $(GNULIB) $(LINKFLAGS) >> $@
  190.  
  191. popen.o : pc.d\popen.c
  192.     $(CC) -c $(CFLAGS) -Ipc.d -W2 -AL -Fo$*.o pc.d\popen.c
  193.  
  194. # rules to build gawk
  195. #$(GAWK) : $(ALLOBJS) $(GNUOBJS)
  196. #    $(CC) -o gawk $(CFLAGS) $(ALLOBJS) $(GNUOBJS) -lm
  197.  
  198. $(AWKOBJS): awk.h
  199.  
  200. main.o: patchlevel.h
  201.  
  202. #awk.tab.o: awk.h awk.tab.c
  203. #
  204. #awk.tab.c: awk.y
  205. #    $(PARSER) -v awk.y
  206. #    -mv -f y.tab.c awk.tab.c
  207.  
  208. # for dos
  209. awk_tab.o : awk.y awk.h
  210.     bison -y awk.y
  211.     $(CC) -c $(CFLAGS) -Ipc.d -W2 -AL -Fo$@ y_tab.c
  212.     @-rm y_tab.c
  213.  
  214. version.c: version.sh
  215.     sh version.sh $(REL) > version.c
  216.  
  217. # Alloca: uncomment this if your system (notably System V boxen)
  218. # does not have alloca in /lib/libc.a
  219. #
  220. #alloca.o: alloca.s
  221. #    /lib/cpp < alloca.s | sed '/^#/d' > t.s
  222. #    as t.s -o alloca.o
  223. #    rm t.s
  224.  
  225. # If your machine is not supported by the assembly version of alloca.s,
  226. # use the C version instead.  This uses the default rules to make alloca.o.
  227. #
  228. #alloca.o: alloca.c
  229.  
  230. # auxiliary rules for release maintenance
  231. lint: $(ALLSRC)
  232.     lint -hcbax $(FLAGS) $(ALLSRC)
  233.  
  234. xref:
  235.     cxref -c $(FLAGS) $(ALLSRC) | grep -v '    /' >xref
  236.  
  237. clean:
  238.     rm -f gawk *.o core awk.output awk.tab.c gmon.out make.out version.c
  239.  
  240. clobber: clean
  241.     rm -f $(ALLDOC) gawk.log
  242.  
  243. gawk.dvi: gawk.texinfo
  244.     tex gawk.texinfo ; texindex gawk.??
  245.     tex gawk.texinfo ; texindex gawk.??
  246.     tex gawk.texinfo
  247.  
  248. $(INFOFILES): gawk.texinfo
  249.     makeinfo gawk.texinfo
  250.  
  251. srcrelease: $(AWKSRC) $(GNUSRC) $(DOCS) $(MISC) $(COPIES) $(PCSTUFF) $(SUPPORT)
  252.     -mkdir gawk-$(REL)
  253.     cp -p $(AWKSRC) $(GNUSRC) $(DOCS) $(MISC) gawk-$(REL)
  254.     -mkdir gawk-$(REL)/missing.d
  255.     cp -p $(COPIES) gawk-$(REL)/missing.d
  256.     -mkdir gawk-$(REL)/pc.d
  257.     cp -p $(PCSTUFF) gawk-$(REL)/pc.d
  258.     -mkdir gawk-$(REL)/support
  259.     cp -p $(SUPPORT) gawk-$(REL)/support
  260.     tar -cf - gawk-$(REL) | compress > gawk-$(REL).tar.Z
  261.  
  262. docrelease: $(ALLDOC)
  263.     -mkdir gawk-$(REL)-doc
  264.     cp -p $(INFOFILES) gawk.dvi gawk-$(REL)-doc
  265.     nroff -man gawk.1 > gawk-$(REL)-doc/gawk.1.pr
  266.     tar -cf - gawk-$(REL)-doc | compress > gawk-doc-$(REL).tar.Z
  267.  
  268. psrelease: docrelease
  269.     -mkdir gawk-postscript
  270.     dvi2ps gawk.dvi > gawk-postscript/gawk.postscript
  271.     psroff -t -man gawk.1 > gawk-postscript/gawk.1.ps
  272.     tar -cf - gawk-postscript | compress > gawk.postscript.tar.Z
  273.  
  274. release: srcrelease docrelease psrelease
  275.     rm -fr gawk-postscript gawk-$(REL) gawk-$(REL)-doc
  276.  
  277. diff:
  278.     for i in RCS/*; do rcsdiff -c -b $$i > `basename $$i ,v`.diff; done
  279.