home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / gawk-2.15.6-base.tgz / gawk-2.15.6-base.tar / fsf / gawk / Makefile.in < prev    next >
Makefile  |  1995-03-06  |  8KB  |  268 lines

  1. # Makefile for GNU Awk.
  2. #
  3. # Copyright (C) 1986, 1988-1995 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 2 of the License, or
  9. # (at your option) 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, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. # User tunable macros -- CHANGE THESE IN Makefile.in RATHER THAN IN 
  19. # Makefile, OR configure WILL OVERWRITE YOUR CHANGES
  20.  
  21. prefix = /usr/local
  22. exec_prefix = $(prefix)
  23. binprefix =
  24. manprefix =
  25.  
  26. bindir = $(exec_prefix)/bin
  27. libdir = $(exec_prefix)/lib
  28. mandir = $(prefix)/man/man1
  29. manext = .1
  30. infodir = $(prefix)/info
  31.  
  32. #    The provided "configure" is used to turn a config file (samples in
  33. #    the "config" directory into commands to edit config.in into
  34. #    a suitable config.h and to edit Makefile.in into Makefile.
  35. #    To port GAWK, create an appropriate config file using the ones in
  36. #    the config directory as examples and using the comments in config.in
  37. #    as a guide.
  38.  
  39. CC=         gcc -g
  40. ##MAKE_CC## CC = cc
  41.  
  42. PROFILE=    #-pg
  43. DEBUG=        #-DMALLOCDEBUG #-DDEBUG #-DFUNC_TRACE #-DMPROF
  44. LINKSTATIC=    #-Bstatic
  45. WARN=        #-W -Wunused -Wimplicit -Wreturn-type -Wcomment    # for gcc only
  46.  
  47. # Parser to use on grammar - any one of the following will work
  48. PARSER = bison -y
  49. #PARSER = yacc
  50. #PARSER = byacc
  51.  
  52. # Set LIBS to any libraries that are machine specific
  53. LIBS =
  54.  
  55. # Cray 2 running Unicos 5.0.7
  56. ##MAKE_LIBNET## LIBS = -lnet
  57.  
  58.  
  59. # Systems with alloca in /lib/libPW.a
  60. ##MAKE_ALLOCA_PW## LIBS = -lPW
  61.  
  62. # ALLOCA - only needed if you use bison
  63. #    Set equal to alloca.o if your system is S5 and you don't have
  64. #    alloca. Uncomment one of the rules below to make alloca.o from
  65. #    either alloca.s or alloca.c.
  66. #    This should have already been done automatically by configure.
  67. #
  68. #    Some systems have alloca in libPW.a, so LIBS=-lPW may work, too.
  69. ##MAKE_ALLOCA_C## ALLOCA= alloca.o
  70. ##MAKE_ALLOCA_S## ALLOCA= alloca.o
  71.  
  72. VFLAGS=
  73.  
  74. # VMS POSIX, VAXC V3.2
  75. ##MAKE_VMS-Posix## VFLAGS = -UVMS -D__STDC__=0
  76.  
  77. # HP/Apollo running cc version 6.7 or earlier
  78. ##MAKE_Apollo## VFLAGS = -U__STDC__ -A run,sys5.3
  79. ##MAKE_Apollo## LIBS = -A sys,any
  80.  
  81. # SGI IRIX 4.0.5 cc flags
  82. ##MAKE_SGI## VFLAGS = -cckr -signed
  83. ##MAKE_SGI_GCC## VFLAGS =  -fsigned-char
  84.  
  85. ##MAKE_NeXT## VFLAGS = -DGFMT_WORKAROUND
  86.  
  87. CFLAGS = -O
  88. FLAGS = -DGAWK -DHAVE_CONFIG_H $(VFLAGS) $(DEBUG) $(PROFILE) $(WARN)
  89. LDFLAGS = $(LINKSTATIC) $(PROFILE)
  90.  
  91. .c.o:
  92.     $(CC) $(CFLAGS) $(FLAGS) -c $<
  93.  
  94. # object files
  95. AWKOBJS = main.o eval.o builtin.o msg.o iop.o io.o field.o array.o \
  96.     node.o version.o missing.o re.o getopt.o getopt1.o
  97.  
  98. ALLOBJS = $(AWKOBJS) awktab.o
  99.  
  100. # GNUOBJS
  101. #    GNU stuff that gawk uses as library routines.
  102. GNUOBJS= regex.o dfa.o $(ALLOCA)
  103.  
  104. # source and documentation files
  105. SRC =    main.c eval.c builtin.c msg.c version.c \
  106.     iop.c io.c field.c array.c node.c missing.c re.c getopt.c getopt1.c
  107.  
  108. ALLSRC= $(SRC) awktab.c
  109.  
  110. AWKSRC= awk.h awk.y $(ALLSRC) patchlevel.h protos.h config.in getopt.h
  111.  
  112. GNUSRC = alloca.c alloca.s dfa.c dfa.h regex.c regex.h
  113.  
  114. COPIES = missing/system.c missing/tzset.c \
  115.     missing/memcmp.c missing/memcpy.c missing/memset.c \
  116.     missing/random.c missing/strncasecmp.c missing/strchr.c \
  117.     missing/strerror.c missing/strtod.c \
  118.     missing/strftime.c missing/strftime.3 
  119.  
  120. SUPPORT = support/texindex.c support/texinfo.tex
  121.  
  122. DOCS= gawk.1 gawk.texi
  123.  
  124. TEXFILES= gawk.aux gawk.cp gawk.cps gawk.fn gawk.fns gawk.ky gawk.kys \
  125.        gawk.pg gawk.pgs gawk.toc gawk.tp gawk.tps gawk.vr gawk.vrs
  126.  
  127. MISC =    NEWS COPYING FUTURES Makefile.* PROBLEMS README* PORTS POSIX \
  128.     mungeconf configure ACKNOWLEDGMENT LIMITATIONS INSTALL
  129.  
  130. OTHERS= pc/* atari/* vms/*
  131.  
  132. ALLDOC= gawk.dvi $(TEXFILES) gawk.info*
  133.  
  134. # Release of gawk.  There can be no leading or trailing white space here!
  135. REL=2.15
  136.  
  137. # rules to build gawk
  138. gawk:    $(ALLOBJS) $(GNUOBJS) $(REOBJS)
  139.     $(CC) -o gawk $(LDFLAGS) $(ALLOBJS) $(GNUOBJS) $(REOBJS) -lm $(LIBS)
  140.  
  141. $(AWKOBJS) regex.o dfa.o:    awk.h dfa.h regex.h
  142.  
  143. getopt.o:    getopt.h
  144.  
  145. getopt1.o:    getopt.h
  146.  
  147. main.o:    patchlevel.h
  148.  
  149. awktab.c:    awk.y
  150.     $(PARSER) -v awk.y
  151. ##MAKE_VMS-Posix##     sed '/^\#module/d' ytab.c >awktab.c && rm ytab.c
  152. ##MAKE_VMS-Posix## dummy.awk_tab.target:
  153.     sed '/^extern char .malloc(), .realloc();$$/d' y.tab.c >awktab.c
  154.     rm y.tab.c
  155.  
  156. awktab.o:    awk.h
  157.  
  158. config.h:    config.in
  159.     @echo You must provide a config.h!
  160.     @echo Run \"./configure\" to build it for known systems
  161.     @echo or copy config.in to config.h and edit it.; exit 1
  162.  
  163. install:    gawk gawk.info
  164.     cp gawk $(bindir)/gawk && chmod 755 $(bindir)/gawk
  165.     cp gawk.1 $(mandir)/gawk$(manext) && chmod 644 $(mandir)/gawk$(manext)
  166.     cp gawk.info* $(infodir) && chmod 644 $(infodir)/gawk.info*
  167.  
  168. uninstall:
  169.     rm -f $(bindir)/gawk $(mandir)/gawk$(manext) $(infodir)/gawk.info*
  170.  
  171. # ALLOCA: uncomment this if your system (notably System V boxen)
  172. # does not have alloca in /lib/libc.a or /lib/libPW.a
  173. #
  174. # If your machine is not supported by the assembly version of alloca.s,
  175. # use the C version which follows instead.  It uses the default rules to
  176. # make alloca.o.
  177. #
  178. # One of these rules should have already been selected by running configure.
  179.  
  180.  
  181. ##MAKE_ALLOCA_S## alloca.o:    alloca.s
  182. ##MAKE_ALLOCA_S##     /lib/cpp < alloca.s | sed '/^#/d' > t.s
  183. ##MAKE_ALLOCA_S##     as t.s -o alloca.o
  184. ##MAKE_ALLOCA_S##     rm t.s
  185.  
  186. ##MAKE_ALLOCA_C## alloca.o:    alloca.c
  187.  
  188. # auxiliary rules for release maintenance
  189. lint:    $(ALLSRC)
  190.     lint -hcbax $(FLAGS) $(ALLSRC)
  191.  
  192. xref:
  193.     cxref -c $(FLAGS) $(ALLSRC) | grep -v '    /' >xref
  194.  
  195. clean:
  196.     rm -rf gawk *.o core
  197.     cd test && make clean
  198.  
  199. distclean:    clean
  200.     rm -f Makefile *.orig *.rej */*.orig */*.rej awk.output gmon.out \
  201.         make.out y.output config.h
  202.  
  203. mostlyclean:    clean
  204.  
  205. realclean:    distclean
  206.     rm -f awktab.c $(ALLDOC)
  207.  
  208. cleaner:    clean
  209.     rm -f gawk awktab.c Makefile config.h
  210.  
  211. clobber:    clean
  212.     rm -f $(ALLDOC) gawk.log config.h
  213.  
  214. gawk.dvi:    gawk.texi
  215.     cp support/texinfo.tex .
  216.     tex gawk.texi; texindex gawk.??
  217.     tex gawk.texi; texindex gawk.??
  218.     tex gawk.texi
  219.     rm -f texinfo.tex
  220.  
  221. gawk.info:    gawk.texi
  222.     makeinfo gawk.texi
  223.  
  224. dist:    $(AWKSRC) $(GNUSRC) $(DOCS) $(MISC) $(COPIES) $(SUPPORT) distclean
  225.     -rm -rf gawk-$(REL)*
  226.     dir=gawk-$(REL).`gawk '{print $$3}' patchlevel.h` && \
  227.     mkdir $$dir && \
  228.     cp -p $(AWKSRC) $(GNUSRC) $(DOCS) $(MISC) $$dir && \
  229.     mkdir $$dir/missing && cp -p $(COPIES) $$dir/missing && \
  230.     mkdir $$dir/atari && cp -p  atari/* $$dir/atari && \
  231.     mkdir $$dir/pc && cp -p pc/* $$dir/pc && \
  232.     mkdir $$dir/vms && cp -p vms/* $$dir/vms && \
  233.     mkdir $$dir/config && cp -p config/* $$dir/config && \
  234.     mkdir $$dir/support && cp -p support/* $$dir/support && \
  235.     cp -pr test $$dir && \
  236.     chmod -R a+r $$dir && \
  237.     chmod -R a-w $$dir && \
  238.     find $$dir -type d -exec chmod 755 {} ';' && \
  239.     find $$dir -print | doschk && \
  240.     tar -cf - $$dir | gzip > $$dir.tar.gz && \
  241.     rm -fr $$dir
  242.  
  243. gawk-doc-$(REL).tar.gz:    gawk.info gawk.dvi gawk.1
  244.     -rm -rf gawk-doc-$(REL) gawk-doc-$(REL).tar.gz
  245.     -mkdir gawk-doc-$(REL)
  246.     cp -p $(ALLDOC) gawk-doc-$(REL)
  247.     groff -Tascii -man gawk.1 > gawk-doc-$(REL)/gawk.1.pr
  248.     tar -cf - gawk-doc-$(REL) | gzip > gawk-doc-$(REL).tar.gz
  249.  
  250. gawk-ps-$(REL).tar.gz:    gawk.dvi gawk.1
  251.     -rm -rf gawk-ps-$(REL) gawk-ps-$(REL).tar.gz
  252.     -mkdir gawk-ps-$(REL)
  253.     dvips -o gawk-ps-$(REL)/gawk.postscript gawk.dvi
  254.     groff -man gawk.1 > gawk-ps-$(REL)/gawk.1.ps
  255.     tar -cf - gawk-ps-$(REL) | gzip > gawk-ps-$(REL).tar.gz
  256.  
  257. release:    dist gawk-doc-$(REL).tar.gz gawk-ps-$(REL).tar.gz
  258.  
  259. test:    gawk
  260.     cd test; make -k
  261.  
  262. check:    test
  263.  
  264.