You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
6.8 KiB

  1. ��::basic_c_compilation
  2. echo > Setup required Environment
  3. echo -------------------------------------
  4. SET RAYLIB_DIR=C:\raylib
  5. ENV_SET PATH=$(RAYLIB_DIR)\mingw\bin
  6. SET CC=gcc
  7. SET RESC=windres
  8. cd $(CURRENT_DIRECTORY)
  9. echo
  10. echo > Compile simple C file
  11. echo ----------------------------
  12. $(CC) -o $(NAME_PART).exe $(FILE_NAME) -Wall -Wextra -std=c99
  13. $(RESC) -DIDC_STATIC=-1 -O coff raylib.rc -o raylib.rc.o
  14. echo
  15. echo > Reset Environment
  16. echo --------------------------
  17. ENV_UNSET PATH
  18. ::raylib_compile_execute
  19. echo > Setup required Environment
  20. echo -------------------------------------
  21. SET RAYLIB_DIR=C:\raylib
  22. ENV_SET PATH=$(RAYLIB_DIR)\mingw\bin
  23. SET CC=gcc
  24. SET CFLAGS=$(RAYLIB_DIR)\raylib\raylib.rc.o -s -O2 -std=c99 -Wall
  25. SET LDFLAGS=-lraylib -lopengl32 -lgdi32 -lwinmm -Iexternal -I../../src -L../../src -Wl,--subsystem,windows
  26. cd $(CURRENT_DIRECTORY)
  27. echo
  28. echo > Clean latest build
  29. echo ------------------------
  30. cmd /c IF EXIST $(NAME_PART).exe del /F $(NAME_PART).exe
  31. echo
  32. echo > Compile program
  33. echo -----------------------
  34. $(CC) -o $(NAME_PART).exe $(FILE_NAME) $(CFLAGS) $(LDFLAGS)
  35. echo
  36. echo > Reset Environment
  37. echo --------------------------
  38. ENV_UNSET PATH
  39. echo
  40. echo > Execute program
  41. echo -----------------------
  42. cmd /c IF EXIST $(NAME_PART).exe $(NAME_PART).exe
  43. ::raylib_source_compile
  44. echo > Choose compile options
  45. echo -------------------------------
  46. echo Set desired OpenGL API version: 1.1, 2.1, 3.3
  47. SET GRAPHIC_API=GRAPHICS_API_OPENGL_33
  48. echo
  49. echo > Setup required Environment
  50. echo -------------------------------------
  51. SET RAYLIB_DIR=C:\raylib
  52. ENV_SET PATH=$(RAYLIB_DIR)\mingw\bin
  53. SET CC=gcc
  54. SET AR=ar
  55. SET CFLAGS=-std=c99 -Wall -DPLATFORM_DESKTOP -D$(GRAPHIC_API)
  56. SET RELEASEPATH=$(RAYLIB_DIR)\mingw
  57. //cd $(RAYLIB_DIR)\raylib\src
  58. cd $(CURRENT_DIRECTORY)
  59. echo
  60. echo > Clean latest build
  61. echo -----------------------
  62. cmd /c del /F *.o
  63. cmd /c del /F libraylib.a
  64. echo
  65. echo > Compile raylib modules
  66. echo ------------------------------
  67. $(CC) -c core.c -Iexternal/glfw/include $(CFLAGS)
  68. $(CC) -c rglfw.c $(CFLAGS)
  69. $(CC) -c rlgl.c $(CFLAGS)
  70. $(CC) -c shapes.c $(CFLAGS)
  71. $(CC) -c textures.c $(CFLAGS)
  72. $(CC) -c text.c $(CFLAGS)
  73. $(CC) -c models.c $(CFLAGS)
  74. $(CC) -c audio.c $(CFLAGS)
  75. $(CC) -c external/mini_al.c $(CFLAGS)
  76. $(CC) -c external/stb_vorbis.c $(CFLAGS)
  77. $(CC) -c utils.c $(CFLAGS)
  78. echo
  79. echo > Generate raylib library
  80. echo ------------------------------
  81. $(AR) rcs libraylib.a core.o rglfw.o rlgl.o shapes.o textures.o text.o models.o audio.o mini_al.o stb_vorbis.o utils.o
  82. echo
  83. echo > Install raylib library
  84. echo --------------------------
  85. cmd /c copy raylib.h ..\release\include\raylib.h /Y
  86. cmd /c copy libraylib.a ..\release\libs\win32\mingw\libraylib.a /Y
  87. cmd /c copy raylib.h $(RELEASEPATH)\include /Y
  88. cmd /c copy libraylib.a $(RELEASEPATH)\lib /Y
  89. echo
  90. echo > Reset Environment
  91. echo --------------------------
  92. ENV_UNSET PATH
  93. ::raylib_makefile
  94. echo > Choose compile options
  95. echo -------------------------------
  96. echo Set desired PLATFORM: DESKTOP, RPI, ANDROID, WEB
  97. SET PLATFORM=PLATFORM_DESKTOP
  98. echo
  99. echo > Setup required Environment
  100. echo -------------------------------------
  101. SET RAYLIB_PATH=C:\raylib
  102. ENV_SET PATH=$(RAYLIB_PATH)\mingw
  103. SET MAKE=mingw32-make
  104. cd $(CURRENT_DIRECTORY)
  105. echo
  106. echo > Execute makefile
  107. echo -----------------------
  108. $(MAKE) PLATFORM=$(PLATFORM) -B
  109. echo
  110. echo > Reset Environment
  111. echo --------------------------
  112. ENV_UNSET PATH