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.

177 lines
10 KiB

  1. ��::basic_c_compilation
  2. echo > Setup required Environment
  3. echo -------------------------------------
  4. SET RAYLIB_PATH=C:\raylib\raylib
  5. SET COMPILER_PATH=C:\raylib\w64devkit\bin
  6. ENV_SET PATH=$(COMPILER_PATH)
  7. SET CC=gcc
  8. cd $(CURRENT_DIRECTORY)
  9. echo
  10. echo > Saving Current File
  11. echo -------------------------
  12. npp_save
  13. echo
  14. echo > Compile simple C file
  15. echo ----------------------------
  16. $(CC) -o $(NAME_PART).exe $(FILE_NAME) -Wall -Wextra -std=c99
  17. echo
  18. echo > Reset Environment
  19. echo --------------------------
  20. ENV_UNSET PATH
  21. ::resource_file_compilation
  22. echo > Setup required Environment
  23. echo -------------------------------------
  24. SET RAYLIB_PATH=C:\raylib\raylib
  25. SET COMPILER_PATH=C:\raylib\w64devkit\bin
  26. ENV_SET PATH=$(COMPILER_PATH)
  27. SET RESC=windres
  28. cd $(CURRENT_DIRECTORY)
  29. echo
  30. echo > Compile simple .rc file
  31. echo ----------------------------
  32. // Choose CPU architecture target: --target=pe-i386 (32bit) / --target=pe-x86-64 (64bit)
  33. //$(RESC) $(NAME_PART).rc -o $(NAME_PART).rc.data --target=pe-x86-64
  34. $(RESC) $(NAME_PART).rc -o $(NAME_PART).rc.data
  35. echo
  36. echo > Reset Environment
  37. echo --------------------------
  38. ENV_UNSET PATH
  39. ::raylib_compile_execute
  40. echo > Setup required Environment
  41. echo -------------------------------------
  42. SET RAYLIB_PATH=C:\raylib\raylib
  43. SET COMPILER_PATH=C:\raylib\w64devkit\bin
  44. ENV_SET PATH=$(COMPILER_PATH)
  45. SET CC=gcc
  46. SET CFLAGS=$(RAYLIB_PATH)\src\raylib.rc.data -s -static -O2 -std=c99 -Wall -I$(RAYLIB_PATH)\src -Iexternal -DPLATFORM_DESKTOP
  47. SET LDFLAGS=-lraylib -lopengl32 -lgdi32 -lwinmm
  48. cd $(CURRENT_DIRECTORY)
  49. echo
  50. echo > Clean latest build
  51. echo ------------------------
  52. cmd /c IF EXIST $(NAME_PART).exe del /F $(NAME_PART).exe
  53. echo
  54. echo > Saving Current File
  55. echo -------------------------
  56. npp_save
  57. echo
  58. echo > Compile program
  59. echo -----------------------
  60. $(CC) --version
  61. $(CC) -o $(NAME_PART).exe $(FILE_NAME) $(CFLAGS) $(LDFLAGS)
  62. echo
  63. echo > Reset Environment
  64. echo --------------------------
  65. ENV_UNSET PATH
  66. echo
  67. echo > Execute program
  68. echo -----------------------
  69. cmd /c IF EXIST $(NAME_PART).exe $(NAME_PART).exe
  70. ::raylib_source_compile
  71. echo > Choose compile options
  72. echo -------------------------------
  73. echo Set desired OpenGL API version: 1.1, 2.1, 3.3, 4.3
  74. SET GRAPHIC_API=GRAPHICS_API_OPENGL_33
  75. echo
  76. echo > Setup required Environment
  77. echo -------------------------------------
  78. SET RAYLIB_PATH=C:\raylib\raylib
  79. SET COMPILER_PATH=C:\raylib\w64devkit\bin
  80. ENV_SET PATH=$(COMPILER_PATH)
  81. SET CC=gcc
  82. SET AR=ar
  83. SET CFLAGS=-std=c99 -Wall -DPLATFORM_DESKTOP -D$(GRAPHIC_API) -Wno-unused-parameter
  84. SET RELEASE_PATH=$(COMPILER_PATH)\..\x86_64-w64-mingw32
  85. cd $(RAYLIB_PATH)\src
  86. echo
  87. echo > Clean latest build
  88. echo -----------------------
  89. cmd /c del /F *.o
  90. cmd /c del /F libraylib.a
  91. echo
  92. echo > Compile raylib modules
  93. echo ------------------------------
  94. $(CC) --version
  95. $(CC) -c rcore.c -Iexternal/glfw/include $(CFLAGS)
  96. $(CC) -c rglfw.c $(CFLAGS)
  97. $(CC) -c rshapes.c $(CFLAGS)
  98. $(CC) -c rtextures.c $(CFLAGS)
  99. $(CC) -c rtext.c $(CFLAGS)
  100. $(CC) -c rmodels.c $(CFLAGS)
  101. $(CC) -c raudio.c $(CFLAGS)
  102. $(CC) -c utils.c $(CFLAGS)
  103. echo
  104. echo > Generate raylib library
  105. echo ------------------------------
  106. $(AR) rcs libraylib.a rcore.o rglfw.o rshapes.o rtextures.o rtext.o rmodels.o raudio.o utils.o
  107. echo
  108. echo > Install raylib library
  109. echo --------------------------
  110. cmd /c copy raylib.h $(RELEASE_PATH)\include /Y
  111. cmd /c copy rlgl.h $(RELEASE_PATH)\include /Y
  112. cmd /c copy libraylib.a $(RELEASE_PATH)\lib /Y
  113. echo
  114. echo > Reset Environment
  115. echo --------------------------
  116. ENV_UNSET PATH
  117. ::raylib_makefile
  118. echo > Choose compile options
  119. echo -------------------------------
  120. echo Set desired PLATFORM: DESKTOP, RPI, ANDROID, WEB
  121. SET PLATFORM=PLATFORM_DESKTOP
  122. echo
  123. echo > Setup required Environment
  124. echo -------------------------------------
  125. SET RAYLIB_PATH=C:\raylib\raylib
  126. SET COMPILER_PATH=C:\raylib\w64devkit\bin
  127. ENV_SET PATH=$(COMPILER_PATH)
  128. SET MAKE=mingw32-make
  129. cd $(CURRENT_DIRECTORY)
  130. echo
  131. echo WARNING: Makefile to be executed must be open and selected!
  132. echo
  133. echo > Clean latest build
  134. echo -----------------------
  135. cmd /c del /F *.o
  136. cmd /c del /F libraylib.a
  137. echo
  138. echo > Execute makefile (generic)
  139. echo -----------------------------
  140. $(MAKE) PLATFORM=$(PLATFORM) -B
  141. echo
  142. //echo > Compile one specific example
  143. //$(MAKE) core/core_basic_window PLATFORM=$(PLATFORM) -B
  144. echo
  145. //echo > Compile one specific example, using Web custom Makefile.Web
  146. //$(MAKE) -f Makefile.Web core/core_basic_window PLATFORM=$(PLATFORM) -B
  147. echo
  148. echo > Reset Environment
  149. echo --------------------------
  150. ENV_UNSET PATH
  151. ::basic_cpp_compilation
  152. echo > Setup required Environment
  153. echo -------------------------------------
  154. SET RAYLIB_PATH=C:\raylib\raylib
  155. SET COMPILER_PATH=C:\raylib\w64devkit\bin
  156. ENV_SET PATH=$(COMPILER_PATH)
  157. SET CC=g++
  158. cd $(CURRENT_DIRECTORY)
  159. echo
  160. echo > Saving Current File
  161. echo -------------------------
  162. npp_save
  163. echo
  164. echo > Compile simple C file
  165. echo ----------------------------
  166. $(CC) -o $(NAME_PART).exe $(FILE_NAME) -Os -Wall -Wextra
  167. echo
  168. echo > Reset Environment
  169. echo --------------------------
  170. ENV_UNSET PATH