home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gnuawk.zip / atari / Makefile.awklib < prev    next >
Makefile  |  1996-11-07  |  3KB  |  110 lines

  1. # Makefile for GNU Awk support library
  2. # Copy this file to 'awklib' subdirectory of main directory
  3. # and execute via relevant targets in your top Makefile
  4. #
  5. # This Makefile actually will work for awklib even when NOT
  6. # compiling with Atari Makefile!!!
  7. #
  8. # Copyright (C) 1995, 96 the Free Software Foundation, Inc.
  9. # This file is part of GAWK, the GNU implementation of the
  10. # AWK Programming Language.
  11. # GAWK is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version.
  15. # GAWK is distributed in the hope that it will be useful,
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. # GNU General Public License for more details.
  19. # You should have received a copy of the GNU General Public License
  20. # along with this program; if not, write to the Free Software
  21. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
  22.  
  23. SHELL = /bin/sh
  24.  
  25. srcdir = .
  26.  
  27. INSTALL = /usr/bin/install -c
  28. INSTALL_PROGRAM = ${INSTALL}
  29. INSTALL_DATA = ${INSTALL} -m 644
  30.  
  31. CC = gcc
  32. CFLAGS = -g -O
  33.  
  34. prefix = /usr/local
  35. exec_prefix = ${prefix}
  36. binprefix =
  37. manprefix =
  38.  
  39. bindir = ${exec_prefix}/bin
  40. libdir = ${exec_prefix}/lib
  41. mandir = ${prefix}/man/man1
  42. manext = .1
  43. infodir = ${prefix}/info
  44. datadir = ${prefix}/share/awk
  45. libexecdir = ${exec_prefix}/libexec/awk
  46.  
  47. # default names of library utilities; on some systems they may require
  48. # names with extenstions
  49. PWCAT = pwcat
  50. GRCAT = grcat
  51. # the following command used, when necessary, for edits when
  52. # creating igawk from igawk.sh
  53. GCOM = '{print}'
  54. GAWK = gawk
  55. # $(AWK) is a by default freshly compiled gawk or installed awk when
  56. # cross-compiling; it is used for edits, since we may compile not on
  57. # Unix machine and an utility like 'sed' may NOT exist there
  58. AWK = $(srcdir)/../$(GAWK)
  59. AUXPROGS = $(PWCAT) $(GRCAT)
  60. AUXAWK = passwd.awk group.awk
  61.  
  62. all: stamp-eg $(AUXPROGS) igawk $(AUXAWK)
  63.  
  64. stamp-eg: $(srcdir)/../doc/gawk.texi
  65.     rm -fr eg stamp-eg
  66.     $(AWK) -f $(srcdir)/extract.awk $(srcdir)/../doc/gawk.texi
  67.     @echo 'some makes are stupid and will not check a directory' > stamp-eg
  68.     @echo 'against a file, so this file is a place holder. gack.' >> stamp-eg
  69.  
  70. $(PWCAT): $(srcdir)/eg/lib/pwcat.c
  71.     $(CC) $(CFLAGS) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@
  72.  
  73. $(GRCAT): $(srcdir)/eg/lib/grcat.c
  74.     $(CC) $(CFLAGS) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@
  75.  
  76. igawk: $(srcdir)/eg/prog/igawk.sh
  77.     $(AWK) $(GCOM) $(srcdir)/eg/prog/igawk.sh > $@ ; chmod 755 $@
  78.  
  79. passwd.awk: $(srcdir)/eg/lib/passwdawk.in
  80.     $(AWK) '{gsub(/\/usr\/local\/libexec\/awk/, "$(libexecdir)"); print}' \
  81.     $? > $@
  82.  
  83. group.awk: $(srcdir)/eg/lib/groupawk.in
  84.     $(AWK) '{gsub(/\/usr\/local\/libexec\/awk/, "$(libexecdir)"); print}' \
  85.     $? > $@
  86.  
  87. install: igawk $(AUXPROGS) $(AUXAWK)
  88.     $(INSTALL_PROGRAM) igawk $(bindir)/igawk && chmod 755 $(bindir)/igawk
  89.     for i in $(AUXPROGS) ; do \
  90.         $(INSTALL_PROGRAM) $$i $(libexecdir)/$$i ; \
  91.     done
  92.     for i in $(AUXAWK) $(srcdir)/eg/lib/*.awk ; do \
  93.         $(INSTALL_DATA) $$i $(datadir)/$$i ; \
  94.     done
  95.  
  96. # libexecdir and bindir are removed in the top level Makefile's uninstall
  97. uninstall:
  98.     rm -fr $(libexecdir)/* $(datadir)/*
  99.     rm -f $(bindir)/igawk
  100.  
  101. clean:
  102.     rm -f $(AUXPROGS) $(AUXAWK) igawk *~
  103.  
  104. distclean: clean
  105.     rm -f Makefile
  106.