summaryrefslogtreecommitdiff
path: root/sys-utils/Makefile
blob: 4e67514e4d7fdbd53f7d3cdb6d84e7385908510b (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
# Makefile -- Makefile for util-linux Linux utilities
# Created: Sat Dec 26 20:09:40 1992
# Revised: Mon Aug 19 20:12:33 1996 by faith@cs.unc.edu
# Copyright 1992, 1993, 1994, 1995 Rickard E. Faith (faith@cs.unc.edu)
#
include ../make_include
include ../MCONFIG

# Where to put man pages?

MAN1=		arch.1 readprofile.1

MAN8= 		ctrlaltdel.8 cytune.8 dmesg.8 \
		ipcrm.8 ipcs.8 renice.8 \
		setsid.8 sln.8 tunelp.8

# Where to put binaries?
# See the "install" rule for the links. . .

BIN=            arch dmesg

USRBIN=		cytune ipcrm ipcs renice setsid

USRSBIN=	readprofile tunelp

SBIN= 		ctrlaltdel

NOTMADE=

CWFLAGS := $(subst -Wmissing-prototypes,,$(CFLAGS))

ifeq "$(HAVE_SLN)" "no"
ifeq "$(CAN_DO_STATIC)" "no"
NOTMADE=nosln
else
SBIN:=$(SBIN) sln
endif
endif

ifeq "$(ARCH)" "intel"
MAN8:=$(MAN8) rdev.8 ramsize.8 rootflags.8 vidmode.8
USRSBIN:=$(USRSBIN) rdev
endif

# Where to put datebase files?

USRINFO=        ipc.info

all: $(SBIN) $(BIN) $(USRBIN) $(USRSBIN) $(NOTMADE)

# Sometimes indirectly include <asm/bitops.h>
cytune.o: cytune.c
	$(CC) $(CWFLAGS) -c $< -o $@

ipcs.o: ipcs.c
	$(CC) $(CWFLAGS) -c $< -o $@

ipcrm.o: ipcrm.c
	$(CC) $(CWFLAGS) -c $< -o $@

sln: sln.c
	$(CC) -static $(CFLAGS) $(LDFLAGS) $< -o $@

nosln:
	@echo sln not made since static compilation fails here

# Rules for everything else

arch: arch.o
ctrlaltdel.o: ctrlaltdel.c $(LIB)/linux_reboot.h
ctrlaltdel: ctrlaltdel.o $(LIB)/my_reboot.o
cytune: cytune.o
ipcrm: ipcrm.o
ipcs: ipcs.o
rdev: rdev.o
renice: renice.o
readprofile: readprofile.o
setsid: setsid.o

ipc.info: ipc.texi
	makeinfo ipc.texi

install: all
	$(INSTALLDIR) $(SBINDIR) $(BINDIR) $(USRBINDIR) $(USRSBINDIR)
	$(INSTALLBIN) $(SBIN) $(SBINDIR)
	$(INSTALLBIN) $(BIN) $(BINDIR)
	$(INSTALLBIN) $(USRBIN) $(USRBINDIR)
	$(INSTALLBIN) $(USRSBIN) $(USRSBINDIR)
ifeq "$(ARCH)" "intel"
	(cd $(USRSBINDIR); ln -sf rdev ramsize)
	(cd $(USRSBINDIR); ln -sf rdev vidmode)
	(cd $(USRSBINDIR); ln -sf rdev rootflags)
endif
	$(INSTALLDIR) $(MAN1DIR) $(MAN8DIR) $(INFODIR)
	$(INSTALLMAN) $(MAN1) $(MAN1DIR)
	$(INSTALLMAN) $(MAN8) $(MAN8DIR)
	$(INSTALLMAN) $(USRINFO) $(INFODIR)

clean:
	-rm -f *.o *~ core $(SBIN) $(BIN) $(USRBIN) $(USRSBIN)