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
|
#!/usr/bin/make -f
# Makefile.
#
# @configure_input@
#
prefix=@prefix@
INSTALLBASE=${prefix}
INSTALLCONF=@sysconfdir@
INSTALL=@INSTALL@
INSTALLSHARE=@datadir@
CC=@CC@
ifndef DESTDIR
DESTDIR=
endif
ifndef DEBUG
DEBUG=@DEBUG@
endif
ifndef CFLAGS
CFLAGS=-O2 -Wall -I/usr/include/postgresql/ -D _REENTRANT
else
CFLAGS += -I/usr/include/postgresql/ -D _REENTRANT
endif
ifeq ($(DEBUG),1)
CFLAGS+= -g -D_DEBUG_
endif
LIBS=-lpcap -lstdc++ -lpthread -lpq++
ifndef DBG
.cc.o:
$(CC) $(CFLAGS) -c -o $@ $<
else
.cc.o:
$(CC) $(DBGFLAGS) -c -o $@ $<
endif
TSOBJS=CTrafStatsList.o CTrafStatsEntry.o sniffer.o storage.o timer.o main.o
TARGETS=trafstats monthstats.8
CONFFILES=config.log config.cache config.status Makefile config.h monthstats.pl monthstats.sgml
all: $(TARGETS)
trafstats: $(TSOBJS)
$(CC) $(CFLAGS) -o trafstats $(LIBS) $(TSOBJS)
install: all
@INSTALL_PROGRAM@ -o root -g root -s -D trafstats $(DESTDIR)/$(INSTALLBASE)/sbin/trafstats
@INSTALL_PROGRAM@ -o root -g root -D monthstats.pl $(DESTDIR)/$(INSTALLBASE)/bin/monthstats
@INSTALL_PROGRAM@ -o root -g root -D trafstats_maintenance ${DESTDIR}/$(INSTALLBASE)/sbin/trafstats_maintenance
mkdir -p $(DESTDIR)/$(INSTALLCONF)
@INSTALL_DATA@ -o root -g root -D watchnets.example ${DESTDIR}/$(INSTALLCONF)/watchnets
@INSTALL_DATA@ -o root -g root -D trafstatsfuncs.sh ${DESTDIR}/$(INSTALLSHARE)/trafstats/dbfuncs.sh
monthstats.8: monthstats.sgml
docbook-to-man $< > $@
distclean: clean
-rm $(CONFFILES)
clean:
-rm $(TSOBJS) $(TARGETS)
|