home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gnuawk.zip / atari / Makefile.st < prev    next >
Makefile  |  1996-12-09  |  8KB  |  283 lines

  1. # Makefile for GNU Awk - ST version.
  2. #
  3. # This makefile hand edited from Makefile automatically generated
  4. # by configure - gcc 2.x.x compiler with TOS version of libraries
  5. # and modified system().
  6. # Check comments in this Makefile and adjust to your needs!!
  7. #
  8. # This Makefile assumes that you are using Bourne compatible shell
  9. # (like bash). If this is not the case you will have to edit various
  10. # targets or perform some actions by hand.
  11. #
  12. # Copyright (C) 1986, 1988-1996 the Free Software Foundation, Inc.
  13. # This file is part of GAWK, the GNU implementation of the
  14. # AWK Programming Language.
  15. # GAWK is free software; you can redistribute it and/or modify
  16. # it under the terms of the GNU General Public License as published by
  17. # the Free Software Foundation; either version 2 of the License, or
  18. # (at your option) any later version.
  19. # GAWK is distributed in the hope that it will be useful,
  20. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22. # GNU General Public License for more details.
  23. # You should have received a copy of the GNU General Public License
  24. # along with this program; if not, write to the Free Software
  25. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
  26.  
  27.  
  28. MAKEINFO = makeinfo --no-split
  29.  
  30. srcdir = .
  31.  
  32. # native compiler with freshly compiled gawk.ttp to fix awklib
  33. GAWK = gawk.ttp
  34. CC = gcc
  35.  
  36. # cross-compiler and gawk already installed on the system (any awk will do)
  37. # GAWK = gawk
  38. # CC = cgcc
  39.  
  40. # WIDTH and EXT have to be both defined or both undefined
  41. # WIDTH = -mshort -DINT_IS_16BIT
  42. # EXT = 16
  43.  
  44. OFLAGS = -O2 -Wall -fomit-frame-pointer $(WIDTH)
  45. LDFLAGS = $(WIDTH)
  46. YACC = bison -y
  47.  
  48. # xstrip -k in target gawk.ttp removes all symbols but _stksize
  49. # allowing for stack size manipulations without recompiling (with fixstk)
  50. INSTALL = xstrip -k ; cp -p
  51. INSTALL_PROGRAM = ${INSTALL}
  52. #INSTALL_DATA = ${INSTALL} -m 644
  53. INSTALL_DATA = ${INSTALL}
  54.  
  55. LIBS = -lpml$(EXT)
  56.  
  57. ALLOCA = 
  58.  
  59. #all these definitions likely require changes
  60. exec_prefix = ${prefix}
  61. prefix = /usr/local
  62. binprefix =
  63. manprefix =
  64.  
  65. bindir = ${exec_prefix}/bin
  66. libdir = ${exec_prefix}/lib
  67. manexta = l
  68. mandir = ${prefix}/man/man$(manexta)
  69. manext = .$(manexta)
  70. infodir = ${prefix}/info
  71. #datadir = ${prefix}/share/awk
  72. datadir = ${prefix}/lib/awk
  73. libexecdir = ${exec_prefix}/lib/awk
  74.  
  75. #DEFPATH = ".:$(datadir)"
  76. # datadir is passed to the next Makefile level and through sed
  77. # you may need many more backslashes than that if you have to use
  78. # them at all - sigh...
  79. DEFPATH = ".,c:\\lib\\awk,c:\\gnu\\lib\\awk"
  80.  
  81. SHELL = /bin/sh
  82.  
  83. SHELL = /bin/sh
  84. #CFLAGS = -g -O
  85. CFLAGS = $(OFLAGS)
  86. COMPFLAGS = $(CFLAGS) -DGAWK -I. -I$(srcdir) -DHAVE_CONFIG_H
  87.  
  88. MFLAGS = "CC=$(CC)" \
  89.   "CFLAGS=$(CFLAGS)" \
  90.    GAWK=../$(GAWK) \
  91.    AWK=awk \
  92.    PWCAT=pwcat.ttp GRCAT=grcat.ttp \
  93.   "GCOM='{sub(/\":\"/, \"\\\",\\\"\"); print}'" \
  94.   "COMPFLAGS=$(COMPFLAGS)" \
  95.   "LDFLAGS=$(LDFLAGS)" \
  96.   "INSTALL=$(INSTALL)" \
  97.   "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
  98.   "INSTALL_DATA=$(INSTALL_DATA)" \
  99.   "bindir=$(bindir)" \
  100.   "libdir=$(libdir)" \
  101.   "mandir=$(mandir)" \
  102.   "manext=$(manext)" \
  103.   "infodir=$(infodir)" \
  104.   "datadir=$(datadir)" \
  105.   "libexecdir=$(libexecdir)"
  106.  
  107. MMAKE = $(MAKE) $(MFLAGS)
  108.  
  109. # object files
  110. AWKOBJS = array.o builtin.o eval.o field.o gawkmisc.o io.o main.o \
  111.     missing.o msg.o node.o re.o version.o
  112.  
  113. ALLOBJS = $(AWKOBJS) awktab.o
  114.  
  115. # LIBOBJS
  116. #    GNU and other stuff that gawk uses as library routines.
  117. LIBOBJS= getopt.o getopt1.o regex.o dfa.o random.o $(ALLOCA)
  118.  
  119. # source and documentation files
  120. SRC = array.c builtin.c eval.c field.c gawkmisc.c io.c main.c \
  121.     missing.c msg.c node.c re.c version.c
  122.  
  123. ALLSRC= $(SRC) awktab.c
  124.  
  125. AWKSRC= awk.h awk.y custom.h $(ALLSRC) patchlevel.h protos.h random.h
  126.  
  127. LIBSRC = alloca.c dfa.c dfa.h regex.c regex.h getopt.h getopt.c getopt1.c random.c
  128.  
  129. COPIES = missing/system.c missing/tzset.c \
  130.     missing/memcmp.c missing/memcpy.c missing/memset.c \
  131.     missing/strncasecmp.c missing/strchr.c \
  132.     missing/strerror.c missing/strtod.c \
  133.     missing/strftime.c missing/strftime.3 
  134.  
  135. DOCS= doc/gawk.1 doc/gawk.texi doc/texinfo.tex
  136.  
  137. TEXFILES= doc/gawk.aux doc/gawk.cp doc/gawk.cps doc/gawk.fn doc/gawk.fns \
  138.       doc/gawk.ky doc/gawk.kys doc/gawk.pg doc/gawk.pgs doc/gawk.toc \
  139.       doc/gawk.tp doc/gawk.tps doc/gawk.vr doc/gawk.vrs
  140.  
  141. MISC =    NEWS COPYING FUTURES Makefile.in PROBLEMS README PORTS POSIX.STD \
  142.     configure configure.in acconfig.h configh.in ACKNOWLEDGMENT \
  143.     ChangeLog INSTALL LIMITATIONS install-sh mkinstalldirs aclocal.m4 \
  144.     stamp-h.in
  145.  
  146. OTHERS= amiga doc pc atari vms README_d posix awklib
  147.  
  148. ALLDOC= doc/gawk.dvi $(TEXFILES) doc/gawk.info*
  149.  
  150. MAKEFILEIN = Makefile.in awklib/Makefile.in doc/Makefile.in test/Makefile.in
  151.  
  152. # Release of gawk.  There can be no leading or trailing white space here!
  153. REL=3.0
  154.  
  155. # clear out suffixes list
  156. .SUFFIXES:
  157. .SUFFIXES: .c .o
  158.  
  159. .c.o:
  160.     $(CC) -c $(COMPFLAGS) $<
  161.  
  162. # rules to build gawk
  163. all:    $(GAWK) awklib/all
  164.  
  165. alldoc: all doc/all
  166.  
  167. $(GAWK):    $(ALLOBJS) $(LIBOBJS) $(REOBJS)
  168.     $(CC) -o $(GAWK) $(COMPFLAGS) $(LDFLAGS) $(ALLOBJS) $(LIBOBJS) \
  169.     $(REOBJS) $(LIBS)
  170.  
  171. $(ALLOBJS):    awk.h dfa.h regex.h config.h custom.h
  172.  
  173. $(LIBOBJS):    config.h custom.h
  174.  
  175. gawkmisc.o:    $(srcdir)/atari/gawkmisc.atr
  176.     $(CC) -c $(COMPFLAGS) -DDEFPATH='$(DEFPATH)' $(srcdir)/gawkmisc.c
  177.  
  178. # this rule needed or not - depending on your library
  179. missing.o io.o:    
  180.     $(CC) -c $(COMPFLAGS) -DPIPES_SIMULATED $(srcdir)/$<
  181.  
  182. # cheat with defines to force an inclusion of a proper code
  183. getopt.o:    getopt.h
  184.     $(CC) $(CFLAGS) -D_LIBC -D__alloca=__builtin_alloca -c getopt.c
  185.   
  186. getopt.o:    getopt.h
  187.  
  188. getopt1.o:    getopt.h
  189.  
  190. random.o:    random.h
  191.  
  192. main.o:    patchlevel.h
  193.  
  194. awktab.c:    awk.y
  195.     $(YACC) -v $(srcdir)/awk.y && \
  196.     if test -f y.tab.c ; then mv y.tab.c ytab.c ; else true ; fi && \
  197.     sed '/^extern char .malloc(), .realloc();$$/d' ytab.c >awktab.c && \
  198.     rm ytab.c
  199.  
  200. # VMS POSIX make won't apply the default .c.o rule to awktab.o for some reason
  201. awktab.o:    awktab.c awk.h
  202.     $(CC) -c $(COMPFLAGS) $(srcdir)/awktab.c
  203.  
  204. alloca.o:    alloca.c
  205.  
  206. install:    $(GAWK) info installdirs
  207.     $(INSTALL_PROGRAM) $(GAWK) $(bindir) && chmod 755 $(bindir)/$(GAWK)
  208.     cd awklib && $(MMAKE) install
  209.  
  210. installdirs: mkinstalldirs
  211.     $(srcdir)/mkinstalldirs $(bindir) $(datadir) \
  212.         $(libdir) $(infodir) $(mandir) $(libexecdir)
  213.  
  214. installdoc:    info
  215.     cd doc && $(MMAKE) install
  216.  
  217. #    
  218. #installtotal:    installdirs install installdoc
  219.  
  220. uninstall:
  221.     rm -f $(bindir)/$(GAWK)
  222.     cd awklib && $(MMAKE) uninstall
  223.     -rmdir $(datadir) $(libexecdir)
  224. #    cd doc && $(MMAKE) uninstall
  225.  
  226. clean:
  227.     rm -rf $(GAWK) *.o core y.output
  228.     cd awklib && $(MMAKE) clean
  229. # the following does not always make sense (when crosscompiling)
  230. #    cd test && $(MAKE) $(MFLAGS) clean
  231. #    cd doc && $(MAKE) $(MFLAGS) clean
  232.  
  233. local-distclean:
  234.     rm -f Makefile *.orig *.rej */*.orig */*.rej awk.output \
  235.         gmon.out make.out config.h config.status config.cache \
  236.         config.log stamp-h *~
  237.  
  238. distclean: clean local-distclean
  239.     cd doc && $(MMAKE) distclean
  240.     cd awklib && $(MMAKE) distclean
  241.     cd test && $(MMAKE) distclean
  242.  
  243. maintainer-clean: clean local-distclean
  244.     @echo "This command is intended for maintainers to use; it"
  245.     @echo "deletes files that may require special tools to rebuild."
  246.     rm -f awktab.c TAGS tags
  247.     cd doc && $(MMAKE) maintainer-clean
  248. #    cd test && $(MMAKE) maintainer-clean
  249. #    cd awklib && $(MMAKE) maintainer-clean
  250.  
  251. clobber:    maintainer-clean
  252.  
  253. TAGS:
  254.     etags $(AWKSRC)
  255.  
  256. tags:
  257.     ctags $(AWKSRC)
  258.  
  259. dvi:    $(srcdir)/doc/gawk.texi
  260.     cd doc && $(MMAKE) dvi
  261.  
  262. info:    $(srcdir)/doc/gawk.texi
  263.     cd doc && $(MMAKE) info
  264.  
  265. doc/all:
  266.     cd doc && $(MMAKE) all
  267.  
  268. awklib/all:
  269.     cd awklib && $(MMAKE) all
  270.  
  271. # to run this target you have to adjust test/Makefile quite a bit
  272. # in order to make it palatable to your shell
  273. #
  274. check:    $(GAWK)
  275.     cd test; $(MMAKE) -k
  276.  
  277. test:    check
  278.  
  279.