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