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

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	= ipv6loganon.o ipv6loganonhelp.o

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

all:		ipv6loganon

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

$(OBJS):	ipv6loganonoptions.h ipv6loganonhelp.h ipv6loganon.h ../lib/ipv6calccommands.h

libipv6calc.a:
		cd ../ && ${MAKE} lib-make

ipv6loganon:	$(OBJS) libipv6calc.a
		$(CC) -o ipv6loganon $(OBJS) $(GETOBJS) -lipv6calc -L../lib/ $(LDFLAGS)

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

distclean:
		${MAKE} clean

autoclean:
		${MAKE} distclean

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

test:		
		${MAKE} all
		./test_ipv6loganon.sh
		./test_ipv6loganon.sh bulk

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

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