build.bat 1.3 KB

123456789101112131415161718192021222324252627282930
  1. @echo Compiling with MinGW
  2. @SET LIBS=-lws2_32 -liphlpapi
  3. @echo Compile getgateway
  4. gcc -c -Wall -Os -DWIN32 -DSTATICLIB -DENABLE_STRNATPMPERR getgateway.c
  5. gcc -c -Wall -Os -DWIN32 -DSTATICLIB -DENABLE_STRNATPMPERR testgetgateway.c
  6. gcc -o testgetgateway getgateway.o testgetgateway.o %LIBS%
  7. del testgetgateway.o
  8. @echo Compile natpmp-static:
  9. gcc -c -Wall -Os -DWIN32 -DSTATICLIB -DENABLE_STRNATPMPERR getgateway.c
  10. gcc -c -Wall -Os -DWIN32 -DSTATICLIB -DENABLE_STRNATPMPERR natpmp.c
  11. gcc -c -Wall -Os -DWIN32 wingettimeofday.c
  12. ar cr natpmp.a getgateway.o natpmp.o wingettimeofday.o
  13. del getgateway.o natpmp.o
  14. gcc -c -Wall -Os -DWIN32 -DSTATICLIB -DENABLE_STRNATPMPERR natpmpc.c
  15. gcc -o natpmpc-static natpmpc.o natpmp.a %LIBS%
  16. upx --best natpmpc-static.exe
  17. del natpmpc.o
  18. @echo Create natpmp.dll:
  19. gcc -c -Wall -Os -DWIN32 -DENABLE_STRNATPMPERR -DNATPMP_EXPORTS getgateway.c
  20. gcc -c -Wall -Os -DWIN32 -DENABLE_STRNATPMPERR -DNATPMP_EXPORTS natpmp.c
  21. dllwrap -k --driver-name gcc --def natpmp.def --output-def natpmp.dll.def --implib natpmp.lib -o natpmp.dll getgateway.o natpmp.o wingettimeofday.o %LIBS%
  22. @echo Compile natpmp-shared:
  23. gcc -c -Wall -Os -DWIN32 -DENABLE_STRNATPMPERR -DNATPMP_EXPORTS natpmpc.c
  24. gcc -o natpmpc-shared natpmpc.o natpmp.lib -lws2_32
  25. upx --best natpmpc-shared.exe
  26. del *.o