1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
BINDIR=/usr/local/bin
SBINDIR=/usr/local/sbin
MANDIR=/usr/local/man
CC = gcc
#if you have libident and snprintf and are compiling this on Linux
#CFLAGS = -O2 -Wall
#if you have libident and snprintf and GNU libreadline
#CFLAGS = -O2 -Wall -DREADLINE
#or, if you do not have libinent at all:
CFLAGS = -O2 -Wall -DDONT_HAVE_LIBIDENT
#and if you do not have snprintf
#CFLAGS = -O2 -Wall -DDONT_HAVE_SNPRINTF
#and if you do not have both
#CFLAGS = -O2 -Wall -DDONT_HAVE_SNPRINTF -DDONT_HAVE_LIBIDENT
#add -DBSD_COMPILE to CFLAGS if you are compiling this on FreeBSD, like this:
#CFLAGS = -O2 -Wall -DDONT_HAVE_LIBIDENT -DBSD_COMPILE
#uncomment the following line if you do have libident.so
#LDFLAGS = -lident
#if you have GNU libreadline, you can use it:
#LDFLAGS = -lreadline
#use the following line in case you have only libident.a, not shared
#library (or you want to link staticly against libident)
#LDFLAGS=/usr/lib/libident.a
#LDFLAGS should stay empty if you do not have libident and GNU libreadline at all
LDFLAGS =
all: xtell xtelld
xtelld: xtelld.o daemon.o child.o tty.o common.c
$(CC) $(CFLAGS) xtelld.o daemon.o child.o tty.o common.o $(LDFLAGS) -o xtelld
strip xtelld
xtell: xtell.o utils.o
$(CC) $(CFLAGS) xtell.o utils.o $(LDFLAGS) -o xtell
xtelld.o: xtelld.c
$(CC) $(CFLAGS) -c xtelld.c
common.o: common.c
$(CC) $(CFLAGS) -c common.c
daemon.o: daemon.c
$(CC) $(CFLAGS) -c daemon.c
child.o: child.c
$(CC) $(CFLAGS) -c child.c
tty.o: tty.c
$(CC) $(CFLAGS) -c tty.c
xtell.o: xtell.c
$(CC) $(CFLAGS) -c xtell.c
clean:
rm -f *~ *.o xtell xtelld
install: xtelld xtell
cp xtelld $(SBINDIR)
chgrp tty $(SBINDIR)/xtelld
chmod g+s $(SBINDIR)/xtelld
cp xtell $(BINDIR)
install-doc:
mkdir -p $(MANDIR)/man1 $(MANDIR)/man8
mkdir -p $(MANDIR)/man1 $(MANDIR)/man1
gzip -9 xtell.1 -c >$(MANDIR)/man1/xtell.1.gz
gzip -9 xtelld.8 -c >$(MANDIR)/man8/xtelld.8.gz
|