1 # Makefile for "top", a top 10 process display for Unix
3 # This makefile is for top, version 3
5 # Written by William LeFebvre, Group sys Consulting
6 # (formerly of Northwestern University and Rice University)
8 # DO NOT EDIT "Makefile"!!!! Make changes to "Makefile.X" and rerun
11 # Executables (these should be obvious):
18 # installation information:
19 # OWNER - name (or uid) for the installed executable's owner
20 # GROUP - group name (or gid) for the installed executable's group
21 # MODE - mode for the installed executable (should start with a 0)
22 # BINDIR - directory where the executable should live
23 # MANDIR - directory where the manual page should live
24 # MANEXT - installed man pages end in .$(MANEXT)
25 # MANSTY - "man" or "catman" depending on what's to be installed
26 # SIGNAL - <signal.h> or <sys/signal.h>; the one with signal definitions
27 # TROFF - most appropriate troff command
38 # Values for the two defaults in "top":
39 # TOPN - default number of processes to display
40 # DELAY - default delay between updates
42 # set TOPN to -1 to indicate infinity (so that top will display as many
43 # as the screen will hold).
48 CFILES = top.c commands.c display.c screen.c username.c \
49 utils.c version.c getopt.c machine.c
50 OBJS = top.o commands.o display.o screen.o username.o \
51 utils.o version.o getopt.o machine.o
58 CFLAGS = %cflgs% $(CDEFS)
59 LINTFLAGS = -x $(CDEFS)
61 all: Makefile top.local.h top
64 @echo 'You need to run the script "Configure" before running "make".'
67 top.local.h: top.local.H
68 @echo 'You need to run the script "Configure" before running "make".'
73 $(CC) $(CDEFS) -o top $(OBJS) $(TERMCAP) $(MATH) $(LIBS)
76 $(LINT) $(LINTFLAGS) $(CFILES)
78 # include file dependencies
79 top.o: boolean.h display.h screen.h top.h top.local.h utils.h machine.h
80 commands.o: boolean.h sigdesc.h top.h utils.h
81 display.o: boolean.h display.h layout.h screen.h top.h top.local.h utils.h
82 screen.o: boolean.h screen.h
84 version.o: top.h patchlevel.h
85 username.o: top.local.h utils.h
87 # when compiling machine.c, include os revision definition
88 machine.o: machine.c top.h machine.h utils.h
89 $(CC) "%osrev%" $(CFLAGS) -c machine.c
91 # automatically built include file
92 sigdesc.h: sigconv.awk $(SIGNAL)
93 $(AWK) -f sigconv.awk $(SIGNAL) >sigdesc.h
96 rm -f *.o top core core.* sigdesc.h
99 rm -f Make.desc machine/*.desc .defaults top.tar SYNOPSIS Makefile top.local.h top.1 machine.c prime
101 install: top top.1 install-top install-$(MANSTY)
104 $(INSTALL) -o $(OWNER) -m $(MODE) -g $(GROUP) top $(BINDIR)
107 $(INSTALL) top.1 $(MANDIR)/top.$(MANEXT)
110 tbl top.1 | nroff -man > $(MANDIR)/top.$(MANEXT)
112 installmeta: top top.1
113 $(INSTALL) -o $(OWNER) -m 755 -g $(GROUP) metatop $(BINDIR)/top
114 @echo $(INSTALL) -o $(OWNER) -m $(MODE) -g $(GROUP) top $(BINDIR)/top-`uname -m`-`uname -r`
115 @$(INSTALL) -o $(OWNER) -m $(MODE) -g $(GROUP) \
116 top $(BINDIR)/top-`uname -m`-`uname -r`
117 $(INSTALL) top.1 $(MANDIR)/top.$(MANEXT)