1 | # Makefile for "top", a top 10 process display for Unix |
---|
2 | # |
---|
3 | # This makefile is for top, version 3 |
---|
4 | # |
---|
5 | # Written by William LeFebvre, Argonne National Laboratory |
---|
6 | # (formerly of Northwestern University and Rice University) |
---|
7 | |
---|
8 | # DO NOT EDIT "Makefile"!!!! Make changes to "Makefile.X" and rerun |
---|
9 | # Configure. |
---|
10 | |
---|
11 | # Executables (these should be obvious): |
---|
12 | |
---|
13 | SHELL = %shell% |
---|
14 | CC = %cc% |
---|
15 | AWK = %awk% |
---|
16 | INSTALL = %install% |
---|
17 | |
---|
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 |
---|
28 | |
---|
29 | OWNER = %owner% |
---|
30 | GROUP = %group% |
---|
31 | MODE = %mode% |
---|
32 | BINDIR = %bindir% |
---|
33 | MANDIR = %mandir% |
---|
34 | MANEXT = %manext% |
---|
35 | MANSTY = %mansty% |
---|
36 | SIGNAL = %signal% |
---|
37 | |
---|
38 | # Values for the two defaults in "top": |
---|
39 | # TOPN - default number of processes to display |
---|
40 | # DELAY - default delay between updates |
---|
41 | # |
---|
42 | # set TOPN to -1 to indicate infinity (so that top will display as many |
---|
43 | # as the screen will hold). |
---|
44 | |
---|
45 | TOPN = %topn% |
---|
46 | DELAY = %delay% |
---|
47 | |
---|
48 | TARFILES = README INSTALL DISCLAIMER FAQ ADVERTISEMENT \ |
---|
49 | Changes Configure Porting \ |
---|
50 | Makefile.X Make.desc.X getans install \ |
---|
51 | top.c commands.c display.c screen.c username.c \ |
---|
52 | utils.c version.c getopt.c prime.c \ |
---|
53 | boolean.h display.h layout.h loadavg.h screen.h \ |
---|
54 | machine.h patchlevel.h top.h top.local.H os.h utils.h \ |
---|
55 | sigconv.awk top.X m-template metatop \ |
---|
56 | machine |
---|
57 | CFILES = top.c commands.c display.c screen.c username.c \ |
---|
58 | utils.c version.c getopt.c machine.c |
---|
59 | OBJS = top.o commands.o display.o screen.o username.o \ |
---|
60 | utils.o version.o getopt.o machine.o |
---|
61 | |
---|
62 | CDEFS = %cdefs% |
---|
63 | LIBS = %libs% |
---|
64 | TERMCAP = %termcap% |
---|
65 | |
---|
66 | CFLAGS = %cflgs% $(CDEFS) |
---|
67 | LINTFLAGS = -x $(CDEFS) |
---|
68 | |
---|
69 | all: Makefile top.local.h top |
---|
70 | |
---|
71 | Makefile: Makefile.X |
---|
72 | @echo 'You need to run the script "Configure" before running "make".' |
---|
73 | exit 10 |
---|
74 | |
---|
75 | top.local.h: top.local.H |
---|
76 | @echo 'You need to run the script "Configure" before running "make".' |
---|
77 | exit 10 |
---|
78 | |
---|
79 | top: $(OBJS) |
---|
80 | rm -f top |
---|
81 | $(CC) -o top $(OBJS) $(TERMCAP) -lm $(LIBS) |
---|
82 | |
---|
83 | lint: sigdesc.h |
---|
84 | $(LINT) $(LINTFLAGS) $(CFILES) |
---|
85 | |
---|
86 | # include file dependencies |
---|
87 | top.o: boolean.h display.h screen.h top.h top.local.h utils.h machine.h |
---|
88 | commands.o: boolean.h sigdesc.h utils.h |
---|
89 | display.o: boolean.h display.h layout.h screen.h top.h top.local.h utils.h |
---|
90 | machine.o: top.h machine.h utils.h |
---|
91 | screen.o: boolean.h screen.h |
---|
92 | utils.o: top.h |
---|
93 | version.o: top.h patchlevel.h |
---|
94 | username.o: top.local.h utils.h |
---|
95 | |
---|
96 | # automatically built include file |
---|
97 | sigdesc.h: sigconv.awk $(SIGNAL) |
---|
98 | $(AWK) -f sigconv.awk $(SIGNAL) >sigdesc.h |
---|
99 | |
---|
100 | tar: |
---|
101 | rm -f top.tar machine/*.desc machine/*~ |
---|
102 | tar cvf top.tar $(TARFILES) |
---|
103 | |
---|
104 | shar: |
---|
105 | rm -f top.shar* machine/*.desc |
---|
106 | makekit -ntop.shar. -t"Now read README and INSTALL, then run Configure" machine $(TARFILES)/* |
---|
107 | |
---|
108 | clean: |
---|
109 | rm -f *.o top core core.* sigdesc.h |
---|
110 | |
---|
111 | veryclean: clean |
---|
112 | rm -f Make.desc machine/*.desc .defaults top.tar SYNOPSIS Makefile top.local.h top.1 machine.c prime |
---|
113 | |
---|
114 | install: top top.1 install-top install-$(MANSTY) |
---|
115 | |
---|
116 | install-top: |
---|
117 | $(INSTALL) -o $(OWNER) -m $(MODE) -g $(GROUP) top ${DESTDIR}$(BINDIR) |
---|
118 | |
---|
119 | install-man: |
---|
120 | $(INSTALL) top.1 ${DESTDIR}$(MANDIR)/top.$(MANEXT) |
---|
121 | |
---|
122 | install-catman: |
---|
123 | tbl top.1 | nroff -man > ${DESTDIR}$(MANDIR)/top.$(MANEXT) |
---|
124 | |
---|
125 | installmeta: top top.1 |
---|
126 | $(INSTALL) -o $(OWNER) -m 755 -g $(GROUP) metatop $(BINDIR)/top |
---|
127 | @echo $(INSTALL) -o $(OWNER) -m $(MODE) -g $(GROUP) top $(BINDIR)/top-`uname -m`-`uname -r` |
---|
128 | @$(INSTALL) -o $(OWNER) -m $(MODE) -g $(GROUP) \ |
---|
129 | top $(BINDIR)/top-`uname -m`-`uname -r` |
---|
130 | $(INSTALL) top.1 $(MANDIR)/top.$(MANEXT) |
---|