home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d7xx / d702 / indent.lha / Indent / Indent.lha / indent-1.4Makefile < prev    next >
Makefile  |  1992-06-10  |  4KB  |  160 lines

  1. # Copyright (c) 1985 Sun Microsystems, Inc.
  2. # Copyright (c) 1980 The Regents of the University of California.
  3. # Copyright (c) 1976 Board of Trustees of the University of Illinois.
  4. # All rights reserved.
  5.  
  6. # Redistribution and use in source and binary forms are permitted
  7. # provided that the above copyright notice and this paragraph are
  8. # duplicated in all such forms and that any documentation,
  9. # advertising materials, and other materials related to such
  10. # distribution and use acknowledge that the software was developed
  11. # by the University of California, Berkeley, the University of Illinois,
  12. # Urbana, and Sun Microsystems, Inc.  The name of either University
  13. # or Sun Microsystems may not be used to endorse or promote products
  14. # derived from this software without specific prior written permission.
  15. # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  16. # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  17. # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  18.  
  19.  
  20.  
  21. # Configurable things
  22. #
  23. AWK = awk
  24. MAKEINFO = makeinfo
  25. # CFLAGS = -O -g -W -DDEBUG
  26. CFLAGS = -O -g
  27. CC = gcc
  28.  
  29. # Used only for making distributions.  If you don't have GNU tar,
  30. # you must change the make command below in the `tarfile:' section.
  31. TAR = tar
  32.  
  33. DVITOGHOSTSCRIPT = dvi2ps indent.dvi > indent.ps
  34. CTAGS = etags
  35. INSTALL = install
  36.  
  37. # Where to install things
  38. prefix = /usr/local
  39. bindir = $(prefix)/bin
  40. infodir = $(prefix)/info
  41.  
  42.  
  43. # Non-configurable -- do not change
  44. #
  45. SHELL =   /bin/sh
  46. SRC =      indent.c io.c lexi.c parse.c pr_comment.c args.c globs.c backup.c
  47. OBJ =      indent.o io.o lexi.o parse.o pr_comment.o args.o globs.o backup.o
  48. HEADERS = indent.h sys.h version.h backup.h
  49. MAN =      indent.texinfo texinfo.tex
  50. NOTES =   ChangeLog OChangeLog Projects
  51.  
  52. CONFIG = config.sh
  53. CONFIG_OUTPUT = dirent_def.h
  54.  
  55. MANJUNK = indent.dvi indent.cp indent.cps indent.aux indent.dlog \
  56. indent.fn indent.fns indent.ky indent.kys indent.log indent.pg   \
  57. indent.pgs indent.toc indent.tp indent.tps indent.vr indent.vrs indent.ps 
  58.  
  59. # What to put in a distribution
  60. TARFILES = ${SRC} Makefile ${MAN} indent.info ${HEADERS} ${NOTES} \
  61. indent.gperf ${CONFIG}
  62. RELEASEFILES =  RELEASE-NOTES README
  63.  
  64.  
  65. # Make the program and documentation
  66. #
  67. all: indent indent.info
  68.  
  69. indent: ${OBJ}
  70.     ${CC} -o $@ ${CFLAGS} ${OBJ}
  71.  
  72. ${OBJ}: indent.h sys.h Makefile
  73. args.o: version.h Makefile
  74. backup.o: backup.h sys.h ${CONFIG_OUTPUT}
  75.  
  76. ${CONFIG_OUTPUT}: config.sh
  77.     ${SHELL} config.sh
  78.  
  79. tags: ${SRC}
  80.     ${CTAGS} -t ${SRC} ${HEADERS}
  81. TAGS: tags
  82.  
  83.  
  84. # Documents
  85. #
  86. indent.ps: indent.dvi
  87.     ${DVITOGHOSTSCRIPT}
  88.  
  89. indent.dvi: indent.toc
  90.     tex indent.texinfo
  91.  
  92. indent.toc: ${MAN}
  93.     tex indent.texinfo
  94.  
  95. indent.info: ${MAN}
  96.     ${MAKEINFO} indent.texinfo
  97.  
  98.  
  99.  
  100. # Installation of indent
  101. #
  102. install: all
  103.     ${INSTALL} -c indent ${bindir}/indent
  104.     ${INSTALL} -c -m 644 indent.info ${infodir}/indent
  105.  
  106.  
  107. # Cleaning up
  108. #
  109. clean: mostlyclean
  110.     rm -f ${MANJUNK} ${CONFIG_OUTPUT} TAGS .depend
  111.  
  112. # Clean up distribution and info file
  113. realclean: clean
  114.     rm -f *.BAK indent.info
  115.     rm -f indent-*.tar*
  116.     rm -rf indent-*
  117.  
  118. # Clean up the .o files, leaving the man stuff
  119. mostlyclean:
  120.     rm -f ${OBJ} core indent
  121.  
  122.  
  123.  
  124. # Create a distribution file
  125. #
  126. DISTDIR = indent-${VERSION}
  127. TARFILE = indent-${VERSION}.tar
  128. DISTFILE = ${TARFILE}.Z
  129. AWKVERSION = ${AWK} '/define VERSION_STRING/ {printf "%s", \
  130.                      substr($$NF, 1, length($$NF) - 1)}' version.h
  131.  
  132.  
  133. dist: ${TARFILES}
  134.     @export VERSION ; VERSION=`${AWKVERSION}` ; ${MAKE} tarfile
  135. #    @unset VERSION
  136.  
  137. tar: dist
  138.  
  139. # NOTE: GNU tar has a compress option, -z, used below.  If you
  140. # do not have GNU tar, replace the tar line below with the following
  141. # two lines:
  142. #    tar -c -h -f ${TARFILE} ${DISTDIR}
  143. #    compress ${TARFILE}
  144. tarfile:
  145.     @test -f README-${VERSION} || (echo Missing file README-${VERSION}; exit 1)
  146.     @test -f RELEASE-NOTES-${VERSION} || (echo Missing file RELEASE-NOTES-${VERSION}; exit 1)
  147.     @echo Making compressed tar file, indent ${VERSION}
  148.     @echo
  149.     @rm -f README
  150.     @ln -s README-${VERSION} README
  151.     @rm -f RELEASE-NOTES
  152.     @ln -s RELEASE-NOTES-${VERSION} RELEASE-NOTES
  153.     @rm -rf ${DISTDIR}
  154.     @rm -f ${DISTFILE}
  155.     @mkdir ${DISTDIR}
  156.     @cd ${DISTDIR} ; for i in ${TARFILES} ${RELEASEFILES} ; do ln -s ../$$i . ; done
  157.     @${TAR} -c -v -h -z -f ${DISTFILE} ${DISTDIR}
  158.     @rm -rf ${DISTDIR}
  159.  
  160.