source: trunk/third/top/Makefile.X @ 9127

Revision 9127, 3.8 KB checked in by ghudson, 28 years ago (diff)
Support DESTDIR. (I did the install-catman target, in case we want to use it some day, but I didn't bother with the installmeta target.)
Line 
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
13SHELL   = %shell%
14CC      = %cc%
15AWK     = %awk%
16INSTALL = %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
29OWNER  = %owner%
30GROUP  = %group%
31MODE   = %mode%
32BINDIR = %bindir%
33MANDIR = %mandir%
34MANEXT = %manext%
35MANSTY = %mansty%
36SIGNAL = %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
45TOPN = %topn%
46DELAY = %delay%
47
48TARFILES = 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
57CFILES = top.c commands.c display.c screen.c username.c \
58         utils.c version.c getopt.c machine.c
59OBJS = top.o commands.o display.o screen.o username.o \
60       utils.o version.o getopt.o machine.o
61
62CDEFS = %cdefs%
63LIBS = %libs%
64TERMCAP = %termcap%
65
66CFLAGS = %cflgs% $(CDEFS)
67LINTFLAGS = -x $(CDEFS)
68
69all: Makefile top.local.h top
70
71Makefile: Makefile.X
72        @echo 'You need to run the script "Configure" before running "make".'
73        exit 10
74
75top.local.h: top.local.H
76        @echo 'You need to run the script "Configure" before running "make".'
77        exit 10
78
79top: $(OBJS)
80        rm -f top
81        $(CC) -o top $(OBJS) $(TERMCAP) -lm $(LIBS)
82
83lint: sigdesc.h
84        $(LINT) $(LINTFLAGS) $(CFILES)
85
86# include file dependencies
87top.o: boolean.h display.h screen.h top.h top.local.h utils.h machine.h
88commands.o: boolean.h sigdesc.h utils.h
89display.o: boolean.h display.h layout.h screen.h top.h top.local.h utils.h
90machine.o: top.h machine.h utils.h
91screen.o: boolean.h screen.h
92utils.o: top.h
93version.o: top.h patchlevel.h
94username.o: top.local.h utils.h
95
96# automatically built include file
97sigdesc.h: sigconv.awk $(SIGNAL)
98        $(AWK) -f sigconv.awk $(SIGNAL) >sigdesc.h
99
100tar:
101        rm -f top.tar machine/*.desc machine/*~
102        tar cvf top.tar $(TARFILES)
103
104shar:
105        rm -f top.shar* machine/*.desc
106        makekit -ntop.shar. -t"Now read README and INSTALL, then run Configure" machine $(TARFILES)/*
107
108clean:
109        rm -f *.o top core core.* sigdesc.h
110
111veryclean: clean
112        rm -f Make.desc machine/*.desc .defaults top.tar SYNOPSIS Makefile top.local.h top.1 machine.c prime
113
114install: top top.1 install-top install-$(MANSTY)
115
116install-top:
117        $(INSTALL) -o $(OWNER) -m $(MODE) -g $(GROUP) top ${DESTDIR}$(BINDIR)
118
119install-man:
120        $(INSTALL) top.1 ${DESTDIR}$(MANDIR)/top.$(MANEXT)
121
122install-catman:
123        tbl top.1 | nroff -man > ${DESTDIR}$(MANDIR)/top.$(MANEXT)
124
125installmeta: 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)
Note: See TracBrowser for help on using the repository browser.