diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:15:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:15:13 +0000 |
commit | 5fb98df7b32417914e9b282e91987199416d0a97 (patch) | |
tree | d674271dc3d99faa1a75fa689888ee3d3aec4e10 /Makefile | |
parent | Initial commit. (diff) | |
download | ipcalc-ng-5fb98df7b32417914e9b282e91987199416d0a97.tar.xz ipcalc-ng-5fb98df7b32417914e9b282e91987199416d0a97.zip |
Adding upstream version 1.0.3.upstream/1.0.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a1766c3 --- /dev/null +++ b/Makefile @@ -0,0 +1,40 @@ +USE_GEOIP?=no +USE_MAXMIND?=yes +USE_RUNTIME_LINKING?=yes + +LIBPATH?=/usr/lib64 +#LIBPATH=/usr/lib/x86_64-linux-gnu + +LIBS?= +VERSION=$(shell cat meson.build|grep 'version :'|cut -d ':' -f 2|tr -d " \'") +CC?=gcc +CFLAGS?=-O2 -g -Wall +LDFLAGS=$(LIBS) + +ifeq ($(USE_GEOIP),yes) +ifeq ($(USE_RUNTIME_LINKING),yes) +LDFLAGS+=-ldl +CFLAGS+=-DUSE_GEOIP -DUSE_RUNTIME_LINKING -DLIBPATH="\"$(LIBPATH)\"" +else +LDFLAGS+=-lGeoIP +CFLAGS+=-DUSE_GEOIP +endif # DYN GEOIP +else # GEOIP +ifeq ($(USE_MAXMIND),yes) +ifeq ($(USE_RUNTIME_LINKING),yes) +LDFLAGS+=-ldl +CFLAGS+=-DUSE_MAXMIND -DUSE_RUNTIME_LINKING -DLIBPATH="\"$(LIBPATH)\"" +else +LDFLAGS+=-lmaxminddb +CFLAGS+=-DUSE_MAXMIND +endif # DYN MAXMIND +endif # MAXMIND +endif # not GEOIP + +all: ipcalc + +ipcalc: ipcalc.c ipv6.c deaggregate.c ipcalc-geoip.c ipcalc-maxmind.c ipcalc-reverse.c ipcalc-utils.c netsplit.c + $(CC) $(CFLAGS) -DVERSION="\"$(VERSION)\"" $^ -o $@ $(LDFLAGS) + +clean: + rm -f ipcalc |