]> git.ipfire.org Git - thirdparty/util-linux.git/blame - misc-utils/Makefile
Imported from util-linux-2.10s tarball.
[thirdparty/util-linux.git] / misc-utils / Makefile
CommitLineData
6dbe3af9
KZ
1# Makefile -- Makefile for util-linux Linux utilities
2# Created: Sat Dec 26 20:09:40 1992
fd6b7a7f 3# Revised: Mon Nov 11 10:12:16 1996 by faith@cs.unc.edu
6dbe3af9 4# Copyright 1992, 1993, 1994, 1995 Rickard E. Faith (faith@cs.unc.edu)
726f69e2 5# May be distirbuted under the GPL
6dbe3af9 6#
7eda085c 7include ../make_include
6dbe3af9
KZ
8include ../MCONFIG
9
10# Where to put man pages?
11
2b6fc908 12MAN1= cal.1 chkdupexe.1 ddate.1 kill.1 \
eb63b9b8
KZ
13 logger.1 look.1 mcookie.1 namei.1 rename.1 script.1 \
14 whereis.1 write.1
726f69e2 15
6dbe3af9
KZ
16# Where to put binaries?
17# See the "install" rule for the links. . .
18
fd6b7a7f 19BIN= kill
6dbe3af9 20
2b6fc908 21USRBIN= cal chkdupexe ddate logger look mcookie \
eb63b9b8 22 namei rename script whereis write
fd6b7a7f 23
66ee8158
KZ
24MAYBE= reset setterm tsort
25
fd6b7a7f
KZ
26ifeq "$(HAVE_RESET)" "no"
27USRBIN:=$(USRBIN) reset
28MAN1:=$(MAN1) reset.1
726f69e2 29endif
6dbe3af9 30
7eda085c
KZ
31ifeq "$(HAVE_NCURSES)" "yes"
32USRBIN:=$(USRBIN) setterm
33MAN1:=$(MAN1) setterm.1
34endif
35
eb63b9b8
KZ
36ifeq "$(HAVE_TSORT)" "no"
37USRBIN:=$(USRBIN) tsort
38MAN1:=$(MAN1) tsort.1
39endif
40
5c36a0eb 41# For script only
7eda085c 42LIBPTY=
5c36a0eb 43ifeq "$(HAVE_OPENPTY)" "yes"
7eda085c 44LIBPTY:=$(LIBPTY) -lutil
5c36a0eb 45endif
fd6b7a7f 46
6dbe3af9
KZ
47# Programs requiring special compilation
48
fd6b7a7f 49NEEDS_CURSES= setterm
7eda085c 50NEEDS_OPENPTY= script
6dbe3af9 51
2b6fc908 52all: $(BIN) $(USRBIN) $(USRBIN.NONSHADOW) $(USRGAMES)
6dbe3af9 53
fd6b7a7f 54$(NEEDS_CURSES):
2b6fc908 55ifeq "$(HAVE_NCURSES)" "yes"
fd6b7a7f 56 $(CC) $(LDFLAGS) $^ -o $@ $(LIBCURSES)
2b6fc908
KZ
57else
58 @echo $@ not made since it requires ncurses
59endif
6dbe3af9 60
7eda085c
KZ
61$(NEEDS_OPENPTY):
62 $(CC) $(LDFLAGS) $^ -o $@ $(LIBPTY)
63
726f69e2 64%: %.sh
6dbe3af9 65 cp $@.sh $@
726f69e2
KZ
66 chmod 755 $@
67
68%: %.pl
69 cp $@.pl $@
70 chmod 755 $@
6dbe3af9
KZ
71
72# Rules for everything else
73
eb63b9b8 74cal.o: $(LIB)/errs.h
5c36a0eb 75cal: cal.o $(ERR_O)
726f69e2 76chkdupexe: chkdupexe.pl
6dbe3af9 77kill: kill.o procs.o
5c36a0eb 78logger: logger.o
726f69e2 79mcookie: mcookie.o md5.o
fd6b7a7f
KZ
80mcookie.o: mcookie.c md5.h
81md5.o: md5.c md5.h
6dbe3af9 82reset: reset.sh
7eda085c 83script: script.o
66ee8158
KZ
84write.o: $(LIB)/carefulputc.h
85write: write.o $(LIB)/carefulputc.o
5c36a0eb 86
2b6fc908
KZ
87ifeq "$(HAVE_NCURSES)" "yes"
88setterm: setterm.o
89endif
90
6dbe3af9
KZ
91install: all
92 $(INSTALLDIR) $(BINDIR) $(USRBINDIR)
93 $(INSTALLBIN) $(BIN) $(BINDIR)
94 $(INSTALLBIN) $(USRBIN) $(USRBINDIR)
6dbe3af9
KZ
95 $(INSTALLDIR) $(MAN1DIR) $(MAN8DIR)
96 $(INSTALLMAN) $(MAN1) $(MAN1DIR)
726f69e2
KZ
97ifeq "$(USE_TTY_GROUP)" "yes"
98 chgrp tty $(USRBINDIR)/write
99 chmod g+s $(USRBINDIR)/write
100endif
6dbe3af9
KZ
101
102.PHONY: clean
103clean:
66ee8158 104 -rm -f *.o *~ core $(BIN) $(USRBIN) $(MAYBE)