summaryrefslogtreecommitdiffstats
path: root/contrib/top/Makefile.X
blob: a9bfe65b820aa8f9ce206a0363284e15fe582c87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Makefile for "top", a top 10 process display for Unix
#
# This makefile is for top, version 3
#
# Written by William LeFebvre, Group sys Consulting
#		(formerly of Northwestern University and Rice University)

# DO NOT EDIT "Makefile"!!!!  Make changes to "Makefile.X" and rerun
# Configure.

# Executables (these should be obvious):

SHELL   = %shell%
CC      = %cc%
AWK     = %awk%
INSTALL = %install%

# installation information:
#	OWNER	- name (or uid) for the installed executable's owner
#	GROUP	- group name (or gid) for the installed executable's group
#	MODE	- mode for the installed executable (should start with a 0)
#	BINDIR	- directory where the executable should live
#	MANDIR	- directory where the manual page should live
#	MANEXT	- installed man pages end in .$(MANEXT)
#	MANSTY	- "man" or "catman" depending on what's to be installed
#	SIGNAL	- <signal.h> or <sys/signal.h>; the one with signal definitions
#	TROFF	- most appropriate troff command

OWNER  = %owner%
GROUP  = %group%
MODE   = %mode%
BINDIR = %bindir%
MANDIR = %mandir%
MANEXT = %manext%
MANSTY = %mansty%
SIGNAL = %signal%

# Values for the two defaults in "top":
#	TOPN	- default number of processes to display
#	DELAY	- default delay between updates
#
# set TOPN to -1 to indicate infinity (so that top will display as many
# as the screen will hold).

TOPN = %topn%
DELAY = %delay%

CFILES = top.c commands.c display.c screen.c username.c \
	 utils.c version.c getopt.c machine.c
OBJS = top.o commands.o display.o screen.o username.o \
       utils.o version.o getopt.o machine.o

CDEFS = %cdefs%
LIBS = %libs%
TERMCAP = %termcap%
MATH = %math%

CFLAGS = %cflgs% $(CDEFS)
LINTFLAGS = -x $(CDEFS)

all: Makefile top.local.h top

Makefile: Makefile.X
	@echo 'You need to run the script "Configure" before running "make".'
	exit 10

top.local.h: top.local.H
	@echo 'You need to run the script "Configure" before running "make".'
	exit 10

top: $(OBJS)
	rm -f top
	$(CC) $(CDEFS) -o top $(OBJS) $(TERMCAP) $(MATH) $(LIBS)

lint: sigdesc.h
	$(LINT) $(LINTFLAGS) $(CFILES)

# include file dependencies
top.o: boolean.h display.h screen.h top.h top.local.h utils.h machine.h 
commands.o: boolean.h sigdesc.h top.h utils.h
display.o: boolean.h display.h layout.h screen.h top.h top.local.h utils.h
screen.o: boolean.h screen.h
utils.o: top.h
version.o: top.h patchlevel.h
username.o: top.local.h utils.h

# when compiling machine.c, include os revision definition
machine.o: machine.c top.h machine.h utils.h
	$(CC) "%osrev%" $(CFLAGS) -c machine.c

# automatically built include file
sigdesc.h: sigconv.awk $(SIGNAL)
	$(AWK) -f sigconv.awk $(SIGNAL) >sigdesc.h

clean:
	rm -f *.o top core core.* sigdesc.h

veryclean: clean
	rm -f Make.desc machine/*.desc .defaults top.tar SYNOPSIS Makefile top.local.h top.1 machine.c prime

install: top top.1 install-top install-$(MANSTY)

install-top:
	$(INSTALL) -o $(OWNER) -m $(MODE) -g $(GROUP) top $(BINDIR)

install-man:
	$(INSTALL) top.1 $(MANDIR)/top.$(MANEXT)

install-catman:
	tbl top.1 | nroff -man > $(MANDIR)/top.$(MANEXT)

installmeta: top top.1
	$(INSTALL) -o $(OWNER) -m 755 -g $(GROUP) metatop $(BINDIR)/top
	@echo $(INSTALL) -o $(OWNER) -m $(MODE) -g $(GROUP) top $(BINDIR)/top-`uname -m`-`uname -r`
	@$(INSTALL) -o $(OWNER) -m $(MODE) -g $(GROUP) \
		top $(BINDIR)/top-`uname -m`-`uname -r`
	$(INSTALL) top.1 $(MANDIR)/top.$(MANEXT)
OpenPOWER on IntegriCloud