2015-09-18 16:11:56 +00:00
|
|
|
# $Id: Makefile.mingw,v 1.21 2015/09/18 12:45:16 nanard Exp $
|
2011-09-27 20:25:35 +00:00
|
|
|
# Miniupnp project.
|
|
|
|
# http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
2015-09-15 22:01:54 +00:00
|
|
|
# (c) 2005-2015 Thomas Bernard
|
2011-09-27 20:25:35 +00:00
|
|
|
# This Makefile is made for MinGW
|
|
|
|
#
|
2015-10-26 10:04:47 +00:00
|
|
|
CC ?= gcc
|
2011-09-27 20:25:35 +00:00
|
|
|
#CFLAGS = -Wall -g -DDEBUG -D_WIN32_WINNT=0X501
|
|
|
|
CFLAGS = -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501
|
|
|
|
LDLIBS = -lws2_32 -liphlpapi
|
|
|
|
# -lwsock32
|
2013-02-06 13:57:49 +00:00
|
|
|
# -liphlpapi is needed for GetBestRoute() and GetIpAddrTable()
|
2011-09-27 20:25:35 +00:00
|
|
|
PYTHON=\utils\python25\python
|
|
|
|
OBJS=miniwget.o minixml.o igd_desc_parse.o minisoap.o \
|
2015-09-15 22:12:43 +00:00
|
|
|
minissdpc.o \
|
2011-09-27 20:25:35 +00:00
|
|
|
miniupnpc.o upnpreplyparse.o upnpcommands.o upnperrors.o \
|
2015-09-15 22:08:52 +00:00
|
|
|
connecthostport.o portlistingparse.o receivedata.o \
|
2015-09-15 22:12:43 +00:00
|
|
|
upnpdev.o
|
2011-09-27 20:25:35 +00:00
|
|
|
OBJSDLL=$(addprefix dll/, $(OBJS))
|
|
|
|
|
|
|
|
all: init upnpc-static upnpc-shared testminixml libminiupnpc.a miniupnpc.dll
|
|
|
|
|
|
|
|
init:
|
|
|
|
mkdir dll
|
|
|
|
echo init > init
|
|
|
|
|
|
|
|
clean:
|
|
|
|
del upnpc testminixml *.o
|
|
|
|
del dll\*.o
|
|
|
|
del *.exe
|
|
|
|
del miniupnpc.dll
|
|
|
|
del libminiupnpc.a
|
|
|
|
|
|
|
|
libminiupnpc.a: $(OBJS)
|
|
|
|
$(AR) cr $@ $?
|
|
|
|
|
|
|
|
pythonmodule: libminiupnpc.a
|
|
|
|
$(PYTHON) setupmingw32.py build --compiler=mingw32
|
|
|
|
$(PYTHON) setupmingw32.py install --skip-build
|
|
|
|
|
|
|
|
miniupnpc.dll: libminiupnpc.a $(OBJSDLL)
|
|
|
|
dllwrap -k --driver-name gcc \
|
|
|
|
--def miniupnpc.def \
|
|
|
|
--output-def miniupnpc.dll.def \
|
|
|
|
--implib miniupnpc.lib -o $@ \
|
|
|
|
$(OBJSDLL) $(LDLIBS)
|
|
|
|
|
|
|
|
miniupnpc.lib: miniupnpc.dll
|
2015-10-26 09:48:45 +00:00
|
|
|
# echo $@ generated with $<
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
dll/upnpc.o: upnpc.o
|
2015-10-26 09:48:45 +00:00
|
|
|
# echo $@ generated with $<
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
.c.o:
|
2014-06-01 10:22:35 +00:00
|
|
|
$(CC) $(CFLAGS) -DMINIUPNP_STATICLIB -c -o $@ $<
|
2011-09-27 20:25:35 +00:00
|
|
|
$(CC) $(CFLAGS) -DMINIUPNP_EXPORTS -c -o dll/$@ $<
|
|
|
|
|
2015-10-26 10:04:47 +00:00
|
|
|
upnpc.o: upnpc.c
|
2014-06-01 10:22:35 +00:00
|
|
|
$(CC) $(CFLAGS) -DMINIUPNP_STATICLIB -c -o $@ $<
|
2011-09-27 20:25:35 +00:00
|
|
|
$(CC) $(CFLAGS) -c -o dll/$@ $<
|
|
|
|
|
2014-01-27 15:28:50 +00:00
|
|
|
# --enable-stdcall-fixup
|
2011-09-27 20:25:35 +00:00
|
|
|
upnpc-static: upnpc.o libminiupnpc.a
|
2014-01-27 15:28:50 +00:00
|
|
|
$(CC) -o $@ $^ $(LDLIBS)
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
upnpc-shared: dll/upnpc.o miniupnpc.lib
|
2014-01-27 15:28:50 +00:00
|
|
|
$(CC) -o $@ $^ $(LDLIBS)
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
wingenminiupnpcstrings: wingenminiupnpcstrings.o
|
|
|
|
|
|
|
|
wingenminiupnpcstrings.o: wingenminiupnpcstrings.c
|
|
|
|
|
|
|
|
miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings
|
|
|
|
wingenminiupnpcstrings $< $@
|
|
|
|
|
2015-09-15 22:01:54 +00:00
|
|
|
minixml.o: minixml.c minixml.h
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2015-10-26 10:04:47 +00:00
|
|
|
upnpc.o: miniwget.h minisoap.h miniupnpc.h igd_desc_parse.h
|
2015-09-15 22:01:54 +00:00
|
|
|
upnpc.o: upnpreplyparse.h upnpcommands.h upnperrors.h miniupnpcstrings.h
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
miniwget.o: miniwget.c miniwget.h miniupnpcstrings.h connecthostport.h
|
|
|
|
|
|
|
|
minisoap.o: minisoap.c minisoap.h miniupnpcstrings.h
|
|
|
|
|
|
|
|
miniupnpc.o: miniupnpc.c miniupnpc.h minisoap.h miniwget.h minixml.h
|
|
|
|
|
|
|
|
igd_desc_parse.o: igd_desc_parse.c igd_desc_parse.h
|
|
|
|
|
|
|
|
testminixml: minixml.o igd_desc_parse.o testminixml.c
|
|
|
|
|
|
|
|
upnpreplyparse.o: upnpreplyparse.c upnpreplyparse.h minixml.h
|
|
|
|
|
|
|
|
upnpcommands.o: upnpcommands.c upnpcommands.h upnpreplyparse.h miniupnpc.h portlistingparse.h
|
|
|
|
|
2015-09-18 16:11:56 +00:00
|
|
|
minissdpc.o: minissdpc.c minissdpc.h receivedata.h
|
2015-09-15 22:08:52 +00:00
|
|
|
|
|
|
|
upnpdev.o: upnpdev.c upnpdev.h
|
|
|
|
|