aboutsummaryrefslogtreecommitdiff
path: root/external/miniupnpc/Makefile.mingw
blob: 7b00650fccad271aa4753e2859ad0b197a1b51dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# $Id: Makefile.mingw,v 1.18 2014/01/17 09:04:01 nanard Exp $
# Miniupnp project.
# http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
# (c) 2005-2014 Thomas Bernard
# This Makefile is made for MinGW
#
CC = gcc
#CFLAGS = -Wall -g -DDEBUG -D_WIN32_WINNT=0X501
CFLAGS = -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501
LDLIBS = -lws2_32 -liphlpapi
# -lwsock32
# -liphlpapi is needed for GetBestRoute() and GetIpAddrTable()
PYTHON=\utils\python25\python
OBJS=miniwget.o minixml.o igd_desc_parse.o minisoap.o \
     miniupnpc.o upnpreplyparse.o upnpcommands.o upnperrors.o \
     connecthostport.o portlistingparse.o receivedata.o
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
	echo $@ generated with $<

dll/upnpc.o:	upnpc.o
	echo $@ generated with $<

.c.o:
	$(CC) $(CFLAGS) -DMINIUPNP_STATICLIB -c -o $@ $<
	$(CC) $(CFLAGS) -DMINIUPNP_EXPORTS -c -o dll/$@ $<

upnpc.o:
	$(CC) $(CFLAGS) -DMINIUPNP_STATICLIB -c -o $@ $<
	$(CC) $(CFLAGS) -c -o dll/$@ $<

# --enable-stdcall-fixup
upnpc-static:	upnpc.o libminiupnpc.a
	$(CC) -o $@ $^ $(LDLIBS)

upnpc-shared:	dll/upnpc.o miniupnpc.lib
	$(CC) -o $@ $^ $(LDLIBS)

wingenminiupnpcstrings:	wingenminiupnpcstrings.o

wingenminiupnpcstrings.o:	wingenminiupnpcstrings.c

miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings
	wingenminiupnpcstrings $< $@

minixml.o:	minixml.c minixml.h miniupnpcstrings.h

upnpc.o:	upnpc.c miniwget.h minisoap.h miniupnpc.h igd_desc_parse.h upnpreplyparse.h upnpcommands.h upnperrors.h

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