2021-08-21 10:57:13 +00:00
|
|
|
# $Id: Makefile,v 1.144 2021/08/21 10:43:37 nanard Exp $
|
2011-09-27 20:25:35 +00:00
|
|
|
# MiniUPnP Project
|
|
|
|
# http://miniupnp.free.fr/
|
2020-09-23 22:08:55 +00:00
|
|
|
# https://miniupnp.tuxfamily.org/
|
2012-06-23 22:47:50 +00:00
|
|
|
# https://github.com/miniupnp/miniupnp
|
2021-05-22 22:23:18 +00:00
|
|
|
# (c) 2005-2021 Thomas Bernard
|
2011-09-27 20:25:35 +00:00
|
|
|
# to install use :
|
2013-02-09 15:17:23 +00:00
|
|
|
# $ make DESTDIR=/tmp/dummylocation install
|
2011-09-27 20:25:35 +00:00
|
|
|
# or
|
|
|
|
# $ INSTALLPREFIX=/usr/local make install
|
2012-04-06 14:06:30 +00:00
|
|
|
# or
|
2013-02-09 15:17:23 +00:00
|
|
|
# $ make install (default INSTALLPREFIX is /usr)
|
2018-02-02 17:46:34 +00:00
|
|
|
OS = $(shell $(CC) -dumpmachine)
|
2012-01-25 09:57:46 +00:00
|
|
|
VERSION = $(shell cat VERSION)
|
2012-01-23 23:14:43 +00:00
|
|
|
|
2018-02-02 17:46:34 +00:00
|
|
|
ifneq (, $(findstring darwin, $(OS)))
|
2012-01-23 23:14:43 +00:00
|
|
|
JARSUFFIX=mac
|
2015-10-25 21:24:33 +00:00
|
|
|
LIBTOOL ?= $(shell which libtool)
|
2018-02-03 17:29:35 +00:00
|
|
|
endif
|
|
|
|
ifneq (, $(findstring linux, $(OS)))
|
2012-01-25 10:07:02 +00:00
|
|
|
JARSUFFIX=linux
|
2018-02-03 17:29:35 +00:00
|
|
|
endif
|
|
|
|
ifneq (, $(findstring mingw, $(OS))$(findstring cygwin, $(OS))$(findstring msys, $(OS)))
|
2012-12-21 17:13:04 +00:00
|
|
|
JARSUFFIX=win32
|
|
|
|
endif
|
2012-01-23 23:14:43 +00:00
|
|
|
|
2012-10-16 04:59:05 +00:00
|
|
|
HAVE_IPV6 ?= yes
|
|
|
|
export HAVE_IPV6
|
|
|
|
|
2011-09-27 20:25:35 +00:00
|
|
|
CC ?= gcc
|
|
|
|
#AR = gar
|
2021-08-21 10:57:13 +00:00
|
|
|
#CFLAGS = -O -g
|
|
|
|
# to debug :
|
|
|
|
ASANFLAGS = -fsanitize=address -fsanitize=undefined -fsanitize=leak
|
|
|
|
#CFLAGS = -g -ggdb -O0 $(ASANFLAGS) -fno-omit-frame-pointer
|
|
|
|
#CPPFLAGS += -DDEBUG
|
|
|
|
#LDFLAGS += $(ASANFLAGS)
|
2012-05-01 18:49:43 +00:00
|
|
|
CFLAGS ?= -O
|
|
|
|
CFLAGS += -Wall
|
|
|
|
CFLAGS += -W -Wstrict-prototypes
|
|
|
|
CFLAGS += -fno-common
|
2021-05-22 22:13:44 +00:00
|
|
|
CPPFLAGS += -DMINIUPNPC_SET_SOCKET_TIMEOUT
|
|
|
|
CPPFLAGS += -DMINIUPNPC_GET_SRC_ADDR
|
|
|
|
CPPFLAGS += -D_BSD_SOURCE
|
|
|
|
CPPFLAGS += -D_DEFAULT_SOURCE
|
2018-02-02 17:46:34 +00:00
|
|
|
ifneq (, $(findstring netbsd, $(OS)))
|
2021-05-22 22:13:44 +00:00
|
|
|
CPPFLAGS += -D_NETBSD_SOURCE
|
2016-09-03 07:34:15 +00:00
|
|
|
endif
|
2018-02-02 17:46:34 +00:00
|
|
|
ifeq (, $(findstring freebsd, $(OS))$(findstring darwin, $(OS)))
|
2021-05-22 22:13:44 +00:00
|
|
|
#CPPFLAGS += -D_POSIX_C_SOURCE=200112L
|
|
|
|
CPPFLAGS += -D_XOPEN_SOURCE=600
|
2015-09-04 10:16:16 +00:00
|
|
|
endif
|
2015-09-04 08:22:34 +00:00
|
|
|
#CFLAGS += -ansi
|
2021-05-22 22:13:44 +00:00
|
|
|
#CPPFLAGS += -DNO_GETADDRINFO
|
2021-08-21 10:57:13 +00:00
|
|
|
|
2011-09-27 20:25:35 +00:00
|
|
|
INSTALL = install
|
|
|
|
SH = /bin/sh
|
|
|
|
JAVA = java
|
|
|
|
# see http://code.google.com/p/jnaerator/
|
2013-03-11 10:22:08 +00:00
|
|
|
#JNAERATOR = jnaerator-0.9.7.jar
|
|
|
|
#JNAERATOR = jnaerator-0.9.8-shaded.jar
|
|
|
|
#JNAERATORARGS = -library miniupnpc
|
|
|
|
#JNAERATOR = jnaerator-0.10-shaded.jar
|
2015-09-04 16:04:38 +00:00
|
|
|
#JNAERATOR = jnaerator-0.11-shaded.jar
|
|
|
|
# https://repo1.maven.org/maven2/com/nativelibs4java/jnaerator/0.12/jnaerator-0.12-shaded.jar
|
|
|
|
JNAERATOR = jnaerator-0.12-shaded.jar
|
2013-03-11 10:22:08 +00:00
|
|
|
JNAERATORARGS = -mode StandaloneJar -runtime JNAerator -library miniupnpc
|
2015-09-04 16:04:38 +00:00
|
|
|
#JNAERATORBASEURL = http://jnaerator.googlecode.com/files/
|
|
|
|
JNAERATORBASEURL = https://repo1.maven.org/maven2/com/nativelibs4java/jnaerator/0.12
|
2013-05-03 05:33:52 +00:00
|
|
|
|
2020-10-06 22:17:16 +00:00
|
|
|
ifneq (, $(findstring sun, $(OS))$(findstring solaris, $(OS)))
|
2016-12-30 19:07:59 +00:00
|
|
|
LDLIBS=-lsocket -lnsl -lresolv
|
2021-05-22 22:13:44 +00:00
|
|
|
CPPFLAGS += -D__EXTENSIONS__
|
2016-11-11 13:54:07 +00:00
|
|
|
CFLAGS += -std=c99
|
2013-05-03 05:33:52 +00:00
|
|
|
endif
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
# APIVERSION is used to build SONAME
|
2018-04-06 10:48:24 +00:00
|
|
|
APIVERSION = 17
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
SRCS = igd_desc_parse.c miniupnpc.c minixml.c minisoap.c miniwget.c \
|
|
|
|
upnpc.c upnpcommands.c upnpreplyparse.c testminixml.c \
|
2014-11-01 10:40:15 +00:00
|
|
|
minixmlvalid.c testupnpreplyparse.c minissdpc.c \
|
|
|
|
upnperrors.c testigddescparse.c testminiwget.c \
|
2013-02-16 09:25:10 +00:00
|
|
|
connecthostport.c portlistingparse.c receivedata.c \
|
2015-08-03 16:49:14 +00:00
|
|
|
upnpdev.c testportlistingparse.c miniupnpcmodule.c \
|
2020-09-23 22:08:55 +00:00
|
|
|
minihttptestserver.c addr_is_reserved.c testaddr_is_reserved.c \
|
2013-02-16 09:25:10 +00:00
|
|
|
listdevices.c
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
LIBOBJS = miniwget.o minixml.o igd_desc_parse.o minisoap.o \
|
|
|
|
miniupnpc.o upnpreplyparse.o upnpcommands.o upnperrors.o \
|
2020-09-23 22:08:55 +00:00
|
|
|
connecthostport.o portlistingparse.o receivedata.o upnpdev.o \
|
|
|
|
addr_is_reserved.o
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2018-02-02 17:46:34 +00:00
|
|
|
ifeq (, $(findstring amiga, $(OS)))
|
|
|
|
ifeq (, $(findstring mingw, $(OS))$(findstring cygwin, $(OS))$(findstring msys, $(OS)))
|
2011-09-27 20:25:35 +00:00
|
|
|
CFLAGS := -fPIC $(CFLAGS)
|
2016-11-11 11:31:25 +00:00
|
|
|
endif
|
2011-09-27 20:25:35 +00:00
|
|
|
LIBOBJS := $(LIBOBJS) minissdpc.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
OBJS = $(patsubst %.c,%.o,$(SRCS))
|
|
|
|
|
|
|
|
# HEADERS to install
|
2021-05-22 22:23:18 +00:00
|
|
|
CPPFLAGS += -Iinclude/
|
|
|
|
HEADERS = $(wildcard include/*.h)
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
# library names
|
|
|
|
LIBRARY = libminiupnpc.a
|
2018-02-02 17:46:34 +00:00
|
|
|
ifneq (, $(findstring darwin, $(OS)))
|
2011-09-27 20:25:35 +00:00
|
|
|
SHAREDLIBRARY = libminiupnpc.dylib
|
|
|
|
SONAME = $(basename $(SHAREDLIBRARY)).$(APIVERSION).dylib
|
2021-05-22 22:13:44 +00:00
|
|
|
CPPFLAGS += -D_DARWIN_C_SOURCE
|
2018-02-03 17:29:35 +00:00
|
|
|
else
|
|
|
|
ifeq ($(JARSUFFIX), win32)
|
2012-12-21 17:13:04 +00:00
|
|
|
SHAREDLIBRARY = miniupnpc.dll
|
2013-03-23 09:08:43 +00:00
|
|
|
else
|
|
|
|
# Linux/BSD/etc.
|
|
|
|
SHAREDLIBRARY = libminiupnpc.so
|
|
|
|
SONAME = $(SHAREDLIBRARY).$(APIVERSION)
|
2012-12-21 17:13:04 +00:00
|
|
|
endif
|
2018-02-03 17:29:35 +00:00
|
|
|
endif
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2013-02-16 09:25:10 +00:00
|
|
|
EXECUTABLES = upnpc-static listdevices
|
2011-09-27 20:25:35 +00:00
|
|
|
EXECUTABLES_ADDTESTS = testminixml minixmlvalid testupnpreplyparse \
|
2014-11-01 10:40:15 +00:00
|
|
|
testigddescparse testminiwget testportlistingparse
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
TESTMINIXMLOBJS = minixml.o igd_desc_parse.o testminixml.o
|
|
|
|
|
|
|
|
TESTMINIWGETOBJS = miniwget.o testminiwget.o connecthostport.o receivedata.o
|
|
|
|
|
|
|
|
TESTUPNPREPLYPARSE = testupnpreplyparse.o minixml.o upnpreplyparse.o
|
|
|
|
|
2014-11-01 10:18:26 +00:00
|
|
|
TESTPORTLISTINGPARSE = testportlistingparse.o minixml.o portlistingparse.o
|
|
|
|
|
2020-09-23 22:08:55 +00:00
|
|
|
TESTADDR_IS_RESERVED = testaddr_is_reserved.o addr_is_reserved.o
|
|
|
|
|
2011-09-27 20:25:35 +00:00
|
|
|
TESTIGDDESCPARSE = testigddescparse.o igd_desc_parse.o minixml.o \
|
|
|
|
miniupnpc.o miniwget.o upnpcommands.o upnpreplyparse.o \
|
|
|
|
minisoap.o connecthostport.o receivedata.o \
|
2020-09-23 22:08:55 +00:00
|
|
|
portlistingparse.o addr_is_reserved.o
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2018-02-02 17:46:34 +00:00
|
|
|
ifeq (, $(findstring amiga, $(OS)))
|
2011-09-27 20:25:35 +00:00
|
|
|
EXECUTABLES := $(EXECUTABLES) upnpc-shared
|
|
|
|
TESTMINIWGETOBJS := $(TESTMINIWGETOBJS) minissdpc.o
|
|
|
|
TESTIGDDESCPARSE := $(TESTIGDDESCPARSE) minissdpc.o
|
|
|
|
endif
|
|
|
|
|
2012-10-16 04:59:05 +00:00
|
|
|
LIBDIR ?= lib
|
2011-09-27 20:25:35 +00:00
|
|
|
# install directories
|
2016-09-03 07:34:15 +00:00
|
|
|
ifeq ($(strip $(PREFIX)),)
|
|
|
|
INSTALLPREFIX ?= /usr
|
|
|
|
else
|
|
|
|
INSTALLPREFIX ?= $(PREFIX)
|
|
|
|
endif
|
2011-09-27 20:25:35 +00:00
|
|
|
INSTALLDIRINC = $(INSTALLPREFIX)/include/miniupnpc
|
2012-10-16 04:59:05 +00:00
|
|
|
INSTALLDIRLIB = $(INSTALLPREFIX)/$(LIBDIR)
|
2011-09-27 20:25:35 +00:00
|
|
|
INSTALLDIRBIN = $(INSTALLPREFIX)/bin
|
2011-12-31 19:06:17 +00:00
|
|
|
INSTALLDIRMAN = $(INSTALLPREFIX)/share/man
|
2018-02-22 14:31:34 +00:00
|
|
|
PKGCONFIGDIR = $(INSTALLDIRLIB)/pkgconfig
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
FILESTOINSTALL = $(LIBRARY) $(EXECUTABLES)
|
2018-02-02 17:46:34 +00:00
|
|
|
ifeq (, $(findstring amiga, $(OS)))
|
2018-02-22 14:31:34 +00:00
|
|
|
FILESTOINSTALL := $(FILESTOINSTALL) $(SHAREDLIBRARY) miniupnpc.pc
|
2011-09-27 20:25:35 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
2012-04-06 14:08:43 +00:00
|
|
|
.PHONY: install clean depend all check test everything \
|
2012-01-07 10:40:50 +00:00
|
|
|
installpythonmodule updateversion
|
2011-09-27 20:25:35 +00:00
|
|
|
# validateminixml validateminiwget
|
|
|
|
|
|
|
|
all: $(LIBRARY) $(EXECUTABLES)
|
|
|
|
|
2012-04-06 14:08:43 +00:00
|
|
|
test: check
|
|
|
|
|
2014-11-01 10:18:26 +00:00
|
|
|
check: validateminixml validateminiwget validateupnpreplyparse \
|
2020-09-23 22:08:55 +00:00
|
|
|
validateportlistingparse validateigddescparse validateaddr_is_reserved
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
everything: all $(EXECUTABLES_ADDTESTS)
|
|
|
|
|
|
|
|
pythonmodule: $(LIBRARY) miniupnpcmodule.c setup.py
|
2017-07-19 17:44:30 +00:00
|
|
|
MAKE=$(MAKE) python setup.py build
|
2011-09-27 20:25:35 +00:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
installpythonmodule: pythonmodule
|
2017-07-19 17:44:30 +00:00
|
|
|
MAKE=$(MAKE) python setup.py install
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2012-08-29 01:25:00 +00:00
|
|
|
pythonmodule3: $(LIBRARY) miniupnpcmodule.c setup.py
|
2017-07-19 17:44:30 +00:00
|
|
|
MAKE=$(MAKE) python3 setup.py build
|
2012-08-29 01:25:00 +00:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
installpythonmodule3: pythonmodule3
|
2017-07-19 17:44:30 +00:00
|
|
|
MAKE=$(MAKE) python3 setup.py install
|
2012-08-29 01:25:00 +00:00
|
|
|
|
2011-09-27 20:25:35 +00:00
|
|
|
validateminixml: minixmlvalid
|
|
|
|
@echo "minixml validation test"
|
|
|
|
./minixmlvalid
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
validateminiwget: testminiwget minihttptestserver testminiwget.sh
|
|
|
|
@echo "miniwget validation test"
|
|
|
|
./testminiwget.sh
|
|
|
|
touch $@
|
|
|
|
|
2013-05-14 21:08:15 +00:00
|
|
|
validateupnpreplyparse: testupnpreplyparse testupnpreplyparse.sh
|
|
|
|
@echo "upnpreplyparse validation test"
|
|
|
|
./testupnpreplyparse.sh
|
|
|
|
touch $@
|
|
|
|
|
2014-11-01 10:18:26 +00:00
|
|
|
validateportlistingparse: testportlistingparse
|
|
|
|
@echo "portlistingparse validation test"
|
|
|
|
./testportlistingparse
|
|
|
|
touch $@
|
|
|
|
|
2014-11-17 19:31:11 +00:00
|
|
|
validateigddescparse: testigddescparse
|
|
|
|
@echo "igd desc parse validation test"
|
|
|
|
./testigddescparse testdesc/new_LiveBox_desc.xml testdesc/new_LiveBox_desc.values
|
2014-11-26 11:39:43 +00:00
|
|
|
./testigddescparse testdesc/linksys_WAG200G_desc.xml testdesc/linksys_WAG200G_desc.values
|
2014-11-17 19:31:11 +00:00
|
|
|
touch $@
|
|
|
|
|
2020-09-23 22:08:55 +00:00
|
|
|
validateaddr_is_reserved: testaddr_is_reserved
|
|
|
|
@echo "addr_is_reserved() validation test"
|
|
|
|
./testaddr_is_reserved
|
|
|
|
touch $@
|
|
|
|
|
2011-09-27 20:25:35 +00:00
|
|
|
clean:
|
|
|
|
$(RM) $(LIBRARY) $(SHAREDLIBRARY) $(EXECUTABLES) $(OBJS) miniupnpcstrings.h
|
2014-06-10 09:55:03 +00:00
|
|
|
$(RM) $(EXECUTABLES_ADDTESTS)
|
2011-09-27 20:25:35 +00:00
|
|
|
# clean python stuff
|
2014-01-31 14:19:38 +00:00
|
|
|
$(RM) pythonmodule pythonmodule3
|
|
|
|
$(RM) validateminixml validateminiwget validateupnpreplyparse
|
2014-11-17 19:31:11 +00:00
|
|
|
$(RM) validateigddescparse
|
2014-11-01 10:40:15 +00:00
|
|
|
$(RM) minihttptestserver
|
2011-09-27 20:25:35 +00:00
|
|
|
$(RM) -r build/ dist/
|
|
|
|
#python setup.py clean
|
2012-01-07 10:33:21 +00:00
|
|
|
# clean jnaerator stuff
|
|
|
|
$(RM) _jnaerator.* java/miniupnpc_$(OS).jar
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2013-01-09 20:06:28 +00:00
|
|
|
distclean: clean
|
|
|
|
$(RM) $(JNAERATOR) java/*.jar java/*.class out.errors.txt
|
|
|
|
|
2021-05-22 22:23:18 +00:00
|
|
|
updateversion: include/miniupnpc.h
|
|
|
|
cp $< $<.bak
|
|
|
|
sed 's/\(.*MINIUPNPC_API_VERSION\s\+\)[0-9]\+/\1$(APIVERSION)/' < $<.bak > $<
|
2012-01-07 10:35:45 +00:00
|
|
|
|
|
|
|
install: updateversion $(FILESTOINSTALL)
|
2013-02-09 15:17:23 +00:00
|
|
|
$(INSTALL) -d $(DESTDIR)$(INSTALLDIRINC)
|
|
|
|
$(INSTALL) -m 644 $(HEADERS) $(DESTDIR)$(INSTALLDIRINC)
|
|
|
|
$(INSTALL) -d $(DESTDIR)$(INSTALLDIRLIB)
|
|
|
|
$(INSTALL) -m 644 $(LIBRARY) $(DESTDIR)$(INSTALLDIRLIB)
|
2018-02-02 17:46:34 +00:00
|
|
|
ifeq (, $(findstring amiga, $(OS)))
|
2013-02-09 15:17:23 +00:00
|
|
|
$(INSTALL) -m 644 $(SHAREDLIBRARY) $(DESTDIR)$(INSTALLDIRLIB)/$(SONAME)
|
|
|
|
ln -fs $(SONAME) $(DESTDIR)$(INSTALLDIRLIB)/$(SHAREDLIBRARY)
|
2018-02-22 14:31:34 +00:00
|
|
|
$(INSTALL) -d $(DESTDIR)$(PKGCONFIGDIR)
|
|
|
|
$(INSTALL) -m 644 miniupnpc.pc $(DESTDIR)$(PKGCONFIGDIR)
|
2011-09-27 20:25:35 +00:00
|
|
|
endif
|
2013-02-09 15:17:23 +00:00
|
|
|
$(INSTALL) -d $(DESTDIR)$(INSTALLDIRBIN)
|
2018-02-02 17:46:34 +00:00
|
|
|
ifneq (, $(findstring amiga, $(OS)))
|
2013-02-09 15:17:23 +00:00
|
|
|
$(INSTALL) -m 755 upnpc-static $(DESTDIR)$(INSTALLDIRBIN)/upnpc
|
2011-09-27 20:25:35 +00:00
|
|
|
else
|
2013-02-09 15:17:23 +00:00
|
|
|
$(INSTALL) -m 755 upnpc-shared $(DESTDIR)$(INSTALLDIRBIN)/upnpc
|
2011-09-27 20:25:35 +00:00
|
|
|
endif
|
2013-02-09 15:17:23 +00:00
|
|
|
$(INSTALL) -m 755 external-ip.sh $(DESTDIR)$(INSTALLDIRBIN)/external-ip
|
2018-02-02 17:46:34 +00:00
|
|
|
ifeq (, $(findstring amiga, $(OS)))
|
2013-02-09 15:17:23 +00:00
|
|
|
$(INSTALL) -d $(DESTDIR)$(INSTALLDIRMAN)/man3
|
2014-10-25 20:04:10 +00:00
|
|
|
$(INSTALL) -m 644 man3/miniupnpc.3 $(DESTDIR)$(INSTALLDIRMAN)/man3/miniupnpc.3
|
2018-02-02 17:46:34 +00:00
|
|
|
ifneq (, $(findstring linux, $(OS)))
|
2014-10-25 20:04:10 +00:00
|
|
|
gzip -f $(DESTDIR)$(INSTALLDIRMAN)/man3/miniupnpc.3
|
2013-02-09 15:17:23 +00:00
|
|
|
endif
|
2011-12-31 19:06:17 +00:00
|
|
|
endif
|
|
|
|
|
2015-01-07 09:23:59 +00:00
|
|
|
install-static: updateversion $(FILESTOINSTALL)
|
|
|
|
$(INSTALL) -d $(DESTDIR)$(INSTALLDIRINC)
|
|
|
|
$(INSTALL) -m 644 $(HEADERS) $(DESTDIR)$(INSTALLDIRINC)
|
|
|
|
$(INSTALL) -d $(DESTDIR)$(INSTALLDIRLIB)
|
|
|
|
$(INSTALL) -m 644 $(LIBRARY) $(DESTDIR)$(INSTALLDIRLIB)
|
|
|
|
$(INSTALL) -d $(DESTDIR)$(INSTALLDIRBIN)
|
|
|
|
$(INSTALL) -m 755 external-ip.sh $(DESTDIR)$(INSTALLDIRBIN)/external-ip
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
cleaninstall:
|
2013-02-09 15:17:23 +00:00
|
|
|
$(RM) -r $(DESTDIR)$(INSTALLDIRINC)
|
|
|
|
$(RM) $(DESTDIR)$(INSTALLDIRLIB)/$(LIBRARY)
|
|
|
|
$(RM) $(DESTDIR)$(INSTALLDIRLIB)/$(SHAREDLIBRARY)
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2018-02-22 14:31:34 +00:00
|
|
|
miniupnpc.pc: VERSION
|
|
|
|
$(RM) $@
|
|
|
|
echo "prefix=$(INSTALLPREFIX)" >> $@
|
|
|
|
echo "exec_prefix=\$${prefix}" >> $@
|
|
|
|
echo "libdir=\$${exec_prefix}/$(LIBDIR)" >> $@
|
2020-11-22 19:51:57 +00:00
|
|
|
echo "includedir=\$${prefix}/include" >> $@
|
2018-02-22 14:31:34 +00:00
|
|
|
echo "" >> $@
|
|
|
|
echo "Name: miniUPnPc" >> $@
|
|
|
|
echo "Description: UPnP IGD client lightweight library" >> $@
|
|
|
|
echo "Version: $(VERSION)" >> $@
|
|
|
|
echo "Libs: -L\$${libdir} -lminiupnpc" >> $@
|
|
|
|
echo "Cflags: -I\$${includedir}" >> $@
|
|
|
|
|
2011-09-27 20:25:35 +00:00
|
|
|
depend:
|
2021-05-22 22:13:44 +00:00
|
|
|
makedepend -Y -- $(CFLAGS) $(CPPFLAGS) -- $(SRCS) 2>/dev/null
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
$(LIBRARY): $(LIBOBJS)
|
2018-02-02 17:46:34 +00:00
|
|
|
ifneq (, $(findstring darwin, $(OS)))
|
2015-10-25 21:24:33 +00:00
|
|
|
$(LIBTOOL) -static -o $@ $?
|
|
|
|
else
|
2011-09-27 20:25:35 +00:00
|
|
|
$(AR) crs $@ $?
|
2015-10-25 21:24:33 +00:00
|
|
|
endif
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
$(SHAREDLIBRARY): $(LIBOBJS)
|
2018-02-02 17:46:34 +00:00
|
|
|
ifneq (, $(findstring darwin, $(OS)))
|
2012-02-12 13:21:56 +00:00
|
|
|
# $(CC) -dynamiclib $(LDFLAGS) -Wl,-install_name,$(SONAME) -o $@ $^
|
|
|
|
$(CC) -dynamiclib $(LDFLAGS) -Wl,-install_name,$(INSTALLDIRLIB)/$(SONAME) -o $@ $^
|
2011-09-27 20:25:35 +00:00
|
|
|
else
|
|
|
|
$(CC) -shared $(LDFLAGS) -Wl,-soname,$(SONAME) -o $@ $^
|
|
|
|
endif
|
|
|
|
|
2013-05-03 05:33:52 +00:00
|
|
|
upnpc-static: upnpc.o $(LIBRARY)
|
2015-10-25 21:24:33 +00:00
|
|
|
$(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS)
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2013-05-03 05:33:52 +00:00
|
|
|
upnpc-shared: upnpc.o $(SHAREDLIBRARY)
|
2015-10-25 21:24:33 +00:00
|
|
|
$(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS)
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2015-10-25 21:24:33 +00:00
|
|
|
listdevices: listdevices.o $(LIBRARY)
|
2013-02-16 09:25:10 +00:00
|
|
|
|
2011-09-27 20:25:35 +00:00
|
|
|
testminixml: $(TESTMINIXMLOBJS)
|
|
|
|
|
|
|
|
testminiwget: $(TESTMINIWGETOBJS)
|
|
|
|
|
|
|
|
minixmlvalid: minixml.o minixmlvalid.o
|
|
|
|
|
|
|
|
testupnpreplyparse: $(TESTUPNPREPLYPARSE)
|
|
|
|
|
|
|
|
testigddescparse: $(TESTIGDDESCPARSE)
|
|
|
|
|
2014-11-01 10:18:26 +00:00
|
|
|
testportlistingparse: $(TESTPORTLISTINGPARSE)
|
|
|
|
|
2020-09-23 22:08:55 +00:00
|
|
|
testaddr_is_reserved: $(TESTADDR_IS_RESERVED)
|
|
|
|
|
2012-01-19 11:31:42 +00:00
|
|
|
miniupnpcstrings.h: miniupnpcstrings.h.in updateminiupnpcstrings.sh VERSION
|
2011-09-27 20:25:35 +00:00
|
|
|
$(SH) updateminiupnpcstrings.sh
|
|
|
|
|
2013-03-23 09:08:43 +00:00
|
|
|
# ftp tool supplied with OpenBSD can download files from http.
|
2013-03-11 10:22:08 +00:00
|
|
|
jnaerator-%.jar:
|
2013-03-23 09:08:43 +00:00
|
|
|
wget $(JNAERATORBASEURL)/$@ || \
|
|
|
|
curl -o $@ $(JNAERATORBASEURL)/$@ || \
|
|
|
|
ftp $(JNAERATORBASEURL)/$@
|
2012-01-18 17:03:52 +00:00
|
|
|
|
|
|
|
jar: $(SHAREDLIBRARY) $(JNAERATOR)
|
2013-03-11 10:22:08 +00:00
|
|
|
$(JAVA) -jar $(JNAERATOR) $(JNAERATORARGS) \
|
2015-07-29 22:03:58 +00:00
|
|
|
miniupnpc.h miniupnpc_declspec.h upnpcommands.h upnpreplyparse.h \
|
2012-02-12 13:22:32 +00:00
|
|
|
igd_desc_parse.h miniwget.h upnperrors.h $(SHAREDLIBRARY) \
|
2012-01-23 23:14:43 +00:00
|
|
|
-package fr.free.miniupnp -o . -jar java/miniupnpc_$(JARSUFFIX).jar -v
|
|
|
|
|
|
|
|
mvn_install:
|
|
|
|
mvn install:install-file -Dfile=java/miniupnpc_$(JARSUFFIX).jar \
|
2012-02-12 13:22:32 +00:00
|
|
|
-DgroupId=com.github \
|
|
|
|
-DartifactId=miniupnp \
|
|
|
|
-Dversion=$(VERSION) \
|
|
|
|
-Dpackaging=jar \
|
|
|
|
-Dclassifier=$(JARSUFFIX) \
|
|
|
|
-DgeneratePom=true \
|
|
|
|
-DcreateChecksum=true
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2012-01-18 17:32:28 +00:00
|
|
|
# make .deb packages
|
2012-01-18 17:37:00 +00:00
|
|
|
deb: /usr/share/pyshared/stdeb all
|
|
|
|
(python setup.py --command-packages=stdeb.command bdist_deb)
|
2012-01-18 17:32:28 +00:00
|
|
|
|
|
|
|
# install .deb packages
|
|
|
|
ideb:
|
2012-01-18 17:37:00 +00:00
|
|
|
(sudo dpkg -i deb_dist/*.deb)
|
|
|
|
|
|
|
|
/usr/share/pyshared/stdeb: /usr/share/doc/python-all-dev
|
|
|
|
(sudo apt-get install python-stdeb)
|
|
|
|
|
|
|
|
/usr/share/doc/python-all-dev:
|
|
|
|
(sudo apt-get install python-all-dev)
|
2012-01-18 17:32:28 +00:00
|
|
|
|
2011-09-27 20:25:35 +00:00
|
|
|
minihttptestserver: minihttptestserver.o
|
|
|
|
|
|
|
|
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
|
|
|
|
2021-05-22 22:23:18 +00:00
|
|
|
igd_desc_parse.o: include/igd_desc_parse.h
|
|
|
|
miniupnpc.o: include/miniupnpc.h include/miniupnpc_declspec.h
|
|
|
|
miniupnpc.o: include/igd_desc_parse.h include/upnpdev.h minissdpc.h
|
|
|
|
miniupnpc.o: include/miniwget.h miniwget_private.h miniupnpc_socketdef.h
|
|
|
|
miniupnpc.o: minisoap.h minixml.h include/upnpcommands.h
|
|
|
|
miniupnpc.o: include/miniupnpctypes.h connecthostport.h addr_is_reserved.h
|
2011-09-27 20:25:35 +00:00
|
|
|
minixml.o: minixml.h
|
2021-05-22 22:23:18 +00:00
|
|
|
minisoap.o: minisoap.h miniupnpc_socketdef.h miniupnpcstrings.h
|
|
|
|
miniwget.o: miniupnpcstrings.h include/miniwget.h
|
|
|
|
miniwget.o: include/miniupnpc_declspec.h connecthostport.h
|
|
|
|
miniwget.o: miniupnpc_socketdef.h receivedata.h
|
|
|
|
upnpc.o: include/miniwget.h include/miniupnpc_declspec.h include/miniupnpc.h
|
|
|
|
upnpc.o: include/igd_desc_parse.h include/upnpdev.h include/upnpcommands.h
|
|
|
|
upnpc.o: include/miniupnpctypes.h include/portlistingparse.h
|
|
|
|
upnpc.o: include/upnperrors.h miniupnpcstrings.h
|
|
|
|
upnpcommands.o: include/upnpcommands.h include/miniupnpc_declspec.h
|
|
|
|
upnpcommands.o: include/miniupnpctypes.h include/miniupnpc.h
|
|
|
|
upnpcommands.o: include/igd_desc_parse.h include/upnpdev.h
|
|
|
|
upnpcommands.o: include/portlistingparse.h include/upnpreplyparse.h
|
|
|
|
upnpreplyparse.o: include/upnpreplyparse.h minixml.h
|
|
|
|
testminixml.o: minixml.h include/igd_desc_parse.h
|
2011-09-27 20:25:35 +00:00
|
|
|
minixmlvalid.o: minixml.h
|
2021-05-22 22:23:18 +00:00
|
|
|
testupnpreplyparse.o: include/upnpreplyparse.h
|
|
|
|
minissdpc.o: miniupnpc_socketdef.h minissdpc.h include/miniupnpc_declspec.h
|
|
|
|
minissdpc.o: include/upnpdev.h include/miniupnpc.h include/igd_desc_parse.h
|
|
|
|
minissdpc.o: receivedata.h codelength.h
|
|
|
|
upnperrors.o: include/upnperrors.h include/miniupnpc_declspec.h
|
|
|
|
upnperrors.o: include/upnpcommands.h include/miniupnpctypes.h
|
|
|
|
upnperrors.o: include/miniupnpc.h include/igd_desc_parse.h include/upnpdev.h
|
|
|
|
testigddescparse.o: include/igd_desc_parse.h minixml.h include/miniupnpc.h
|
|
|
|
testigddescparse.o: include/miniupnpc_declspec.h include/upnpdev.h
|
|
|
|
testminiwget.o: include/miniwget.h include/miniupnpc_declspec.h
|
|
|
|
connecthostport.o: connecthostport.h miniupnpc_socketdef.h
|
|
|
|
portlistingparse.o: include/portlistingparse.h include/miniupnpc_declspec.h
|
|
|
|
portlistingparse.o: include/miniupnpctypes.h minixml.h
|
|
|
|
receivedata.o: receivedata.h miniupnpc_socketdef.h
|
|
|
|
upnpdev.o: include/upnpdev.h include/miniupnpc_declspec.h
|
|
|
|
testportlistingparse.o: include/portlistingparse.h
|
|
|
|
testportlistingparse.o: include/miniupnpc_declspec.h include/miniupnpctypes.h
|
|
|
|
miniupnpcmodule.o: include/miniupnpc.h include/miniupnpc_declspec.h
|
|
|
|
miniupnpcmodule.o: include/igd_desc_parse.h include/upnpdev.h
|
|
|
|
miniupnpcmodule.o: include/upnpcommands.h include/miniupnpctypes.h
|
|
|
|
miniupnpcmodule.o: include/upnperrors.h
|
|
|
|
testaddr_is_reserved.o: addr_is_reserved.h
|
|
|
|
listdevices.o: include/miniupnpc.h include/miniupnpc_declspec.h
|
|
|
|
listdevices.o: include/igd_desc_parse.h include/upnpdev.h
|