util-linux/text-utils/Makefile

92 lines
2.1 KiB
Makefile
Raw Normal View History

2006-12-06 17:25:32 -06:00
# Makefile -- Makefile for util-linux Linux utilities
# Created: Sat Dec 26 20:09:40 1992
# Revised: Mon Aug 19 20:11:15 1996 by faith@cs.unc.edu
2006-12-06 17:25:32 -06:00
# Copyright 1992, 1993, 1994, 1995 Rickard E. Faith (faith@cs.unc.edu)
#
2006-12-06 17:25:39 -06:00
include ../make_include
2006-12-06 17:25:32 -06:00
include ../MCONFIG
2006-12-06 17:26:12 -06:00
MAN1= col.1 colcrt.1 colrm.1 column.1 hexdump.1 rev.1 line.1 tailf.1
2006-12-06 17:25:32 -06:00
2006-12-06 17:26:12 -06:00
USRBIN= col colcrt colrm column hexdump rev line tailf
2006-12-06 17:25:39 -06:00
BIN=
MAYBE= more pg ul
2006-12-06 17:25:39 -06:00
ifeq "$(HAVE_NCURSES)" "yes"
BIN:=$(BIN) more
USRBIN:=$(USRBIN) ul pg
MAN1:=$(MAN1) ul.1 more.1 pg.1
else
ifeq "$(HAVE_TERMCAP)" "yes"
BIN:=$(BIN) more
MAN1:=$(MAN1) more.1
endif
2006-12-06 17:25:39 -06:00
endif
2006-12-06 17:25:32 -06:00
# Is pg silent?
ifeq "$(SILENT_PG)" "yes"
CFLAGS:=$(CFLAGS) -DPGNOBELL
endif
2006-12-06 17:25:39 -06:00
all: $(BIN) $(USRBIN)
# more and pg and ul use curses - maybe we can't compile them
2006-12-06 17:25:35 -06:00
ifeq "$(HAVE_NCURSES)" "yes"
# Have ncurses - make more and pg and ul
more pg ul:
2006-12-06 17:25:39 -06:00
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBCURSES)
more: more.o $(LIB)/xstrncpy.o
pg: pg.o
ul: ul.o
2006-12-06 17:25:35 -06:00
else
# Do not have ncurses - give up on pg and ul
pg ul:
2006-12-06 17:25:35 -06:00
@echo $@ not made since it requires ncurses
# For more we can also try termcap
ifeq "$(HAVE_TERMCAP)" "yes"
more: more.o $(LIB)/xstrncpy.o
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBTERMCAP)
else
more:
@echo $@ not made since it requires ncurses or termcap
endif
2006-12-06 17:25:35 -06:00
endif
2006-12-06 17:25:39 -06:00
2006-12-06 17:25:32 -06:00
# Rules for hexdump
2006-12-06 17:25:37 -06:00
hexdump: hexdump.o conv.o display.o hexsyntax.o odsyntax.o parse.o
2006-12-06 17:25:32 -06:00
hexdump.o: hexdump.c hexdump.h
conv.o: conv.c hexdump.h
display.o: display.c hexdump.h
hexsyntax.o: hexsyntax.c hexdump.h
odsyntax.o: odsyntax.c hexdump.h
parse.o: parse.c hexdump.h
# Rules for everything else
2006-12-06 17:25:37 -06:00
col: col.o
2006-12-06 17:25:32 -06:00
colcrt: colcrt.o
colrm: colrm.o
column.o: $(LIB)/errs.h
2006-12-06 17:25:37 -06:00
column: column.o $(ERR_O)
more.o: more.c $(LIB)/pathnames.h
2006-12-06 17:25:32 -06:00
rev: rev.o
line: line.o
2006-12-06 17:26:12 -06:00
tailf: tailf.o
2006-12-06 17:25:37 -06:00
colcrt.o colrm.o column.o rev.o ul.o: $(LIB)/widechar.h
2006-12-06 17:25:32 -06:00
install install.shadow install.text-utils: all
$(INSTALLDIR) $(BINDIR) $(USRBINDIR) $(MAN1DIR)
ifneq "$(BIN)" ""
2006-12-06 17:25:33 -06:00
$(INSTALLBIN) $(BIN) $(BINDIR)
endif
2006-12-06 17:25:33 -06:00
$(INSTALLBIN) $(USRBIN) $(USRBINDIR)
$(INSTALLMAN) $(MAN1) $(MAN1DIR)
2006-12-06 17:25:32 -06:00
.PHONY: clean distclean
clean:
-rm -f *.o *~ core $(BIN) $(USRBIN) $(MAYBE)
2006-12-06 17:25:32 -06:00
distclean: clean