|
Home - Old Man Programmer
| Displaying projects/sac/Makefile
# $Copyright: $
# Copyright (c) 1995-2001 by Steve Baker
# All Rights reserved
#
# This software is provided as is without any express or implied
# warranties, including, without limitation, the implied warranties
# of merchant-ability and fitness for a particular purpose.
#
# Thanks to Edward S. Marshall for extending the Makefile.
#
CC=gcc
# For Intel platforms (use -m386 w/ AMD CPU's for better speed):
#CFLAGS=-Wall -O2 -fomit-frame-pointer -m486
# For everything else:
#CFLAGS=-Wall -O2
# For debugging
CFLAGS=-ggdb
# Comment this if doing debugging.
#LDFLAGS=-s
# Define acording to your architechure. Only SOLARIS, BSD and LINUX are valid
# thus far. Most OS's should work with one of them.
# Solaris 2.x only:
#ARCH=SOLARIS
# FreeBSD:
#ARCH=BSD
# Linux libc5 / glibc 2.x:
ARCH=LINUX
# Radius Options:
DETAIL_NAME=detail
RADIUS_DIR=/usr/adm/radacct
# Set to "1" if you wish to use Called-Station-Id or Framed-IP-Address for the
# users hostname. Called-Station-Id takes precidence over Framed-IP-Address
# if both are selected.
USE_CALLED_STATION_ID=0
USE_FRAMED_IP_ADDR=0
RADOPTS=-DRADIUS_DIR=\"${RADIUS_DIR}\" -DDETAIL_NAME=\"${DETAIL_NAME}\" \
-DUSE_FRAMED_IP_ADDR=${USE_FRAMED_IP_ADDR} \
-DUSE_CALLED_STATION_ID=${USE_CALLED_STATION_ID}
# General options:
SAC_DEST=sac
RAW_DEST=rawtmp
WRITETMP_DEST=writetmp
WCAT_DEST=wcat
BINDIR=/usr/local/bin
MANS=sac.8 rawtmp.1 writetmp.8
MANDIR=/usr/man
all: sac rawtmp writetmp wcat
sac: sac.o gronk.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $(SAC_DEST) sac.o gronk.o
sac.o: sac.c sac.h utmp.h proto.h
$(CC) $(CFLAGS) -D$(ARCH)=1 $(RADOPTS) -c sac.c
gronk.o: gronk.c sac.h utmp.h proto.h
$(CC) $(CFLAGS) -D$(ARCH)=1 $(RADOPTS) -c gronk.c
rawtmp: rawtmp.o
$(CC) $(LDFLAGS) -o $(RAW_DEST) rawtmp.o
writetmp: writetmp.o
$(CC) $(LDFLAGS) -o $(WRITETMP_DEST) writetmp.o
wcat: wcat.o
$(CC) $(LDFLAGS) -o $(WCAT_DEST) wcat.o
rawtmp.o: rawtmp.c
$(CC) $(CFLAGS) -D$(ARCH)=1 -c rawtmp.c
writetmp.o: writetmp.c
$(CC) $(CFLAGS) -D$(ARCH)=1 -c writetmp.c
wcat.o: writetmp.c
$(CC) $(CFLAGS) -D$(ARCH)=1 -c wcat.c
clean:
if [ -f $(SAC_DEST) ]; then rm $(SAC_DEST); fi
if [ -f $(RAW_DEST) ]; then rm $(RAW_DEST); fi
if [ -f $(WRITETMP_DEST) ]; then rm $(WRITETMP_DEST); fi
if [ -f $(WCAT_DEST) ]; then rm $(WCAT_DEST); fi
if [ -f sac.o -o -f raw.o -o -f writetmp.o -o -f wcat.o ]; then rm *.o; fi
install: all
install -d $(BINDIR)
if [ -f $(SAC_DEST) ]; then \
install -m 0111 -s $(SAC_DEST) $(BINDIR)/$(SAC_DEST); \
fi
if [ -f $(RAW_DEST) ]; then \
install -m 0111 -s $(RAW_DEST) $(BINDIR)/$(RAW_DEST); \
fi
if [ -f $(WRITETMP_DEST) ]; then \
install -m 0111 -s $(WRITETMP_DEST) $(BINDIR)/$(WRITETMP_DEST); \
fi
if [ -f $(WCAT_DEST) ]; then \
install -m 0111 -s $(WCAT_DEST) $(BINDIR)/$(WCAT_DEST); \
fi
for man in $(MANS); do \
m=`expr match $$man '.*\(.\)'`; \
install -m 0444 $$man $(MANDIR)/man$$m/$$man; \
done
VERSION=1.9
tarball:
cd ..; \
tar cvzf sac-${VERSION}.tgz `cat sac-${VERSION}/.tarball`
|