1# Project : ipv6calc/ipv6logstats 2# File : Makefile 3# Version : $Id: 740cbe8ae9d7d725ce32321fdc599f5215bb92b9 $ 4# Copyright : 2003-2020 by Peter Bieringer <pb (at) bieringer.de> 5# 6# Information: 7# Makefile for ipv6logstats 8# 9 10prefix = @prefix@ 11exec_prefix = @exec_prefix@ 12bindir = @bindir@ 13 14# Compiler and Linker Options 15# -D__EXTENSIONS__ is for Solaris & strtok_r 16DEFAULT_CFLAGS ?= -O2 -Wall -g @CFLAGS_EXTRA@ 17CFLAGS += -D__EXTENSIONS__ 18 19LDFLAGS += @LDFLAGS@ 20 21INCLUDES= $(COPTS) @MD5_INCLUDE@ @GETOPT_INCLUDE@ @MMDB_INCLUDE_L1@ @IP2LOCATION_INCLUDE_L1@ -I../ -I../lib/ -I../databases/lib/ 22 23LIBS = @IPV6CALC_LIB@ @MMDB_LIB_L1@ @IP2LOCATION_LIB_L1@ @DYNLOAD_LIB@ 24 25GETOBJS = @LIBOBJS@ 26 27CC = @CC@ 28 29LDFLAGS_EXTRA = @LDFLAGS_EXTRA@ 30 31OBJS = ipv6logstats.o ipv6logstatshelp.o 32 33# splint 34SPLINT_OPT_OUTSIDE = -uniondef +matchanyintegral --nullassign +ignoresigns -compdef -usedef -modobserver -formatconst -warnposix -exportlocal 35SPLINT_TODO_LATER = -unrecog 36 37all: ipv6logstats 38 39.c.o: 40 $(CC) -c $< $(DEFAULT_CFLAGS) $(CFLAGS) $(INCLUDES) 41 42libipv6calc.a: 43 cd ../ && ${MAKE} lib-make 44 45libipv6calc_db_wrapper.a: 46 cd ../ && ${MAKE} lib-make 47 48$(OBJS): ipv6logstatsoptions.h ipv6logstatshelp.h ipv6logstats.h 49 50ipv6logstats: $(OBJS) libipv6calc.a libipv6calc_db_wrapper.a 51 $(CC) -o ipv6logstats $(OBJS) $(GETOBJS) $(LIBS) -lm $(LDFLAGS) $(LDFLAGS_EXTRA) 52 53static: ipv6logstats 54 $(CC) -o ipv6logstats-static $(OBJS) $(GETOBJS) $(LIBS) -lm $(LDFLAGS) $(LDFLAGS_EXTRA) -static 55 56distclean: 57 ${MAKE} clean 58 59autoclean: 60 ${MAKE} distclean 61 62clean: 63 rm -f ipv6logstats ipv6logstats-static *.o 64 65test: ipv6logstats 66 LD_LIBRARY_PATH=@LD_LIBRARY_PATH@ ./test_ipv6logstats.sh 67 68test-minimal: 69 ${MAKE} test 70 71test-ldlibpath: ipv6logstats 72 LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):@LD_LIBRARY_PATH_BASIC@ ./test_ipv6logstats.sh 73 74codecheck: 75 ${MAKE} splint 76 77splint: 78 splint *.c ../lib/*.c -I.. -I../lib $(SPLINT_OPT_OUTSIDE) $(SPLINT_TODO_LATER) 79 80install: 81 mkdir -p $(DESTDIR)$(bindir) 82 install -m 755 ipv6logstats $(DESTDIR)$(bindir) 83 84