miniupnp/miniupnpc/Makefile.mingw

103 lines
2.7 KiB
Makefile
Raw Normal View History

# $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
#
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 \
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))
2016-01-17 18:33:13 +00:00
all: init upnpc-static upnpc-shared testminixml libminiupnpc.a \
miniupnpc.dll listdevices
2011-09-27 20:25:35 +00:00
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
# echo $@ generated with $<
2011-09-27 20:25:35 +00:00
dll/upnpc.o: upnpc.o
# echo $@ generated with $<
2011-09-27 20:25:35 +00:00
.c.o:
$(CC) $(CFLAGS) -DMINIUPNP_STATICLIB -c -o $@ $<
2011-09-27 20:25:35 +00:00
$(CC) $(CFLAGS) -DMINIUPNP_EXPORTS -c -o dll/$@ $<
upnpc.o: upnpc.c
$(CC) $(CFLAGS) -DMINIUPNP_STATICLIB -c -o $@ $<
2011-09-27 20:25:35 +00:00
$(CC) $(CFLAGS) -c -o dll/$@ $<
# --enable-stdcall-fixup
2011-09-27 20:25:35 +00:00
upnpc-static: upnpc.o libminiupnpc.a
$(CC) -o $@ $^ $(LDLIBS)
2011-09-27 20:25:35 +00:00
upnpc-shared: dll/upnpc.o miniupnpc.lib
$(CC) -o $@ $^ $(LDLIBS)
2011-09-27 20:25:35 +00:00
2016-01-17 18:33:13 +00:00
listdevices: listdevices.o libminiupnpc.a
$(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
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
minissdpc.o: minissdpc.c minissdpc.h receivedata.h
upnpdev.o: upnpdev.c upnpdev.h