aboutsummaryrefslogtreecommitdiff
path: root/python/Makefile.in
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-04-04 21:59:14 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-07-30 22:09:21 +0200
commitb503900b1456e8bd4b60d1deb0ef7cc3665676f1 (patch)
tree92e7a88c190caf23f810e0a828b6da926f11879a /python/Makefile.in
parent13c5d6801e3b9fdc71bec88c300243a939346a8d (diff)
First step of cleaning up the Makefile.in hell.first-step-to-automake-integration
The goal is to get rid of the Makefile.in's (replace it with Automake Makefile.am's) as they duplicate lot's of text. That decreases readability and is in general a bad design pattern. It seems appropriate to use Automake for an Autoconf based project. Currently achieved: * using libtool to build the core library (+libtool's semantic versioning) * out-of-source builds should work right now * introducing Automake based Makefile in src/ * removed some (maybe) unused GIT ignored files * provide some small python fixes Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'python/Makefile.in')
-rw-r--r--python/Makefile.in33
1 files changed, 20 insertions, 13 deletions
diff --git a/python/Makefile.in b/python/Makefile.in
index a3bcd5da3..1a5929bec 100644
--- a/python/Makefile.in
+++ b/python/Makefile.in
@@ -1,26 +1,33 @@
CC=@CC@
-CFLAGS=-I. -I../src/include -I./src/lib/third_party/include @CFLAGS@ @CUSTOM_NDPI@ -shared
-#LIBNDPI=../src/lib/libndpi.so.@NDPI_VERSION_SHORT@
-LIBNDPI=../src/lib/libndpi.a
-LDFLAGS=$(CFILE) $(LIBNDPI) -lpcap @LIBS@ @ADDITIONAL_LIBS@
-SHARE = -soname,ndpi_wrap
+
+BUILD_SRC=../src
+ROOT_SRC=@srcdir@/../src
+ROOT_PYTHON=@srcdir@
+
+PYTHON_EXEC?=python
+CFLAGS=-I$(ROOT_PYTHON) -I$(ROOT_SRC)/include -I$(BUILD_SRC)/include -I$(ROOT_SRC)/lib/third_party/include \
+ @CFLAGS@ @CUSTOM_NDPI@ -shared
+LIBNDPI=$(BUILD_SRC)/.libs/libndpi.a
+LDFLAGS=$(LIBNDPI) -lpcap @LIBS@
+SHARE=-soname,ndpi_wrap
SO=ndpi_wrap.so
-OBJS = ndpi_wrap.o
-CFILE = ndpi_wrap.c
-PIC = -fPIC
-PREFIX?=/usr/local
+CFILE=$(ROOT_PYTHON)/ndpi_wrap.c
+PIC=-fPIC -DPIC
+PREFIX?=@prefix@
.PHONY: all
UNAME_S := $(shell uname -s)
-ifeq ($(UNAME_S),Darwin)#do something for linux
- SHARE=-install_name,ndpiReader.so
+ifeq ($(UNAME_S),Darwin)
+SHARE=-install_name,ndpiReader.so
endif
all: $(SO)
$(SO): $(CFILE) $(LIBNDPI) Makefile
- $(CC) $(CFLAGS) -Wl,$(SHARE) -o $@ $(PIC) $(LDFLAGS)
-# ln -s $(LIBNDPI) .
+ $(CC) $(CFLAGS) -Wl,$(SHARE) $(CFILE) -o $@ $(PIC) $(LDFLAGS)
+
+example: $(SO)
+ env NDPI_WRAP="$(realpath ./ndpi_wrap.so)" $(PYTHON_EXEC) $(ROOT_PYTHON)/ndpi_example.py
clean:
/bin/rm -f $(SO)