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.unx < prev    next >
Makefile  |  1990-10-01  |  5KB  |  160 lines

  1. # Makefile for GNU Awk.
  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. #    -O    optimize
  23. #    -g    include dbx/sdb info
  24. #    -gg    include gdb debugging info; only for GCC
  25. #    -pg    include new (gmon) profiling info
  26. #    -p    include old style profiling info (System V)
  27. #
  28. #    -DNOVPRINTF - system has no vprintf and associated routines
  29. #    -DHASDOPRNT - system needs version of vprintf et al. defined in awk5.c
  30. #              and has a BSD compatable doprnt()
  31. #    -DNOMEMCMP  - system lacks memcmp()
  32. #    -DUSG       - system is generic-ish System V.
  33. #
  34. OPTIMIZE=-O
  35. DEBUG=#-DDEBUG #-DFUNC_TRACE -DMEMDEBUG
  36. DEBUGGER=-g
  37. PROFILE=#-pg
  38. SYSV=
  39. BSD=-DBSD#-DHASDOPRNT
  40. MEMCMP=#-DNOMEMCMP
  41. VPRINTF=#-DNOVPRINTF
  42. CC=gcc
  43.   
  44. FLAGS= $(OPTIMIZE) $(SYSV) $(DEBUG) $(BSD) $(MEMCMP) $(VPRINTF)
  45. CFLAGS= $(FLAGS) $(DEBUGGER) $(PROFILE) 
  46. LDFLAGS= #-Bstatic
  47.  
  48. SRC =    awk1.c awk2.c awk3.c awk4.c awk5.c \
  49.     awk6.c awk7.c awk8.c awk9.c version.c do_free.c awka.c
  50.  
  51. PCSTUFF= makefile.pc names.lnk random.c
  52.  
  53. AWKOBJS = awk1.o awk2.o awk3.o awk4.o awk5.o awk6.o awk7.o awk8.o awk9.o \
  54.         version.o awka.o # do_free.o # used for MEMDEBUG
  55. ALLOBJS = $(AWKOBJS) awk.tab.o
  56.  
  57. # Parser to use on grammar -- if you don't have bison use the first one
  58. #PARSER = yacc
  59. PARSER = bison
  60.  
  61. # S5OBJS
  62. #    Set equal to alloca.o if your system is S5 and you don't have
  63. #    alloca. Uncomment the rule below to actually make alloca.o.
  64. S5OBJS=
  65.  
  66. # GETOPT
  67. #    Set equal to getopt.o if you have a generic BSD system. The
  68. #    generic BSD getopt is reported to not work with gawk. The
  69. #    gnu getopt is supplied in gnu.getopt.c. The Public Domain
  70. #    getopt from AT&T is in att.getopt.c. Choose one of these,
  71. #    and rename it getopt.c.
  72. GETOPT=
  73.  
  74. # LIBOBJS
  75. #    Stuff that awk uses as library routines, but not in /lib/libc.a.
  76. LIBOBJS= regex.o $(S5OBJS) $(GETOPT)
  77.  
  78. UPDATES = Makefile awk.h awk.y \
  79.     $(SRC) regex.c regex.h
  80.  
  81. INFOFILES= gawk-info gawk-info-1 gawk-info-2 gawk-info-3 gawk-info-4 \
  82.            gawk-info-5 gawk.aux gawk.cp gawk.cps gawk.dvi gawk.fn gawk.fns \
  83.            gawk.ky gawk.kys gawk.pg gawk.pgs gawk.texinfo gawk.toc \
  84.            gawk.tp gawk.tps gawk.vr gawk.vrs
  85.  
  86. # DOCS
  87. #    Documentation for users
  88. #
  89. DOCS=gawk.1 $(INFOFILES)
  90.  
  91. # We don't distribute shar files, but they're useful for mailing.
  92. SHARS = $(DOCS) COPYING README PROBLEMS $(UPDATES) awk.tab.c \
  93.     alloca.s alloca.c att.getopt.c gnu.getopt.c $(PCSTUFF)
  94.  
  95. gawk: $(ALLOBJS) $(LIBOBJS)
  96.     $(CC) -o gawk $(CFLAGS) $(ALLOBJS) $(LIBOBJS) -lm $(LDFLAGS)
  97.  
  98. $(AWKOBJS): awk.h
  99.  
  100. awk.tab.o: awk.h awk.tab.c
  101.  
  102. awk.tab.c: awk.y
  103.     $(PARSER) -v awk.y
  104.     -mv -f y.tab.c awk.tab.c
  105.  
  106. # Alloca: uncomment this if your system (notably System V boxen)
  107. # does not have alloca in /lib/libc.a
  108. #
  109. #alloca.o: alloca.s
  110. #    /lib/cpp < alloca.s | sed '/^#/d' > t.s
  111. #    as t.s -o alloca.o
  112. #    rm t.s
  113.  
  114. # If your machine is not supported by the assembly version of alloca.s,
  115. # use the C version instead.  This uses the default rules to make alloca.o.
  116. #
  117. #alloca.o: alloca.c
  118.  
  119. lint: $(SRC)
  120.     lint -hcbax $(FLAGS) $(SRC) awk.tab.c
  121.  
  122. clean:
  123.     rm -f gawk *.o core awk.output awk.tab.c gmon.out make.out
  124.  
  125. awk.shar: $(SHARS)
  126.     shar -f awk -c $(SHARS)
  127.  
  128. awk.tar: $(SHARS)
  129.     tar cvf awk.tar $(SHARS)
  130.  
  131. updates.tar:    $(UPDATES)
  132.     tar cvf gawk.tar $(UPDATES)
  133.  
  134. awk.tar.Z:    awk.tar
  135.     compress < awk.tar > awk.tar.Z
  136.  
  137. doc: $(DOCS)
  138.     nroff -man $(DOCS) | col > $(DOCS).out
  139.  
  140. # This command probably won't be useful to the rest of the world, but makes
  141. # life much easier for me.
  142. dist:    awk.tar awk.tar.Z
  143.  
  144. diff:
  145.     for i in RCS/*; do rcsdiff -c -b $$i > `basename $$i ,v`.diff; done
  146.  
  147. update:    $(UPDATES)
  148.     sendup $?
  149.     touch update
  150.  
  151. release: $(SHARS)
  152.     -rm -fr gawk-dist
  153.     mkdir gawk-dist
  154.     cp -p $(SHARS) gawk-dist
  155.     tar -cvf - gawk-dist | compress > dist.tar.Z
  156.