home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / sharutils-4.1-src.tgz / tar.out / fsf / sharutils / Makefile.in < prev    next >
Makefile  |  1996-09-28  |  8KB  |  260 lines

  1. # Makefile for GNU shar utilities.
  2. # Copyright (C) 1994 Free Software Foundation, Inc.
  3. # Francois Pinard <pinard@iro.umontreal.ca>, 1994.
  4.  
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2, or (at your option)
  8. # any later version.
  9.  
  10. # This program 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.  
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19. PRODUCT = @PRODUCT@
  20. VERSION = @VERSION@
  21. PROGRAMS = @PROGRAMS@
  22.  
  23. SHELL = /bin/sh
  24. srcdir = @srcdir@
  25. VPATH = @srcdir@
  26.  
  27. # These CFLAGS values, all pertaining to shar, are not auto-configured:
  28. # -DDEBUG=1        use -$ on call for activating debugging output
  29. # -DMSDOS=1        probably doesn't work but accounts for some old code
  30. # -DNO_WALKTREE=1    inhibit recursive walk on directory parameters
  31. # -DSTRNCMP_IS_FAST=1    if unefficient to compare first chars before strncmp
  32.  
  33. AR = ar
  34. CC = @CC@
  35. CFLAGS = @CFLAGS@
  36. CPPFLAGS = @CPPFLAGS@
  37. DEFS = @DEFS@
  38. INSTALL = @INSTALL@
  39. INSTALL_DATA = @INSTALL_DATA@
  40. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  41. LDFLAGS = @LDFLAGS@
  42. LIBS = @LIBS@
  43. MAKEINFO = makeinfo
  44. RANLIB = @RANLIB@
  45. TEXI2DVI = texi2dvi
  46.  
  47. prefix = @prefix@
  48. exec_prefix = @exec_prefix@
  49. transform = @program_transform_name@
  50. bindir = $(exec_prefix)/bin
  51. infodir = $(prefix)/info
  52. man1dir = $(prefix)/man/man1
  53. man1ext = .1
  54. man5dir = $(prefix)/man/man5
  55. man5ext = .5
  56.  
  57. COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
  58. LINK = $(CC) $(LDFLAGS) -o $@
  59.  
  60. .SUFFIXES:
  61. .SUFFIXES: .c .o
  62. .c.o:
  63.     $(COMPILE) $<
  64.  
  65. ANSI2KNR = @ANSI2KNR@
  66. O = .@U@o
  67.  
  68. .SUFFIXES: ._c ._o
  69. .c._c:
  70.     ./ansi2knr $< > $@
  71. ._c._o:
  72.     @echo $(COMPILE) $<
  73.     @rm -f _$*.c
  74.     @ln $< _$*.c && $(COMPILE) _$*.c && mv _$*.o $@ && rm _$*.c
  75. .c._o:
  76.     ./ansi2knr $< > $*._c
  77.     @echo $(COMPILE) $*._c
  78.     @rm -f _$*.c
  79.     @ln $*._c _$*.c && $(COMPILE) _$*.c && mv _$*.o $@ && rm _$*.c
  80.  
  81. INCLUDES = -I. -I$(srcdir)
  82.  
  83. HEADERS = system.h
  84. SOURCES = encode.c shar.c unshar.c uudecode.c uuencode.c whoami.c
  85. OBJECTS = encode$O shar$O unshar$O uudecode$O uuencode$O whoami$O
  86. LIBHDRS = getopt.h pathmax.h
  87. LIBSRCS = error.c getopt.c getopt1.c xgetcwd.c xmalloc.c \
  88. xstrdup.c alloca.c basename.c memset.c mktime.c strftime.c
  89. LIBOBJS = error.o getopt.o getopt1.o xgetcwd.o xmalloc.o \
  90. xstrdup.o @ALLOCA@ @LIBOBJS@
  91.  
  92. DISTFILES = README NEWS TODO THANKS COPYING INSTALL ChangeLog \
  93. README.OLD ChangeLog.OLD \
  94. configure.in aclocal.m4 acconfig.h mkinstalldirs install-sh Makefile.in \
  95. sharutils.texi texinfo.tex shar.1 unshar.1 uuencode.1 uuencode.5 \
  96. ansi2knr.c ansi2knr.1 c-boxes.el \
  97. $(HEADERS) $(SOURCES) $(LIBHDRS) $(LIBSRCS) testdata \
  98. stamp-h.in config.h.in configure \
  99. stamp-vti version.texi sharutils.info TAGS BACKLOG
  100.  
  101. all: sharutils.info $(PROGRAMS)
  102.  
  103. info: sharutils.info
  104.  
  105. sharutils.info: sharutils.texi version.texi
  106.     cd $(srcdir) && $(MAKEINFO) --no-split sharutils.texi
  107.  
  108. dvi: sharutils.dvi
  109.  
  110. sharutils.dvi: sharutils.texi
  111.     $(TEXI2DVI) $(srcdir)/sharutils.texi
  112.  
  113. version.texi: stamp-vti
  114. stamp-vti: sharutils.texi configure.in
  115.     echo "@set EDITION $(VERSION)" > version.tmp
  116.     echo "@set UPDATED `date '+%B %Y'`" >> version.tmp
  117.     echo "@set VERSION $(VERSION)" >> version.tmp
  118.     if cmp -s version.tmp $(srcdir)/version.texi; then rm version.tmp; \
  119.     else mv version.tmp $(srcdir)/version.texi; fi
  120.     date > $(srcdir)/stamp-vti
  121.  
  122. shar: shar$O encode$O whoami$O libshutl.a
  123.     $(LINK) shar$O encode$O whoami$O libshutl.a $(LIBS)
  124.  
  125. unshar: unshar$O libshutl.a
  126.     $(LINK) unshar$O libshutl.a $(LIBS)
  127.  
  128. uudecode: uudecode$O libshutl.a
  129.     $(LINK) uudecode$O libshutl.a $(LIBS)
  130.  
  131. uuencode: uuencode$O libshutl.a
  132.     $(LINK) uuencode$O libshutl.a $(LIBS)
  133.  
  134. $(OBJECTS): $(ANSI2KNR) config.h system.h
  135. shar$O unshar$O uudecode$O uuencode$O: getopt.h
  136.  
  137. ansi2knr: ansi2knr.o
  138.     $(LINK) ansi2knr.o $(LIBS)
  139.  
  140. libshutl.a: $(LIBOBJS)
  141.     rm -f libshutl.a
  142.     $(AR) cru libshutl.a $(LIBOBJS)
  143.     $(RANLIB) libshutl.a
  144.  
  145. $(LIBOBJS): config.h
  146. getopt.o getopt1.o: getopt.h
  147. xgetcwd.o: pathmax.h
  148.  
  149. check: uuencode uudecode testdata
  150.     rm -f test.bin test.tmp
  151.     ./uudecode $(srcdir)/testdata
  152.     ./uuencode test.bin test.bin > test.tmp
  153.     cmp $(srcdir)/testdata test.tmp
  154.     rm -f test.bin test.tmp
  155.     @echo Check successful
  156.  
  157. install: all
  158.     $(srcdir)/mkinstalldirs $(bindir) $(infodir)
  159.     for name in $(PROGRAMS); do \
  160.       $(INSTALL_PROGRAM) $$name \
  161.         $(bindir)/`echo $$name | sed '$(transform)'`; \
  162.     done
  163.     $(INSTALL_DATA) $(srcdir)/sharutils.info $(infodir)/sharutils.info
  164.  
  165. uninstall:
  166.     for name in $(PROGRAMS); do
  167.       rm -f $(bindir)/`echo $$name | sed '$(transform)'`; \
  168.     done
  169.     rm -f $(infodir)/sharutils.info
  170.  
  171. # man page installation is kept separate from install.  Better think
  172. # GNU and switch to Info.  The following is for irreductible fellows.
  173.  
  174. install-man:
  175.     $(srcdir)/mkinstalldirs $(man1dir) $(man5dir)
  176.     for name in shar unshar uuencode; do \
  177.       $(INSTALL_DATA) $(srcdir)/$$name.1 \
  178.         $(man1dir)/`echo $$name | sed '$(transform)'`$(man1ext); \
  179.     done
  180.     rm -f $(man1dir)/`echo uudecode | sed '$(transform)'`$(man1ext)
  181.     ln $(man1dir)/`echo uuencode | sed '$(transform)'`$(man1ext) \
  182.         $(man1dir)/`echo uudecode | sed '$(transform)'`$(man1ext)
  183.     $(INSTALL_DATA) $(srcdir)/`echo uuencode | sed '$(transform)'`.5 \
  184.         $(man5dir)/`echo uuencode | sed '$(transform)'`$(man5ext)
  185.  
  186. uninstall-man:
  187.     for name in shar unshar uudecode uuencode; do \
  188.       rm -f $(man1dir)/`echo $$name | sed '$(transform)'`$(man1ext); \
  189.     done
  190.     rm -f $(man5dir)/`echo uuencode | sed '$(transform)'`$(man5ext)
  191.  
  192. tags: TAGS
  193.  
  194. TAGS: $(HEADERS) $(SOURCES) $(LIBHDRS) $(LIBSRCS)
  195.     cd $(srcdir) && etags $(HEADERS) $(SOURCES) $(LIBHDRS) $(LIBSRCS)
  196.  
  197. mostlyclean:
  198.     rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.log *.pg *.toc *.tp *.vr
  199.     rm -f *.a *.o *._c *._o core core.*
  200.     rm -f *.tmp test.bin test.tmp
  201.  
  202. clean: mostlyclean
  203.     rm -f shar unshar uudecode uuencode
  204.  
  205. distclean: clean
  206.     rm -f ansi2knr
  207.     rm -f Makefile config.cache config.h config.log stamp-h config.status
  208.  
  209. realclean: distclean
  210.     rm -f stamp-vti version.texi sharutils.info
  211.     rm -f TAGS
  212.  
  213. dist: $(DISTFILES)
  214.     rm -rf $(PRODUCT)-$(VERSION)
  215.     mkdir $(PRODUCT)-$(VERSION)
  216.     chmod 777 $(PRODUCT)-$(VERSION)
  217.     @echo "Copying distribution files"
  218.     @for file in $(DISTFILES); do \
  219.       ln $(srcdir)/$$file $(PRODUCT)-$(VERSION) 2> /dev/null \
  220.         || cp -p $(srcdir)/$$file $(PRODUCT)-$(VERSION); \
  221.     done
  222.     chmod -R a+r $(PRODUCT)-$(VERSION)
  223.     tar chozf $(PRODUCT)-$(VERSION).tar.gz $(PRODUCT)-$(VERSION)
  224.     rm -rf $(PRODUCT)-$(VERSION)
  225.  
  226. dist-shar: $(DISTFILES) shar
  227.     rm -rf $(PRODUCT)-$(VERSION)
  228.     mkdir $(PRODUCT)-$(VERSION)
  229.     chmod 777 $(PRODUCT)-$(VERSION)
  230.     @echo "Copying distribution files"
  231.     @for file in $(DISTFILES); do \
  232.       ln $(srcdir)/$$file $(PRODUCT)-$(VERSION) \
  233.         || cp -p $(srcdir)/$$file $(PRODUCT)-$(VERSION); \
  234.     done
  235.     chmod -R a+r $(PRODUCT)-$(VERSION)
  236.     ./shar -cF -L40 -o$(PRODUCT)-$(VERSION).shar $(PRODUCT)-$(VERSION)
  237.     rm -rf $(PRODUCT)-$(VERSION)
  238.  
  239. # For an explanation of the following Makefile rules, see node
  240. # `Automatic Remaking' in GNU Autoconf documentation.
  241. Makefile: Makefile.in config.status
  242.     CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
  243. config.status: configure
  244.     ./config.status --recheck
  245. configure: configure.in aclocal.m4
  246.     cd $(srcdir) && autoconf
  247.  
  248. config.h: stamp-h
  249. stamp-h: config.h.in config.status
  250.     CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
  251.     date > stamp-h
  252. config.h.in: stamp-h.in
  253. stamp-h.in: configure.in aclocal.m4 acconfig.h
  254.     cd $(srcdir) && autoheader
  255.     date > $(srcdir)/stamp-h.in
  256.  
  257. # Tell versions [3.59,3.63) of GNU make not to export all variables.
  258. # Otherwise a system limit (for SysV at least) may be exceeded.
  259. .NOEXPORT:
  260.