mirror of
https://github.com/status-im/miniupnp.git
synced 2025-01-18 10:22:03 +00:00
WIP. Reorganize src build directories
This commit is contained in:
parent
874a3aba9e
commit
92b1c8198d
@ -27,6 +27,11 @@ endif
|
|||||||
HAVE_IPV6 ?= yes
|
HAVE_IPV6 ?= yes
|
||||||
export HAVE_IPV6
|
export HAVE_IPV6
|
||||||
|
|
||||||
|
# directories
|
||||||
|
INCDIR = include
|
||||||
|
SRCDIR = src
|
||||||
|
BUILD = build
|
||||||
|
|
||||||
CC ?= gcc
|
CC ?= gcc
|
||||||
#AR = gar
|
#AR = gar
|
||||||
#CFLAGS = -O -g
|
#CFLAGS = -O -g
|
||||||
@ -39,6 +44,7 @@ CFLAGS ?= -O
|
|||||||
CFLAGS += -Wall
|
CFLAGS += -Wall
|
||||||
CFLAGS += -W -Wstrict-prototypes
|
CFLAGS += -W -Wstrict-prototypes
|
||||||
CFLAGS += -fno-common
|
CFLAGS += -fno-common
|
||||||
|
CPPFLAGS += -I$(BUILD)
|
||||||
CPPFLAGS += -DMINIUPNPC_SET_SOCKET_TIMEOUT
|
CPPFLAGS += -DMINIUPNPC_SET_SOCKET_TIMEOUT
|
||||||
CPPFLAGS += -DMINIUPNPC_GET_SRC_ADDR
|
CPPFLAGS += -DMINIUPNPC_GET_SRC_ADDR
|
||||||
CPPFLAGS += -D_BSD_SOURCE
|
CPPFLAGS += -D_BSD_SOURCE
|
||||||
@ -53,6 +59,9 @@ endif
|
|||||||
#CFLAGS += -ansi
|
#CFLAGS += -ansi
|
||||||
#CPPFLAGS += -DNO_GETADDRINFO
|
#CPPFLAGS += -DNO_GETADDRINFO
|
||||||
|
|
||||||
|
DEPFLAGS = -MM -MG
|
||||||
|
|
||||||
|
MKDIR = mkdir -p
|
||||||
INSTALL = install
|
INSTALL = install
|
||||||
SH = /bin/sh
|
SH = /bin/sh
|
||||||
JAVA = java
|
JAVA = java
|
||||||
@ -77,72 +86,65 @@ endif
|
|||||||
# APIVERSION is used to build SONAME
|
# APIVERSION is used to build SONAME
|
||||||
APIVERSION = 17
|
APIVERSION = 17
|
||||||
|
|
||||||
SRCS = igd_desc_parse.c miniupnpc.c minixml.c minisoap.c miniwget.c \
|
SRCS = $(wildcard $(SRCDIR)/*.c)
|
||||||
upnpc.c upnpcommands.c upnpreplyparse.c testminixml.c \
|
|
||||||
minixmlvalid.c testupnpreplyparse.c minissdpc.c \
|
|
||||||
upnperrors.c testigddescparse.c testminiwget.c \
|
|
||||||
connecthostport.c portlistingparse.c receivedata.c \
|
|
||||||
upnpdev.c testportlistingparse.c miniupnpcmodule.c \
|
|
||||||
minihttptestserver.c addr_is_reserved.c testaddr_is_reserved.c \
|
|
||||||
listdevices.c
|
|
||||||
|
|
||||||
LIBOBJS = miniwget.o minixml.o igd_desc_parse.o minisoap.o \
|
LIBOBJS = $(addprefix $(BUILD)/,miniwget.o minixml.o igd_desc_parse.o minisoap.o \
|
||||||
miniupnpc.o upnpreplyparse.o upnpcommands.o upnperrors.o \
|
miniupnpc.o upnpreplyparse.o upnpcommands.o upnperrors.o \
|
||||||
connecthostport.o portlistingparse.o receivedata.o upnpdev.o \
|
connecthostport.o portlistingparse.o receivedata.o upnpdev.o \
|
||||||
addr_is_reserved.o
|
addr_is_reserved.o)
|
||||||
|
|
||||||
ifeq (, $(findstring amiga, $(OS)))
|
BUILDINCLUDES = $(addprefix $(BUILD)/, miniupnpcstrings.h)
|
||||||
ifeq (, $(findstring mingw, $(OS))$(findstring cygwin, $(OS))$(findstring msys, $(OS)))
|
|
||||||
CFLAGS := -fPIC $(CFLAGS)
|
|
||||||
endif
|
|
||||||
LIBOBJS := $(LIBOBJS) minissdpc.o
|
|
||||||
endif
|
|
||||||
|
|
||||||
OBJS = $(patsubst %.c,%.o,$(SRCS))
|
OBJS = $(patsubst $(SRCDIR)/%.c,$(BUILD)/%.o,$(SRCS))
|
||||||
|
DEPS = $(patsubst $(SRCDIR)/%.c,$(BUILD)/%.d,$(SRCS))
|
||||||
|
|
||||||
# HEADERS to install
|
# HEADERS to install
|
||||||
CPPFLAGS += -Iinclude/
|
CPPFLAGS += -I$(INCDIR)
|
||||||
HEADERS = $(wildcard include/*.h)
|
HEADERS = $(wildcard $(INCDIR)/*.h)
|
||||||
|
|
||||||
# library names
|
# library names
|
||||||
LIBRARY = libminiupnpc.a
|
LIBRARY = $(BUILD)/libminiupnpc.a
|
||||||
ifneq (, $(findstring darwin, $(OS)))
|
ifneq (, $(findstring darwin, $(OS)))
|
||||||
SHAREDLIBRARY = libminiupnpc.dylib
|
SHAREDLIBRARY = $(BUILD)/libminiupnpc.dylib
|
||||||
SONAME = $(basename $(SHAREDLIBRARY)).$(APIVERSION).dylib
|
SONAME = $(notdir $(basename $(SHAREDLIBRARY))).$(APIVERSION).dylib
|
||||||
CPPFLAGS += -D_DARWIN_C_SOURCE
|
CPPFLAGS += -D_DARWIN_C_SOURCE
|
||||||
else
|
else
|
||||||
ifeq ($(JARSUFFIX), win32)
|
ifeq ($(JARSUFFIX), win32)
|
||||||
SHAREDLIBRARY = miniupnpc.dll
|
SHAREDLIBRARY = $(BUILD)/miniupnpc.dll
|
||||||
else
|
else
|
||||||
# Linux/BSD/etc.
|
# Linux/BSD/etc.
|
||||||
SHAREDLIBRARY = libminiupnpc.so
|
SHAREDLIBRARY = $(BUILD)/libminiupnpc.so
|
||||||
SONAME = $(SHAREDLIBRARY).$(APIVERSION)
|
SONAME = $(notdir $(SHAREDLIBRARY)).$(APIVERSION)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
EXECUTABLES = upnpc-static listdevices
|
EXECUTABLES = $(addprefix $(BUILD)/, upnpc-static listdevices)
|
||||||
EXECUTABLES_ADDTESTS = testminixml minixmlvalid testupnpreplyparse \
|
EXECUTABLES_ADDTESTS = $(addprefix $(BUILD)/, testminixml minixmlvalid \
|
||||||
testigddescparse testminiwget testportlistingparse
|
testupnpreplyparse testigddescparse testminiwget testportlistingparse)
|
||||||
|
|
||||||
TESTMINIXMLOBJS = minixml.o igd_desc_parse.o testminixml.o
|
TESTMINIXMLOBJS = $(addprefix $(BUILD)/, minixml.o igd_desc_parse.o testminixml.o)
|
||||||
|
|
||||||
TESTMINIWGETOBJS = miniwget.o testminiwget.o connecthostport.o receivedata.o
|
TESTMINIWGETOBJS = $(addprefix $(BUILD)/, miniwget.o testminiwget.o connecthostport.o receivedata.o)
|
||||||
|
|
||||||
TESTUPNPREPLYPARSE = testupnpreplyparse.o minixml.o upnpreplyparse.o
|
TESTUPNPREPLYPARSE = $(addprefix $(BUILD)/, testupnpreplyparse.o minixml.o upnpreplyparse.o)
|
||||||
|
|
||||||
TESTPORTLISTINGPARSE = testportlistingparse.o minixml.o portlistingparse.o
|
TESTPORTLISTINGPARSE = $(addprefix $(BUILD)/, testportlistingparse.o minixml.o portlistingparse.o)
|
||||||
|
|
||||||
TESTADDR_IS_RESERVED = testaddr_is_reserved.o addr_is_reserved.o
|
TESTADDR_IS_RESERVED = $(addprefix $(BUILD)/, testaddr_is_reserved.o addr_is_reserved.o)
|
||||||
|
|
||||||
TESTIGDDESCPARSE = testigddescparse.o igd_desc_parse.o minixml.o \
|
TESTIGDDESCPARSE = $(addprefix $(BUILD)/, testigddescparse.o igd_desc_parse.o minixml.o \
|
||||||
miniupnpc.o miniwget.o upnpcommands.o upnpreplyparse.o \
|
miniupnpc.o miniwget.o upnpcommands.o upnpreplyparse.o \
|
||||||
minisoap.o connecthostport.o receivedata.o \
|
minisoap.o connecthostport.o receivedata.o \
|
||||||
portlistingparse.o addr_is_reserved.o
|
portlistingparse.o addr_is_reserved.o)
|
||||||
|
|
||||||
ifeq (, $(findstring amiga, $(OS)))
|
ifeq (, $(findstring amiga, $(OS)))
|
||||||
EXECUTABLES := $(EXECUTABLES) upnpc-shared
|
ifeq (, $(findstring mingw, $(OS))$(findstring cygwin, $(OS))$(findstring msys, $(OS)))
|
||||||
TESTMINIWGETOBJS := $(TESTMINIWGETOBJS) minissdpc.o
|
CFLAGS += -fPIC
|
||||||
TESTIGDDESCPARSE := $(TESTIGDDESCPARSE) minissdpc.o
|
endif
|
||||||
|
EXECUTABLES += $(BUILD)/upnpc-shared
|
||||||
|
TESTMINIWGETOBJS += $(BUILD)/minissdpc.o
|
||||||
|
TESTIGDDESCPARSE += $(BUILD)/minissdpc.o
|
||||||
|
LIBOBJS += $(BUILD)/minissdpc.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LIBDIR ?= lib
|
LIBDIR ?= lib
|
||||||
@ -160,13 +162,12 @@ PKGCONFIGDIR = $(INSTALLDIRLIB)/pkgconfig
|
|||||||
|
|
||||||
FILESTOINSTALL = $(LIBRARY) $(EXECUTABLES)
|
FILESTOINSTALL = $(LIBRARY) $(EXECUTABLES)
|
||||||
ifeq (, $(findstring amiga, $(OS)))
|
ifeq (, $(findstring amiga, $(OS)))
|
||||||
FILESTOINSTALL := $(FILESTOINSTALL) $(SHAREDLIBRARY) miniupnpc.pc
|
FILESTOINSTALL += $(SHAREDLIBRARY) miniupnpc.pc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
.PHONY: install clean depend all check test everything \
|
.PHONY: install clean depend all check test everything \
|
||||||
installpythonmodule updateversion
|
installpythonmodule updateversion
|
||||||
# validateminixml validateminiwget
|
|
||||||
|
|
||||||
all: $(LIBRARY) $(EXECUTABLES)
|
all: $(LIBRARY) $(EXECUTABLES)
|
||||||
|
|
||||||
@ -177,53 +178,53 @@ check: validateminixml validateminiwget validateupnpreplyparse \
|
|||||||
|
|
||||||
everything: all $(EXECUTABLES_ADDTESTS)
|
everything: all $(EXECUTABLES_ADDTESTS)
|
||||||
|
|
||||||
pythonmodule: $(LIBRARY) miniupnpcmodule.c setup.py
|
pythonmodule: $(LIBRARY) $(SRCDIR)/miniupnpcmodule.c setup.py
|
||||||
MAKE=$(MAKE) python setup.py build
|
MAKE=$(MAKE) python setup.py build
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
installpythonmodule: pythonmodule
|
installpythonmodule: pythonmodule
|
||||||
MAKE=$(MAKE) python setup.py install
|
MAKE=$(MAKE) python setup.py install
|
||||||
|
|
||||||
pythonmodule3: $(LIBRARY) miniupnpcmodule.c setup.py
|
pythonmodule3: $(LIBRARY) $(SRCDIR)/miniupnpcmodule.c setup.py
|
||||||
MAKE=$(MAKE) python3 setup.py build
|
MAKE=$(MAKE) python3 setup.py build
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
installpythonmodule3: pythonmodule3
|
installpythonmodule3: pythonmodule3
|
||||||
MAKE=$(MAKE) python3 setup.py install
|
MAKE=$(MAKE) python3 setup.py install
|
||||||
|
|
||||||
validateminixml: minixmlvalid
|
validateminixml: $(BUILD)/minixmlvalid
|
||||||
@echo "minixml validation test"
|
@echo "minixml validation test"
|
||||||
./minixmlvalid
|
./$<
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
validateminiwget: testminiwget minihttptestserver testminiwget.sh
|
validateminiwget: testminiwget.sh $(BUILD)/testminiwget $(BUILD)/minihttptestserver
|
||||||
@echo "miniwget validation test"
|
@echo "miniwget validation test"
|
||||||
./testminiwget.sh
|
./$<
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
validateupnpreplyparse: testupnpreplyparse testupnpreplyparse.sh
|
validateupnpreplyparse: testupnpreplyparse.sh $(BUILD)/testupnpreplyparse
|
||||||
@echo "upnpreplyparse validation test"
|
@echo "upnpreplyparse validation test"
|
||||||
./testupnpreplyparse.sh
|
./$<
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
validateportlistingparse: testportlistingparse
|
validateportlistingparse: $(BUILD)/testportlistingparse
|
||||||
@echo "portlistingparse validation test"
|
@echo "portlistingparse validation test"
|
||||||
./testportlistingparse
|
./$<
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
validateigddescparse: testigddescparse
|
validateigddescparse: $(BUILD)/testigddescparse
|
||||||
@echo "igd desc parse validation test"
|
@echo "igd desc parse validation test"
|
||||||
./testigddescparse testdesc/new_LiveBox_desc.xml testdesc/new_LiveBox_desc.values
|
./$< testdesc/new_LiveBox_desc.xml testdesc/new_LiveBox_desc.values
|
||||||
./testigddescparse testdesc/linksys_WAG200G_desc.xml testdesc/linksys_WAG200G_desc.values
|
./$< testdesc/linksys_WAG200G_desc.xml testdesc/linksys_WAG200G_desc.values
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
validateaddr_is_reserved: testaddr_is_reserved
|
validateaddr_is_reserved: $(BUILD)/testaddr_is_reserved
|
||||||
@echo "addr_is_reserved() validation test"
|
@echo "addr_is_reserved() validation test"
|
||||||
./testaddr_is_reserved
|
./$<
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(LIBRARY) $(SHAREDLIBRARY) $(EXECUTABLES) $(OBJS) miniupnpcstrings.h
|
$(RM) $(LIBRARY) $(SHAREDLIBRARY) $(EXECUTABLES) $(OBJS) $(BUILDINCLUDES)
|
||||||
$(RM) $(EXECUTABLES_ADDTESTS)
|
$(RM) $(EXECUTABLES_ADDTESTS)
|
||||||
# clean python stuff
|
# clean python stuff
|
||||||
$(RM) pythonmodule pythonmodule3
|
$(RM) pythonmodule pythonmodule3
|
||||||
@ -281,7 +282,8 @@ cleaninstall:
|
|||||||
$(RM) $(DESTDIR)$(INSTALLDIRLIB)/$(LIBRARY)
|
$(RM) $(DESTDIR)$(INSTALLDIRLIB)/$(LIBRARY)
|
||||||
$(RM) $(DESTDIR)$(INSTALLDIRLIB)/$(SHAREDLIBRARY)
|
$(RM) $(DESTDIR)$(INSTALLDIRLIB)/$(SHAREDLIBRARY)
|
||||||
|
|
||||||
miniupnpc.pc: VERSION
|
$(BUILD)/miniupnpc.pc: VERSION
|
||||||
|
@$(MKDIR) $(BUILD)
|
||||||
$(RM) $@
|
$(RM) $@
|
||||||
echo "prefix=$(INSTALLPREFIX)" >> $@
|
echo "prefix=$(INSTALLPREFIX)" >> $@
|
||||||
echo "exec_prefix=\$${prefix}" >> $@
|
echo "exec_prefix=\$${prefix}" >> $@
|
||||||
@ -294,8 +296,7 @@ miniupnpc.pc: VERSION
|
|||||||
echo "Libs: -L\$${libdir} -lminiupnpc" >> $@
|
echo "Libs: -L\$${libdir} -lminiupnpc" >> $@
|
||||||
echo "Cflags: -I\$${includedir}" >> $@
|
echo "Cflags: -I\$${includedir}" >> $@
|
||||||
|
|
||||||
depend:
|
depend: $(DEPS)
|
||||||
makedepend -Y -- $(CFLAGS) $(CPPFLAGS) -- $(SRCS) 2>/dev/null
|
|
||||||
|
|
||||||
$(LIBRARY): $(LIBOBJS)
|
$(LIBRARY): $(LIBOBJS)
|
||||||
ifneq (, $(findstring darwin, $(OS)))
|
ifneq (, $(findstring darwin, $(OS)))
|
||||||
@ -312,30 +313,39 @@ else
|
|||||||
$(CC) -shared $(LDFLAGS) -Wl,-soname,$(SONAME) -o $@ $^
|
$(CC) -shared $(LDFLAGS) -Wl,-soname,$(SONAME) -o $@ $^
|
||||||
endif
|
endif
|
||||||
|
|
||||||
upnpc-static: upnpc.o $(LIBRARY)
|
$(BUILD)/%.o: $(SRCDIR)/%.c $(BUILD)/%.d
|
||||||
|
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
$(DEPS): $(BUILDINCLUDES)
|
||||||
|
|
||||||
|
$(BUILD)/%.d: $(SRCDIR)/%.c
|
||||||
|
@$(MKDIR) $(@D)
|
||||||
|
$(CC) $(CPPFLAGS) $(DEPFLAGS) -MT $@ -o $@ $<
|
||||||
|
|
||||||
|
$(BUILD)/upnpc-static: $(BUILD)/upnpc.o $(LIBRARY)
|
||||||
$(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS)
|
$(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS)
|
||||||
|
|
||||||
upnpc-shared: upnpc.o $(SHAREDLIBRARY)
|
$(BUILD)/upnpc-shared: $(BUILD)/upnpc.o $(SHAREDLIBRARY)
|
||||||
$(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS)
|
$(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS)
|
||||||
|
|
||||||
listdevices: listdevices.o $(LIBRARY)
|
$(BUILD)/listdevices: $(BUILD)/listdevices.o $(LIBRARY)
|
||||||
|
|
||||||
testminixml: $(TESTMINIXMLOBJS)
|
$(BUILD)/testminixml: $(TESTMINIXMLOBJS)
|
||||||
|
|
||||||
testminiwget: $(TESTMINIWGETOBJS)
|
$(BUILD)/testminiwget: $(TESTMINIWGETOBJS)
|
||||||
|
|
||||||
minixmlvalid: minixml.o minixmlvalid.o
|
$(BUILD)/minixmlvalid: $(addprefix $(BUILD)/, minixml.o minixmlvalid.o)
|
||||||
|
|
||||||
testupnpreplyparse: $(TESTUPNPREPLYPARSE)
|
$(BUILD)/testupnpreplyparse: $(TESTUPNPREPLYPARSE)
|
||||||
|
|
||||||
testigddescparse: $(TESTIGDDESCPARSE)
|
$(BUILD)/testigddescparse: $(TESTIGDDESCPARSE)
|
||||||
|
|
||||||
testportlistingparse: $(TESTPORTLISTINGPARSE)
|
$(BUILD)/testportlistingparse: $(TESTPORTLISTINGPARSE)
|
||||||
|
|
||||||
testaddr_is_reserved: $(TESTADDR_IS_RESERVED)
|
$(BUILD)/testaddr_is_reserved: $(TESTADDR_IS_RESERVED)
|
||||||
|
|
||||||
miniupnpcstrings.h: miniupnpcstrings.h.in updateminiupnpcstrings.sh VERSION
|
$(BUILD)/miniupnpcstrings.h: miniupnpcstrings.h.in updateminiupnpcstrings.sh VERSION
|
||||||
$(SH) updateminiupnpcstrings.sh
|
$(SH) updateminiupnpcstrings.sh $@ $<
|
||||||
|
|
||||||
# ftp tool supplied with OpenBSD can download files from http.
|
# ftp tool supplied with OpenBSD can download files from http.
|
||||||
jnaerator-%.jar:
|
jnaerator-%.jar:
|
||||||
@ -375,51 +385,9 @@ ideb:
|
|||||||
|
|
||||||
minihttptestserver: minihttptestserver.o
|
minihttptestserver: minihttptestserver.o
|
||||||
|
|
||||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
print-%:
|
||||||
|
@echo "$* = $($*)"
|
||||||
|
|
||||||
igd_desc_parse.o: include/igd_desc_parse.h
|
ifneq ($(MAKECMDGOALS),clean)
|
||||||
miniupnpc.o: include/miniupnpc.h include/miniupnpc_declspec.h
|
-include $(DEPS)
|
||||||
miniupnpc.o: include/igd_desc_parse.h include/upnpdev.h minissdpc.h
|
endif
|
||||||
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
|
|
||||||
minixml.o: minixml.h
|
|
||||||
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
|
|
||||||
minixmlvalid.o: minixml.h
|
|
||||||
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
|
|
||||||
|
@ -13,7 +13,7 @@ from setuptools.command import build_ext
|
|||||||
import subprocess
|
import subprocess
|
||||||
import os
|
import os
|
||||||
|
|
||||||
EXT = ['libminiupnpc.a']
|
EXT = ['build/libminiupnpc.a']
|
||||||
|
|
||||||
class make_then_build_ext(build_ext.build_ext):
|
class make_then_build_ext(build_ext.build_ext):
|
||||||
def run(self):
|
def run(self):
|
||||||
@ -29,7 +29,7 @@ setup(name="miniupnpc",
|
|||||||
description='miniUPnP client',
|
description='miniUPnP client',
|
||||||
cmdclass={'build_ext': make_then_build_ext},
|
cmdclass={'build_ext': make_then_build_ext},
|
||||||
ext_modules=[
|
ext_modules=[
|
||||||
Extension(name="miniupnpc", sources=["miniupnpcmodule.c"],
|
Extension(name="miniupnpc", sources=["src/miniupnpcmodule.c"],
|
||||||
include_dirs=['include'], extra_objects=EXT)
|
include_dirs=['include'], extra_objects=EXT)
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
# it should now also run with dash
|
# it should now also run with dash
|
||||||
|
|
||||||
TMPD=`mktemp -d -t miniwgetXXXXXXXXXX`
|
TMPD=`mktemp -d -t miniwgetXXXXXXXXXX`
|
||||||
|
TESTSERVER=./build/minihttptestserver
|
||||||
|
TESTMINIWGET=./build/testminiwget
|
||||||
HTTPSERVEROUT="${TMPD}/httpserverout"
|
HTTPSERVEROUT="${TMPD}/httpserverout"
|
||||||
EXPECTEDFILE="${TMPD}/expectedfile"
|
EXPECTEDFILE="${TMPD}/expectedfile"
|
||||||
DOWNLOADEDFILE="${TMPD}/downloadedfile"
|
DOWNLOADEDFILE="${TMPD}/downloadedfile"
|
||||||
@ -50,11 +52,15 @@ case "$HAVE_IPV6" in
|
|||||||
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
#make minihttptestserver
|
if [ ! -x "$TESTSERVER" ] || [ ! -x "$TESTMINIWGET" ] ; then
|
||||||
#make testminiwget
|
echo "Please build $TESTSERVER and $TESTMINIWGET"
|
||||||
|
#make minihttptestserver
|
||||||
|
#make testminiwget
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# launching the test HTTP server
|
# launching the test HTTP server
|
||||||
./minihttptestserver $SERVERARGS -e $EXPECTEDFILE > $HTTPSERVEROUT &
|
$TESTSERVER $SERVERARGS -e $EXPECTEDFILE > $HTTPSERVEROUT &
|
||||||
SERVERPID=$!
|
SERVERPID=$!
|
||||||
while [ -z "$PORT" ]; do
|
while [ -z "$PORT" ]; do
|
||||||
sleep 1
|
sleep 1
|
||||||
@ -74,7 +80,7 @@ URL3="http://$ADDR:$PORT/addcrap"
|
|||||||
URL4="http://$ADDR:$PORT/malformed"
|
URL4="http://$ADDR:$PORT/malformed"
|
||||||
|
|
||||||
echo "standard test ..."
|
echo "standard test ..."
|
||||||
./testminiwget $URL1 "${DOWNLOADEDFILE}.1"
|
$TESTMINIWGET $URL1 "${DOWNLOADEDFILE}.1"
|
||||||
if cmp $EXPECTEDFILE "${DOWNLOADEDFILE}.1" ; then
|
if cmp $EXPECTEDFILE "${DOWNLOADEDFILE}.1" ; then
|
||||||
echo "ok"
|
echo "ok"
|
||||||
else
|
else
|
||||||
@ -83,7 +89,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "chunked transfert encoding test ..."
|
echo "chunked transfert encoding test ..."
|
||||||
./testminiwget $URL2 "${DOWNLOADEDFILE}.2"
|
$TESTMINIWGET $URL2 "${DOWNLOADEDFILE}.2"
|
||||||
if cmp $EXPECTEDFILE "${DOWNLOADEDFILE}.2" ; then
|
if cmp $EXPECTEDFILE "${DOWNLOADEDFILE}.2" ; then
|
||||||
echo "ok"
|
echo "ok"
|
||||||
else
|
else
|
||||||
@ -92,7 +98,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "response too long test ..."
|
echo "response too long test ..."
|
||||||
./testminiwget $URL3 "${DOWNLOADEDFILE}.3"
|
$TESTMINIWGET $URL3 "${DOWNLOADEDFILE}.3"
|
||||||
if cmp $EXPECTEDFILE "${DOWNLOADEDFILE}.3" ; then
|
if cmp $EXPECTEDFILE "${DOWNLOADEDFILE}.3" ; then
|
||||||
echo "ok"
|
echo "ok"
|
||||||
else
|
else
|
||||||
@ -101,7 +107,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "malformed response test ..."
|
echo "malformed response test ..."
|
||||||
./testminiwget $URL4 "${DOWNLOADEDFILE}.4"
|
$TESTMINIWGET $URL4 "${DOWNLOADEDFILE}.4"
|
||||||
|
|
||||||
# kill the test HTTP server
|
# kill the test HTTP server
|
||||||
kill $SERVERPID
|
kill $SERVERPID
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
TESTUPNPREPLYPARSE=./build/testupnpreplyparse
|
||||||
|
|
||||||
for f in testreplyparse/*.xml ; do
|
for f in testreplyparse/*.xml ; do
|
||||||
bf="`dirname $f`/`basename $f .xml`"
|
bf="`dirname $f`/`basename $f .xml`"
|
||||||
if ./testupnpreplyparse $f $bf.namevalue ; then
|
if $TESTUPNPREPLYPARSE $f $bf.namevalue ; then
|
||||||
echo "$f : passed"
|
echo "$f : passed"
|
||||||
else
|
else
|
||||||
echo "$f : FAILED"
|
echo "$f : FAILED"
|
||||||
|
@ -1,12 +1,19 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# $Id: updateminiupnpcstrings.sh,v 1.7 2011/01/04 11:41:53 nanard Exp $
|
# $Id: updateminiupnpcstrings.sh,v 1.7 2011/01/04 11:41:53 nanard Exp $
|
||||||
# project miniupnp : http://miniupnp.free.fr/
|
# project miniupnp : http://miniupnp.free.fr/
|
||||||
# (c) 2009 Thomas Bernard
|
# (c) 2009-2021 Thomas Bernard
|
||||||
|
|
||||||
FILE=miniupnpcstrings.h
|
FILE=miniupnpcstrings.h
|
||||||
TMPFILE=miniupnpcstrings.h.tmp
|
|
||||||
TEMPLATE_FILE=${FILE}.in
|
TEMPLATE_FILE=${FILE}.in
|
||||||
|
|
||||||
|
if [ -n "$1" ] ; then
|
||||||
|
FILE="$1"
|
||||||
|
fi
|
||||||
|
if [ -n "$2" ] ; then
|
||||||
|
TEMPLATE_FILE="$2"
|
||||||
|
fi
|
||||||
|
TMPFILE=`mktemp -t miniupnpcstrings`
|
||||||
|
|
||||||
# detecting the OS name and version
|
# detecting the OS name and version
|
||||||
OS_NAME=`uname -s`
|
OS_NAME=`uname -s`
|
||||||
OS_VERSION=`uname -r`
|
OS_VERSION=`uname -r`
|
||||||
@ -49,5 +56,5 @@ sed -e "$EXPR" < $TEMPLATE_FILE > $TMPFILE
|
|||||||
EXPR="s|MINIUPNPC_VERSION_STRING \".*\"|MINIUPNPC_VERSION_STRING \"${MINIUPNPC_VERSION}\"|"
|
EXPR="s|MINIUPNPC_VERSION_STRING \".*\"|MINIUPNPC_VERSION_STRING \"${MINIUPNPC_VERSION}\"|"
|
||||||
echo "setting MINIUPNPC_VERSION_STRING macro value to ${MINIUPNPC_VERSION} in $FILE."
|
echo "setting MINIUPNPC_VERSION_STRING macro value to ${MINIUPNPC_VERSION} in $FILE."
|
||||||
sed -e "$EXPR" < $TMPFILE > $FILE
|
sed -e "$EXPR" < $TMPFILE > $FILE
|
||||||
rm $TMPFILE
|
rm -v $TMPFILE
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user