#
# Makefile for wtail
# AYM 2002-03-23
#
# Variables that you may want to modify
PREFIX = /usr/local
TMPDIR = ~/tmp
# Variables that you probably don't want to modify
VERSION = `cat VERSION`
OBJ = wtail.o version.o
ARC = wtail-$(VERSION)
MAN = `echo '$(PREFIX)' \
| awk '/^\/+usr\/*$$/ { print $$0 "/share/man"; exit 0 } \
{ print $$0 "/man"; exit 0 }'`
all: wtail
clean:
rm -f $(OBJ) wtail
install:
mkdir -p '$(PREFIX)'/bin
cp wtail '$(PREFIX)'/bin
touch -r wtail '$(PREFIX)'/bin/wtail
mkdir -p "$(MAN)"/man1
sed 's/@{VERSION}/'$(VERSION)'/g' wtail.1 >"$(MAN)"/man1/wtail.1
touch -r wtail.1 "$(MAN)"/man1/wtail.1
test: chatter
./chatter /tmp/wtail.a /tmp/wtail.b /tmp/wtail.c \
| ./wtail /tmp/wtail.a /tmp/wtail.b /tmp/wtail.c /no/such/file
dist:
rm -rf $(TMPDIR)/$(ARC)
mkdir -p $(TMPDIR)/$(ARC)
cp -p \
CHANGES \
COPYING \
FAQ \
Makefile \
README \
VERSION \
chatter.c \
version.c \
wtail.1 \
wtail.c \
$(TMPDIR)/$(ARC)
arc=$(ARC); cd $(TMPDIR) && tar -cf - $$arc | gzip >$$arc.tar.gz
wtail: $(OBJ)
$(CC) $(LDFLAGS) -o $@ $(OBJ) -lcurses
version.c: VERSION
cat VERSION | sed 's/.*/const char version[] = "&";/' >$@
syntax highlighted by Code2HTML, v. 0.9.1