home *** CD-ROM | disk | FTP | other *** search
/ ftp.muug.mb.ca / 2014.06.ftp.muug.mb.ca.tar / ftp.muug.mb.ca / pub / src / top / Makefile < prev    next >
Makefile  |  1992-05-26  |  3KB  |  110 lines

  1. # Makefile for "top", a top 10 process display for Unix
  2. #
  3. # This makefile is for top, version 2.5
  4. #
  5. # Written by William LeFebvre, Rice University graduate student
  6.  
  7. # installation information:
  8. #    OWNER    - name (or uid) for the installed executable's owner
  9. #    GROUP    - group name (or gid) for the installed executable's group
  10. #    MODE    - mode for the installed executable (should start with a 0)
  11. #    BINDIR    - directory where the executable should live
  12. #    MANDIR    - directory where the manual page should live
  13. #    MAN    - troff macros for manual pages
  14. #    TROFF    - most appropriate troff command
  15.  
  16. CC     = gcc
  17. OWNER  = root
  18. GROUP  = staff
  19. MODE   = 755
  20. BINDIR = /export/sun4/sunos4.1/Misc/Bin
  21. MANDIR = /export/sun4/sunos4.1/Misc/Man/man1
  22. MAN    = man
  23. TROFF  = troff
  24.  
  25. # Values for the two defaults in "top":
  26. #    TOPN    - default number of processes to display
  27. #    DELAY    - default delay between updates
  28. #
  29. # set TOPN to -1 to indicate infinity (so that top will display as many
  30. # as the screen will hold).
  31.  
  32. TOPN = -1
  33. #TOPN = 10
  34. DELAY = 5
  35.  
  36. # Top maintains an internal hash table for translating uid to username.
  37. # This hash table must be big enough to hold every name in /etc/passwd.
  38. # It is possible, but not necessary, to specify the hash table size in
  39. # this Makefile.  Just uncomment the following line and provide a number.
  40. TABLE = -DTable_size=503
  41.  
  42. TARFILES = README Changes Changes.scs Makefile top.c commands.c display.c \
  43.        kernel.c screen.c utils.c getopt.c \
  44.        boolean.h layout.h screen.h top.h top.local.h bzero.c \
  45.        sigconv.awk top.man
  46. CFILES = top.c commands.c display.c kernel.c screen.c utils.c getopt.c
  47. OBJS = top.o commands.o display.o kernel.o screen.o utils.o getopt.o
  48.  
  49. LINTFLAGS = -x
  50.  
  51. # Top uses the preprocessor variables "sun", "pyr" and "scs" for specific
  52. # changes required by Suns, Pyramids and Symmetrics.  No changes to "CFLAGS"
  53. # or "CDEFS" are required for these architectres.
  54.  
  55. # To make a version for 4.1, # uncomment the following two lines:
  56. #CDEFS = -DFOUR_ONE
  57. #OBJS = top.o commands.o display.o kernel.o screen.o getopt.o bzero.o
  58.  
  59. # To make a version for sunOS 4.0, uncomment the following two lines:
  60. CDEFS = -Dsunos4
  61. LIBS= -lkvm
  62.  
  63. CFLAGS = -O $(CDEFS)
  64.  
  65. all: top top.1
  66.  
  67. top: $(OBJS)
  68.     $(CC) $(CFLAGS) -o top $(OBJS) -ltermcap -lm $(LIBS)
  69.  
  70. top.o: top.c Makefile
  71.     $(CC) -c $(CFLAGS) $(TABLE) -DDefault_TOPN=$(TOPN) -DDefault_DELAY=$(DELAY) top.c
  72.  
  73. lint: sigdesc.h
  74.     lint $(LINTFLAGS) -DDefault_TOPN=$(TOPN) -DDefault_DELAY=$(DELAY) $(CFILES)
  75.  
  76. # include file dependencies
  77. top.o: boolean.h layout.h screen.h top.h top.local.h
  78. commands.o: sigdesc.h
  79. display.o: boolean.h layout.h screen.h top.h top.local.h
  80. kernel.o: top.local.h
  81. screen.o: boolean.h screen.h
  82. utils.o: top.h
  83.  
  84. # automatically built include file
  85. sigdesc.h: sigconv.awk /usr/include/signal.h
  86.     awk -f sigconv.awk /usr/include/signal.h >sigdesc.h
  87.  
  88. # top.1 is built by combining the actual text with the default information
  89. top.1: top.man Makefile
  90.     echo '.nr N' $(TOPN) > top.1
  91.     echo '.nr D' $(DELAY) >>top.1
  92.     cat top.man >>top.1
  93.  
  94. top.cat: top.1
  95.     nroff -$(MAN) top.1 | cat -s >top.cat
  96.  
  97. troff: top.1
  98.     $(TROFF) -man top.1
  99.  
  100. tar:
  101.     rm -f top.tar
  102.     tar cvf top.tar $(TARFILES)
  103.  
  104. clean:
  105.     rm -f *.o top top.cat top.tar top.1 core
  106.  
  107. install: top top.1
  108.     install -s -o $(OWNER) -m $(MODE) -g $(GROUP) top $(BINDIR)
  109.     install -c top.1 $(MANDIR)
  110.