# Project    : ipv6calc/ipv6logstats
# File       : Makefile
# Version    : $Id: Makefile.in,v 1.13 2010/05/20 14:49:38 peter Exp $
# Copyright  : 2003-2005 by Peter Bieringer <pb (at) bieringer.de>
#
# Information:
#  Makefile for ipv6logstats
#

prefix          = @prefix@
exec_prefix     = @exec_prefix@
bindir		= @bindir@

# Compiler and Linker Options
DEFAULT_CFLAGS ?= -O2 -Wall -g

INCLUDES= $(COPTS) @GETOPT_INCLUDE@ -I../ -I../lib/

GETOBJS = @LIBOBJS@

CC	= @CC@

OBJS	= ipv6logstats.o ipv6logstatshelp.o

# splint
SPLINT_OPT_OUTSIDE = -uniondef +matchanyintegral --nullassign +ignoresigns -compdef -usedef -modobserver -formatconst -warnposix -exportlocal
SPLINT_TODO_LATER = -unrecog

all:		ipv6logstats

.c.o:
		$(CC) $(DEFAULT_CFLAGS) $(CFLAGS) $(INCLUDES) -D__EXTENSIONS__ -c $<

$(OBJS):	ipv6logstatsoptions.h ipv6logstatshelp.h ipv6logstats.h

ipv6logstats:	$(OBJS)
		$(CC) -o ipv6logstats $(OBJS) $(GETOBJS) -lipv6calc -L../lib/ $(LDFLAGS)

static:		ipv6logstats
		$(CC) -o ipv6logstats-static $(OBJS) $(GETOBJS) -lipv6calc -L../lib/ -static $(LDFLAGS)

distclean:
		${MAKE} clean

autoclean:
		${MAKE} distclean

clean:
		rm -f ipv6logstats ipv6logstats-static *.o

test:		
		${MAKE} all
		./test_ipv6logstats.sh

splint:
		splint *.c ../lib/*.c -I.. -I../lib $(SPLINT_OPT_OUTSIDE) $(SPLINT_TODO_LATER)

install:        ipv6logstats
		mkdir -p $(DESTDIR)$(bindir)
		install -m 755 ipv6logstats $(DESTDIR)$(bindir)

