home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 419b.lha / GNU_Awk_v2.10_Beta / Makefile < prev    next >
Makefile  |  1990-10-01  |  5KB  |  171 lines

  1. # Makefile for GNU Awk (for use with Microsoft C V5.1)
  2. #
  3. # Rewritten by Arnold Robbins, September 1988, March 1989.
  4. #
  5. # Copyright (C) 1986, 1988, 1989 the Free Software Foundation, Inc.
  6. # This file is part of GAWK, the GNU implementation of the
  7. # AWK Progamming Language.
  8. # GAWK is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 1, or (at your option)
  11. # any later version.
  12. # GAWK is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. # GNU General Public License for more details.
  16. # You should have received a copy of the GNU General Public License
  17. # along with GAWK; see the file COPYING.  If not, write to
  18. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # CFLAGS: options to the C compiler
  21. #
  22. #    -Ox    optimize
  23. #    -Zi    include debugging info (include /CO in LINKFLAFS)
  24. #    -AL    compile in large model
  25. #    -AS    compile in small model
  26. #
  27. #    -DNOVPRINTF - system has no vprintf and associated routines
  28. #    -DHASDOPRNT - system needs version of vprintf et al. defined in awk5.c
  29. #              and has a BSD compatable doprnt()
  30. #    -DNOMEMCMP  - system lacks memcmp()
  31. #    -DUSG       - system is generic-ish System V.
  32. #
  33. CC=cl
  34. LINKFLAGS= /E /FAR /PAC /NOE /NOI /st:0x1800
  35. #LINKFLAGS= /CO /NOE /NOI /st:0x1800
  36. OPTIMIZE= -AL -Ox
  37. DEBUG=#-DDEBUG #-DFUNC_TRACE -DMEMDEBUG
  38. DEBUGGER=# -Zi -Od
  39. PROFILE=#-pg
  40. SYSV=
  41. BSD=#-DHASDOPRNT
  42. MEMCMP=#-DNOMEMCMP
  43. VPRINTF=#-DNOVPRINTF
  44.   
  45. FLAGS= $(OPTIMIZE) $(SYSV) $(DEBUG) $(BSD) $(MEMCMP) $(VPRINTF)
  46. CFLAGS= $(FLAGS) $(DEBUGGER) $(PROFILE) 
  47. LDFLAGS= #-Bstatic
  48.  
  49. SRC =    awk1.c awk2.c awk3.c awk4.c awk5.c popen.c\
  50.     awk6.c awk7.c awk8.c awk9.c regex.c version.c do_free.c awka.c
  51.  
  52. PCSTUFF= makefile.pc names.lnk random.c
  53.  
  54. AWKOBJS = awk1.obj awk2.obj awk3.obj awk4.obj awk5.obj awk6.obj awk7.obj \
  55.       awk8.obj awk9.obj popen.obj \
  56.       version.obj awka.obj # do_free.obj # used for MEMDEBUG
  57. ALLOBJS = $(AWKOBJS) awk_tab.obj
  58.  
  59. # Parser to use on grammar -- if you don't have bison use the first one
  60. PARSER = yacc
  61. PARSOUT=ytab.c
  62. #PARSER = bison -y
  63. #PARSOUT=y_tab.c
  64. #PARSFLAGS=-v
  65.  
  66. # S5OBJS
  67. #    Set equal to alloca.o if your system is S5 and you don't have
  68. #    alloca. Uncomment the rule below to actually make alloca.o.
  69. S5OBJS=
  70.  
  71. # GETOPT
  72. #    Set equal to getopt.o if you have a generic BSD system. The
  73. #    generic BSD getopt is reported to not work with gawk. The
  74. #    gnu getopt is supplied in gnu.getopt.c. The Public Domain
  75. #    getopt from AT&T is in att.getopt.c. Choose one of these,
  76. #    and rename it getopt.c.
  77. GETOPT=getopt.obj
  78.  
  79. # LIBOBJS
  80. #    Stuff that awk uses as library routines, but not in /lib/libc.a.
  81. LIBOBJS= regex.obj random.obj $(S5OBJS) $(GETOPT)
  82.  
  83. UPDATES = Makefile awk.h awk.y \
  84.     $(SRC) regex.c regex.h
  85.  
  86. INFOFILES= gawk-info gawk-info-1 gawk-info-2 gawk-info-3 gawk-info-4 \
  87.            gawk-info-5 gawk.aux gawk.cp gawk.cps gawk.dvi gawk.fn gawk.fns \
  88.            gawk.ky gawk.kys gawk.pg gawk.pgs gawk.texinfo gawk.toc \
  89.            gawk.tp gawk.tps gawk.vr gawk.vrs
  90.  
  91. # DOCS
  92. #    Documentation for users
  93. #
  94. DOCS=gawk.1 $(INFOFILES)
  95.  
  96. # We don't distribute shar files, but they're useful for mailing.
  97. SHARS = $(DOCS) COPYING README PROBLEMS $(UPDATES) awk.tab.c \
  98.     alloca.s alloca.c att_getopt.c gnu_getopt.c $(PCSTUFF)
  99.   
  100. gawk: $(ALLOBJS) $(LIBOBJS)
  101.     link @names.lnk,gawk.exe $(LINKFLAGS);
  102.  
  103. # this kludge necessary because MSC 5.1 compiler bombs with -Oa or -Ol (where
  104. # -Ox == "-Oailt -Gs")
  105. regex.obj: regex.c
  106.     $(CC) -c -Oit -AL $(DEBUGGER) regex.c
  107.  
  108. $(AWKOBJS): awk.h
  109.  
  110. awk_tab.obj: awk.h awk_tab.c
  111.  
  112. awk_tab.c: awk.y
  113.     @-del awk_tab.c
  114.     $(PARSER) $(PARSFLAGS) awk.y
  115.     -rename $(PARSOUT) awk_tab.c
  116.  
  117. # Alloca: uncomment this if your system (notably System V boxen)
  118. # does not have alloca in /lib/libc.a
  119. #
  120. #alloca.o: alloca.s
  121. #    /lib/cpp < alloca.s | sed '/^#/d' > t.s
  122. #    as t.s -o alloca.o
  123. #    rm t.s
  124.  
  125. # If your machine is not supported by the assembly version of alloca.s,
  126. # use the C version instead.  This uses the default rules to make alloca.o.
  127. #
  128. #alloca.o: alloca.c
  129.  
  130. lint: $(SRC)
  131.     lint -hcbax $(FLAGS) $(SRC) awk_tab.c
  132.  
  133. clean:
  134.     rm -f gawk *.obj core awk.output gmon.out make.out #awk_tab.c
  135.  
  136. awk.shar: $(SHARS)
  137.     shar -f awk -c $(SHARS)
  138.  
  139. awk.tar: $(SHARS)
  140.     tar cvf awk.tar $(SHARS)
  141.  
  142. updates.tar:    $(UPDATES)
  143.     tar cvf gawk.tar $(UPDATES)
  144.  
  145. awk.tar.Z:    awk.tar
  146.     compress < awk.tar > awk.tar.Z
  147.  
  148. doc: $(DOCS)
  149.     nroff -man $(DOCS) | col > $(DOCS).out
  150.  
  151. # This command probably won't be useful to the rest of the world, but makes
  152. # life much easier for me.
  153. dist:    awk.tar awk.tar.Z
  154.  
  155. diff:
  156.     for i in RCS/*; do rcsdiff -c -b $$i > `basename $$i ,v`.diff; done
  157.  
  158. update:    $(UPDATES)
  159.     sendup $?
  160.     touch update
  161.  
  162. release: $(SHARS)
  163.     -rm -fr gawk-dist
  164.     mkdir gawk-dist
  165.     cp $(SHARS) gawk-dist
  166.     tar -cvf - gawk-dist | compress > dist.tar.Z
  167.