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.

135 lines
7.8 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\zig
  6. ENV_SET PATH=$(COMPILER_PATH)
  7. SET CC=zig cc
  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\zig
  26. ENV_SET PATH=$(COMPILER_PATH)
  27. SET RESC=zig windres
  28. cd $(CURRENT_DIRECTORY)
  29. echo
  30. echo > Compile simple resource .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. echo
  35. echo > Reset Environment
  36. echo --------------------------
  37. ENV_UNSET PATH
  38. ::raylib_compile_execute
  39. echo > Setup required Environment
  40. echo -------------------------------------
  41. SET RAYLIB_PATH=C:\raylib\raylib
  42. SET COMPILER_PATH=C:\raylib\zig
  43. ENV_SET PATH=$(COMPILER_PATH)
  44. SET CC=zig cc
  45. SET CFLAGS=$(RAYLIB_PATH)\src\raylib.rc.data -s -static -Os -std=c99 -Wall -I$(RAYLIB_PATH)\src -Iexternal -DPLATFORM_DESKTOP
  46. SET LDFLAGS=-L$(RAYLIB_PATH)\src -lraylib -lopengl32 -lgdi32 -lwinmm
  47. cd $(CURRENT_DIRECTORY)
  48. echo
  49. echo > Clean latest build
  50. echo ------------------------
  51. cmd /c IF EXIST $(NAME_PART).exe del /F $(NAME_PART).exe
  52. echo
  53. echo > Saving Current File
  54. echo -------------------------
  55. npp_save
  56. echo
  57. echo > Compile program
  58. echo -----------------------
  59. $(CC) -o $(NAME_PART).exe $(FILE_NAME) $(CFLAGS) $(LDFLAGS)
  60. echo
  61. echo > Reset Environment
  62. echo --------------------------
  63. ENV_UNSET PATH
  64. echo
  65. echo > Execute program
  66. echo -----------------------
  67. cmd /c IF EXIST $(NAME_PART).exe $(NAME_PART).exe
  68. ::raylib_source_compile
  69. echo > Choose compile options
  70. echo -------------------------------
  71. echo Set desired OpenGL API version: 1.1, 2.1, 3.3, 4.3
  72. SET GRAPHIC_API=GRAPHICS_API_OPENGL_33
  73. echo
  74. echo > Setup required Environment
  75. echo -------------------------------------
  76. SET RAYLIB_PATH=C:\raylib\raylib
  77. SET COMPILER_PATH=C:\raylib\zig
  78. ENV_SET PATH=$(COMPILER_PATH)
  79. SET CC=zig cc
  80. SET AR=zig ar
  81. SET CFLAGS=-std=c99 -Wall -DPLATFORM_DESKTOP -D$(GRAPHIC_API)
  82. cd $(RAYLIB_PATH)\src
  83. echo
  84. echo > Clean latest build
  85. echo -----------------------
  86. cmd /c del /F *.o
  87. cmd /c del /F libraylib.a
  88. echo
  89. echo > Compile raylib modules
  90. echo ------------------------------
  91. $(CC) -c rcore.c -Iexternal/glfw/include $(CFLAGS)
  92. $(CC) -c rglfw.c $(CFLAGS)
  93. $(CC) -c rshapes.c $(CFLAGS)
  94. $(CC) -c rtextures.c $(CFLAGS)
  95. $(CC) -c rtext.c $(CFLAGS)
  96. $(CC) -c rmodels.c $(CFLAGS)
  97. $(CC) -c raudio.c $(CFLAGS)
  98. $(CC) -c utils.c $(CFLAGS)
  99. echo
  100. echo > Generate raylib library
  101. echo ------------------------------
  102. $(AR) rcs libraylib.a rcore.o rglfw.o rshapes.o rtextures.o rtext.o rmodels.o raudio.o utils.o
  103. echo
  104. echo > Reset Environment
  105. echo --------------------------
  106. ENV_UNSET PATH
  107. ::raylib_zig_build
  108. echo > Choose compile options
  109. echo -------------------------------
  110. echo Set desired PLATFORM: DESKTOP, RPI, ANDROID, WEB
  111. SET PLATFORM=PLATFORM_DESKTOP
  112. echo
  113. echo > Setup required Environment
  114. echo -------------------------------------
  115. SET RAYLIB_PATH=C:\raylib\raylib
  116. SET COMPILER_PATH=C:\raylib\zig
  117. ENV_SET PATH=$(COMPILER_PATH)
  118. cd $(CURRENT_DIRECTORY)
  119. echo
  120. echo WARNING: build.zig to be executed must be open and selected!
  121. echo
  122. echo > Execute zig build
  123. echo --------------------
  124. zig build PLATFORM=$(PLATFORM)
  125. // Build a single example using raylib/examples/build.zig
  126. //zig build core/core_basic_window PLATFORM=$(PLATFORM)
  127. echo
  128. echo > Reset Environment
  129. echo --------------------------
  130. ENV_UNSET PATH