2
0

Makefile.mingw 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # $Id: Makefile.mingw,v 1.9 2008/07/02 23:31:15 nanard Exp $
  2. # Miniupnp project.
  3. # http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
  4. # (c) 2005-2008 Thomas Bernard
  5. CC = gcc
  6. #CFLAGS = -Wall -g -DDEBUG
  7. CFLAGS = -Wall -Os -DNDEBUG
  8. LDLIBS = -lws2_32
  9. # -lwsock32
  10. PYTHON=\utils\python25\python
  11. OBJS=miniwget.o minixml.o igd_desc_parse.o minisoap.o \
  12. miniupnpc.o upnpreplyparse.o upnpcommands.o upnperrors.o
  13. OBJSDLL=$(addprefix dll/, $(OBJS))
  14. all: init upnpc-static upnpc-shared testminixml libminiupnpc.a miniupnpc.dll
  15. init:
  16. mkdir dll
  17. echo "" > init
  18. clean:
  19. del upnpc testminixml *.o
  20. del dll/*.o
  21. libminiupnpc.a: $(OBJS)
  22. $(AR) cr $@ $?
  23. pythonmodule: libminiupnpc.a
  24. $(PYTHON) setupmingw32.py build --compiler=mingw32
  25. $(PYTHON) setupmingw32.py install --skip-build
  26. miniupnpc.dll: libminiupnpc.a $(OBJSDLL)
  27. dllwrap -k --driver-name gcc --def miniupnpc.def \
  28. --output-def miniupnpc.dll.def --implib miniupnpc.lib -o $@ \
  29. $(OBJSDLL) $(LDLIBS)
  30. miniupnpc.lib: miniupnpc.dll
  31. echo $@ generated with $<
  32. dll/upnpc.o: upnpc.o
  33. echo $@ generated with $<
  34. .c.o:
  35. $(CC) $(CFLAGS) -DSTATICLIB -c -o $@ $<
  36. $(CC) $(CFLAGS) -DMINIUPNP_EXPORTS -c -o dll/$@ $<
  37. upnpc.o:
  38. $(CC) $(CFLAGS) -DSTATICLIB -c -o $@ $<
  39. $(CC) $(CFLAGS) -c -o dll/$@ $<
  40. upnpc-static: upnpc.o libminiupnpc.a
  41. $(CC) -o $@ $^ $(LDLIBS)
  42. upnpc-shared: dll/upnpc.o miniupnpc.lib
  43. $(CC) -o $@ $^ $(LDLIBS)
  44. minixml.o: minixml.c minixml.h
  45. upnpc.o: upnpc.c miniwget.h minisoap.h miniupnpc.h igd_desc_parse.h upnpreplyparse.h upnpcommands.h
  46. miniwget.o: miniwget.c miniwget.h
  47. minisoap.o: minisoap.c minisoap.h
  48. miniupnpc.o: miniupnpc.c miniupnpc.h minisoap.h miniwget.h minixml.h
  49. igd_desc_parse.o: igd_desc_parse.c igd_desc_parse.h
  50. testminixml: minixml.o igd_desc_parse.o testminixml.c
  51. upnpreplyparse.o: upnpreplyparse.c upnpreplyparse.h minixml.h
  52. upnpcommands.o: upnpcommands.c upnpcommands.h upnpreplyparse.h miniupnpc.h