Merge from vendor branch OPENSSL:
[dragonfly.git] / contrib / top / Makefile.X
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, Group sys Consulting
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 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
52
53 CDEFS = %cdefs%
54 LIBS = %libs%
55 TERMCAP = %termcap%
56 MATH = %math%
57
58 CFLAGS = %cflgs% $(CDEFS)
59 LINTFLAGS = -x $(CDEFS)
60
61 all: Makefile top.local.h top
62
63 Makefile: Makefile.X
64         @echo 'You need to run the script "Configure" before running "make".'
65         exit 10
66
67 top.local.h: top.local.H
68         @echo 'You need to run the script "Configure" before running "make".'
69         exit 10
70
71 top: $(OBJS)
72         rm -f top
73         $(CC) $(CDEFS) -o top $(OBJS) $(TERMCAP) $(MATH) $(LIBS)
74
75 lint: sigdesc.h
76         $(LINT) $(LINTFLAGS) $(CFILES)
77
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
83 utils.o: top.h
84 version.o: top.h patchlevel.h
85 username.o: top.local.h utils.h
86
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
90
91 # automatically built include file
92 sigdesc.h: sigconv.awk $(SIGNAL)
93         $(AWK) -f sigconv.awk $(SIGNAL) >sigdesc.h
94
95 clean:
96         rm -f *.o top core core.* sigdesc.h
97
98 veryclean: clean
99         rm -f Make.desc machine/*.desc .defaults top.tar SYNOPSIS Makefile top.local.h top.1 machine.c prime
100
101 install: top top.1 install-top install-$(MANSTY)
102
103 install-top:
104         $(INSTALL) -o $(OWNER) -m $(MODE) -g $(GROUP) top $(BINDIR)
105
106 install-man:
107         $(INSTALL) top.1 $(MANDIR)/top.$(MANEXT)
108
109 install-catman:
110         tbl top.1 | nroff -man > $(MANDIR)/top.$(MANEXT)
111
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)