]> git.ipfire.org Git - thirdparty/util-linux.git/blob - text-utils/Makefile
Imported from util-linux-2.10s tarball.
[thirdparty/util-linux.git] / text-utils / Makefile
1 # Makefile -- Makefile for util-linux Linux utilities
2 # Created: Sat Dec 26 20:09:40 1992
3 # Revised: Mon Aug 19 20:11:15 1996 by faith@cs.unc.edu
4 # Copyright 1992, 1993, 1994, 1995 Rickard E. Faith (faith@cs.unc.edu)
5 #
6 include ../make_include
7 include ../MCONFIG
8
9 # Where to put man pages?
10
11 MAN1= col.1 colcrt.1 colrm.1 column.1 hexdump.1 more.1 rev.1
12
13 # Where to put binaries?
14 # See the "install" rule for the links. . .
15
16 BIN= more
17
18 USRBIN= col colcrt colrm column hexdump rev
19
20 MAYBE= ul
21
22 ifeq "$(HAVE_NCURSES)" "yes"
23 USRBIN:=$(USRBIN) ul
24 MAN1:=$(MAN1) ul.1
25 endif
26
27 # Where to put datebase files?
28
29 MOREHELP= more.help
30 MOREHELPFILE=$(MOREHELPDIR)/$(MOREHELP)
31 # MOREHELPDIR set in ../MCONFIG
32 CFLAGS:=$(CFLAGS) -DMOREHELPFILE=\"$(MOREHELPFILE)\"
33
34 all: $(BIN) $(USRBIN)
35
36 # more and ul use curses - maybe we can't compile them
37 ifeq "$(HAVE_NCURSES)" "yes"
38 # Have ncurses - make more and ul
39 more ul:
40 $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBCURSES)
41 more: more.o
42 ul: ul.o
43 else
44 # Do not have ncurses - give up on ul
45 ul:
46 @echo $@ not made since it requires ncurses
47 ifeq "$(HAVE_TERMCAP)" "yes"
48 more: more.o
49 $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBTERMCAP)
50 else
51 more:
52 @echo $@ not made since it requires ncurses or termcap
53 endif
54 endif
55
56 # Rules for hexdump
57 hexdump: hexdump.o conv.o display.o hexsyntax.o odsyntax.o parse.o
58 hexdump.o: hexdump.c hexdump.h
59 conv.o: conv.c hexdump.h
60 display.o: display.c hexdump.h
61 hexsyntax.o: hexsyntax.c hexdump.h
62 odsyntax.o: odsyntax.c hexdump.h
63 parse.o: parse.c hexdump.h
64
65 # Rules for everything else
66 col: col.o
67 colcrt: colcrt.o
68 colrm: colrm.o
69 column.o: $(LIB)/errs.h
70 column: column.o $(ERR_O)
71 more.o: more.c $(LIB)/pathnames.h
72 rev: rev.o
73
74 install install.shadow install.text-utils: all
75 $(INSTALLDIR) $(BINDIR) $(USRBINDIR) $(MOREHELPDIR) $(MAN1DIR)
76 $(INSTALLBIN) $(BIN) $(BINDIR)
77 $(INSTALLBIN) $(USRBIN) $(USRBINDIR)
78 $(INSTALLDAT) $(MOREHELP) $(MOREHELPDIR)
79 $(INSTALLMAN) $(MAN1) $(MAN1DIR)
80
81 .PHONY: clean distclean
82 clean:
83 -rm -f *.o *~ core $(BIN) $(USRBIN) $(MAYBE)
84
85 distclean: clean