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