home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume39 / enh-du2 / part02 / Makefile < prev    next >
Encoding:
Makefile  |  1993-08-21  |  5.0 KB  |  187 lines

  1. # @(#) Makefile 1.20 93/08/18 00:08:53
  2.  
  3. ##############################################################################
  4. #
  5. # Site-specific customizations - please edit accordingly.
  6. #
  7.  
  8. SHELL = /bin/sh
  9. CC = cc
  10. OPTIM = -O
  11. #DEBUG = -g -DDEBUG
  12.  
  13. #
  14. # Specify any system specific "cc" flags here.
  15. #    WARNING - For HPUX see the rules section for building "fsinfo.o".
  16. #
  17. CDEFS =        # For most systems.
  18. #CDEFS = -I.    # If your system does not have a <stdlib.h> header file.
  19.  
  20. #
  21. # Specify any system specific libraries here.
  22. #
  23. LIBS = -lmalloc        # Use this for systems with a good malloc library.
  24. #LIBS =            # Use this if no special libraries needed.
  25. #LIBS = -lmalloc -ldir    # Recent SCO XENIX - define USE_DIR_DIRENT in config.h.
  26. #LIBS = -lmalloc -lx    # Old SCO XENIX - define USE_DIR_SYSNDIR in config.h.
  27.  
  28. #
  29. # If you want "make install" to work, you must do one of two things:
  30. # (1) create a script called "Install" in the current directory with
  31. # the installation instructions, or (2) customize the following definitions:
  32. #
  33. # CP - Define as the command to install things in their place.
  34. #
  35. # BINDIR - Define as the pathname of the directory where the executables
  36. #    and scripts go.
  37. #
  38. #    ==> If you want to suppress the installation of executables
  39. #        and scripts then comment out the BINDIR definition.
  40. #
  41. # STRIP, CHOWNEXE, CHGRPEXE, CHMODEXE - Various commands that can be
  42. #    performed on the executables and scripts after they are
  43. #    installed in place.  (STRIP is not done for scripts, just
  44. #    executables.)  If you do not want the associated command run,
  45. #    then either stick a ":" at the front of it or define it to
  46. #    something innocuous such as "true".
  47. #
  48. #
  49. # MANDIR - Define as the pathname of the directory where manual page
  50. #    source files go.
  51. #
  52. #    ==> If you want to suppress the installation of manual
  53. #        page source files then comment out the MANDIR definition.
  54. #
  55. # MANSUF - Define as the suffix to put at the end of manual page source
  56. #    files.
  57. #
  58. # CHOWNMAN, CHGRPMAN, CHMODMAN - Various commands that can be performed
  59. #    on the man page sources after they are installed in place.  If
  60. #    you do not want the associated command run, then either stick
  61. #    a ":" at the front of it or define it to something innocuous
  62. #    such as "true".
  63. #
  64. CP = cp
  65. BINDIR = /local/bin
  66. STRIP = : strip
  67. CHOWNEXE = chown bin
  68. CHGRPEXE = chgrp bin
  69. CHMODEXE = chmod 555
  70. MANDIR = /local/man/man1
  71. MANSUF = 1
  72. CHOWNMAN = chown bin
  73. CHGRPMAN = chgrp bin
  74. CHMODMAN = chmod 444
  75.  
  76. #
  77. # End of site-specific customizations.
  78. #
  79. ##############################################################################
  80.  
  81. CFLAGS = $(OPTIM) $(CDEFS) $(DEBUG)
  82. LDFLAGS = $(DEBUG)
  83. LINTFLAGS = $(CDEFS) -DNO_PROTOTYPE -DPTRTYPE=char
  84.  
  85. FILES = README du.c duentry.c fsinfo.c dusort.c \
  86.     patchlevel.h config.h du.h stdlib.h \
  87.     Makefile ngsizes du.1 dusort.1 ngsizes.1
  88.  
  89. all : du dusort ngsizes du.1 dusort.1 ngsizes.1
  90.  
  91. du : du.o duentry.o fsinfo.o
  92.     $(CC) $(LDFLAGS) -o $@ du.o duentry.o fsinfo.o $(LIBS)
  93.  
  94. du.o : du.c config.h du.h patchlevel.h
  95. duentry.o : duentry.c config.h du.h
  96. fsinfo.o : fsinfo.c config.h du.h
  97.  
  98. #
  99. # I've been told "fsinfo.c" breaks under HPUX with -D_POSIX_SOURCE and
  100. # you need to use -D_HPUX_SOURCE instead.  If this applies to you, you
  101. # might need to comment out the above rule for "fsinfo.o" and enable
  102. # the following.
  103. #
  104. #fsinfo.o : fsinfo.c config.h du.h
  105. #    $(CC) -D_HPUX_SOURCE $(OPTIM) $(DEBUG) fsinfo.c
  106. #
  107.  
  108. dusort : dusort.o
  109.     $(CC) $(LDFLAGS) -o $@ dusort.o $(LIBS)
  110.  
  111. dusort.o : dusort.c
  112.  
  113. clean :
  114.     rm -f du dusort *.o a.out core *.lint
  115.     -if test -d SCCS ; then sccs clean && sccs get Makefile ; fi
  116.  
  117. lint : du dusort
  118.     lint $(LINTFLAGS) du.c duentry.c fsinfo.c $(LIBS) >du.lint
  119.     lint $(LINTFLAGS) dusort.c $(LIBS) >dusort.lint
  120.  
  121. install : all
  122.     -test ! -f Install -a -f SCCS/s.Install && sccs get Install
  123.     -if test -f Install ; then \
  124.         ( set -x ; sh Install -$(MAKEFLAGS) ) ; \
  125.     else \
  126.         if test "X$(BINDIR)" != X -a -d "$(BINDIR)" ; then \
  127.             ( set -x ; $(MAKE) -$(MAKEFLAGS) install_bin ) ; \
  128.         fi ; \
  129.         if test "X$(MANDIR)" != X -a -d "$(MANDIR)" ; then \
  130.             ( set -x ; $(MAKE) -$(MAKEFLAGS) install_man ) ; \
  131.         fi ; \
  132.     fi
  133.  
  134. install_bin : $(BINDIR)/du $(BINDIR)/dusort $(BINDIR)/ngsizes
  135.  
  136. install_man : $(MANDIR)/du.$(MANSUF) $(MANDIR)/dusort.$(MANSUF) \
  137.         $(MANDIR)/ngsizes.$(MANSUF)
  138.  
  139. $(BINDIR)/du : du
  140.     rm -f $@
  141.     $(CP) $? $@
  142.     $(STRIP) $@
  143.     $(CHMODEXE) $@ ; $(CHGRPEXE) $@ ; $(CHOWNEXE) $@
  144.  
  145. $(BINDIR)/dusort : dusort
  146.     rm -f $@
  147.     $(CP) $? $@
  148.     $(STRIP) $@
  149.     $(CHMODEXE) $@ ; $(CHGRPEXE) $@ ; $(CHOWNEXE) $@
  150.  
  151. $(BINDIR)/ngsizes : ngsizes
  152.     rm -f $@
  153.     $(CP) $? $@
  154.     $(STRIP) $@
  155.     $(CHMODEXE) $@ ; $(CHGRPEXE) $@ ; $(CHOWNEXE) $@
  156.  
  157. $(MANDIR)/du.$(MANSUF) : du.1
  158.     rm -f $@
  159.     $(CP) $? $@
  160.     $(CHMODMAN) $@ ; $(CHGRPMAN) $@ ; $(CHOWNMAN) $@
  161.  
  162. $(MANDIR)/dusort.$(MANSUF) : dusort.1
  163.     rm -f $@
  164.     $(CP) $? $@
  165.     $(CHMODMAN) $@ ; $(CHGRPMAN) $@ ; $(CHOWNMAN) $@
  166.  
  167. $(MANDIR)/ngsizes.$(MANSUF) : ngsizes.1
  168.     rm -f $@
  169.     $(CP) $? $@
  170.     $(CHMODMAN) $@ ; $(CHGRPMAN) $@ ; $(CHOWNMAN) $@
  171.  
  172.  
  173. shar : du.shar
  174.  
  175. du.shar : $(FILES)
  176.     shar $(FILES) > $@
  177.  
  178.  
  179. #
  180. # yeah - go ahead and comment this out if it's creating problems
  181. #
  182. $(FILES) Install :
  183.     sccs get $@
  184.  
  185. sccs : $(FILES) Install
  186.  
  187.