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
|
#
# ipband - IP bandwidth watchdog
# Change this variables to match your installation
#
# Note: When the version changes, you also have to change
# the RPM spec file
V=0.7.2
MAKE=make
CPPFLAGS=-I/usr/include/pcap
LIBS=-lpcap
CFLAGS := -Wall $(CFLAGS)
CC=gcc
BIN = ipband
SRC_C = main.c error.c init.c packets.c \
pcapfunc.c popen.c reports.c utils.c hash.c
OBJ_C = $(SRC_C:.c=.o)
all: $(BIN)
$(BIN): $(OBJ_C)
$(CC) -o $(BIN) $(OBJ_C) $(LIBS) $(CFLAGS)
# strip $(BIN)
install: all
install -D ipband $(DESTDIR)/usr/sbin/ipband
install -D ipband.1 $(DESTDIR)/usr/share/man/man8/ipband.8
# install -D ipband.sample.conf $(DESTDIR)/etc/ipband.conf
# install -D ipband.rc $(DESTDIR)/etc/init.d/ipband
clean:
rm -f *.o
rm -f ipband
#
# -------------------------------------------------------------------------
#
# If we need rpm
SRC_ROOT = Makefile CHANGELOG COPYING README INSTALL ipband.spec
SRC_SRCS = Makefile *.c *.h ipband.1
SRC_CONF = ipband.sample.conf ipband.rc
tgz:
mkdir ipband-$(V)
cp $(SRC_ROOT) ipband-$(V)/
cp $(SRC_SRCS) ipband-$(V)/
cp $(SRC_CONF) ipband-$(V)/
tar -czvf ipband-$(V).tgz ipband-$(V)/
rm -rf ipband-$(V)
rpm: tgz
mv ipband-$(V).tgz /usr/src/redhat/SOURCES
cp ipband.spec /usr/src/redhat/SPECS
rpm -bb ipband.spec
|