diff --git a/miniupnpc/Makefile.mingw b/miniupnpc/Makefile.mingw index 7b58bd7..ae3e8b3 100644 --- a/miniupnpc/Makefile.mingw +++ b/miniupnpc/Makefile.mingw @@ -7,6 +7,9 @@ # To cross compile on a *nix machine : # make -f Makefile.mingw DLLWRAP=mingw32-dllwrap CC=mingw32-gcc AR=mingw32-ar # +SRCDIR = src +INCDIR = include + CC ?= gcc SETUP_COMPILER_FLAG?= DLLWRAP = dllwrap @@ -23,6 +26,7 @@ endif CFLAGS = -Wall -W -Wstrict-prototypes -Os CPPFLAGS = -DNDEBUG -D_WIN32_WINNT=0X501 CPPFLAGS += -Iinclude +CPPFLAGS += -I. LDLIBS = -lws2_32 -liphlpapi # -lwsock32 # -liphlpapi is needed for GetBestRoute() and GetIpAddrTable() @@ -77,13 +81,13 @@ miniupnpc.dll: miniupnpc.def $(OBJSDLL) miniupnpc.lib: miniupnpc.dll -%.o: %.c +%.o: $(SRCDIR)/%.c $(CC) $(CFLAGS) $(CPPFLAGS) -DMINIUPNP_STATICLIB -c -o $@ $< -dll-%.o: %.c +dll-%.o: $(SRCDIR)/%.c $(CC) $(CFLAGS) $(CPPFLAGS) -DMINIUPNP_EXPORTS -c -o $@ $< -%-shared.o: %.c +%-shared.o: $(SRCDIR)/%.c $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< # --enable-stdcall-fixup @@ -123,26 +127,26 @@ winres.o: miniupnpc.rc rc_version.h testminixml.exe: testminixml.o minixml.o igd_desc_parse.o $(CC) -static -o $@ $^ -minixml.o: minixml.c minixml.h +minixml.o: $(SRCDIR)/minixml.c $(SRCDIR)/minixml.h -upnpc.o: include/miniwget.h minisoap.h include/miniupnpc.h include/igd_desc_parse.h +upnpc.o: include/miniwget.h $(SRCDIR)/minisoap.h include/miniupnpc.h include/igd_desc_parse.h upnpc.o: include/upnpreplyparse.h include/upnpcommands.h include/upnperrors.h miniupnpcstrings.h -miniwget.o: miniwget.c include/miniwget.h miniupnpcstrings.h connecthostport.h +miniwget.o: $(SRCDIR)/miniwget.c include/miniwget.h miniupnpcstrings.h $(SRCDIR)/connecthostport.h -minisoap.o: minisoap.c minisoap.h miniupnpcstrings.h +minisoap.o: $(SRCDIR)/minisoap.c $(SRCDIR)/minisoap.h miniupnpcstrings.h -miniupnpc.o: miniupnpc.c include/miniupnpc.h minisoap.h include/miniwget.h minixml.h \ - addr_is_reserved.h +miniupnpc.o: $(SRCDIR)/miniupnpc.c include/miniupnpc.h $(SRCDIR)/minisoap.h \ + include/miniwget.h $(SRCDIR)/minixml.h $(SRCDIR)/addr_is_reserved.h -igd_desc_parse.o: igd_desc_parse.c include/igd_desc_parse.h +igd_desc_parse.o: $(SRCDIR)/igd_desc_parse.c include/igd_desc_parse.h -upnpreplyparse.o: upnpreplyparse.c include/upnpreplyparse.h minixml.h +upnpreplyparse.o: $(SRCDIR)/upnpreplyparse.c include/upnpreplyparse.h $(SRCDIR)/minixml.h -upnpcommands.o: upnpcommands.c include/upnpcommands.h include/upnpreplyparse.h \ +upnpcommands.o: $(SRCDIR)/upnpcommands.c include/upnpcommands.h include/upnpreplyparse.h \ include/miniupnpc.h include/portlistingparse.h -minissdpc.o: minissdpc.c minissdpc.h receivedata.h +minissdpc.o: $(SRCDIR)/minissdpc.c $(SRCDIR)/minissdpc.h $(SRCDIR)/receivedata.h -upnpdev.o: upnpdev.c include/upnpdev.h +upnpdev.o: $(SRCDIR)/upnpdev.c include/upnpdev.h