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.

116 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)\tcc
  6. SET CC=tcc
  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)\tcc
  23. SET CC=tcc
  24. //SET CFLAGS=$(RAYLIB_DIR)\tcc\raylib.rc.o -std=c99 -Wall
  25. SET CFLAGS=-std=c99 -Wall
  26. SET LDFLAGS=-lmsvcrt -lraylib -lopengl32 -lgdi32 -lkernel32 -lshell32 -luser32 -Wl,-subsystem=gui
  27. cd $(CURRENT_DIRECTORY)
  28. echo
  29. echo > Clean latest build
  30. echo ------------------------
  31. cmd /c IF EXIST $(NAME_PART).exe del /F $(NAME_PART).exe
  32. echo
  33. echo > Compile program
  34. echo -----------------------
  35. $(CC) -o $(NAME_PART).exe $(FILE_NAME) $(CFLAGS) $(LDFLAGS)
  36. echo
  37. echo > Reset Environment
  38. echo --------------------------
  39. ENV_UNSET PATH
  40. echo
  41. echo > Execute program
  42. echo -----------------------
  43. cmd /c IF EXIST $(NAME_PART).exe $(NAME_PART).exe
  44. ::raylib_source_compile
  45. echo > Choose compile options
  46. echo -------------------------------
  47. echo Set desired OpenGL API version: 1.1, 2.1, 3.3
  48. SET GRAPHIC_API=GRAPHICS_API_OPENGL_33
  49. echo
  50. echo > Setup required Environment
  51. echo -------------------------------------
  52. SET RAYLIB_DIR=C:\raylib
  53. ENV_SET PATH=$(RAYLIB_DIR)\tcc
  54. SET CC=tcc
  55. SET AR=tcc -ar
  56. SET CFLAGS=-std=c99 -Wall -DPLATFORM_DESKTOP -DSTBI_NO_SIMD -DMAL_NO_WASAPI -D$(GRAPHIC_API)
  57. SET RELEASEPATH=$(RAYLIB_DIR)\tcc
  58. //cd $(RAYLIB_DIR)\raylib\src
  59. cd $(CURRENT_DIRECTORY)
  60. echo
  61. echo > Clean latest build
  62. echo -----------------------
  63. cmd /c del /F *.o
  64. cmd /c del /F libraylib.a
  65. echo
  66. echo > Compile raylib modules
  67. echo ------------------------------
  68. $(CC) -c core.c -Iexternal/glfw/include $(CFLAGS)
  69. $(CC) -c rglfw.c $(CFLAGS)
  70. $(CC) -c rlgl.c $(CFLAGS)
  71. $(CC) -c shapes.c $(CFLAGS)
  72. $(CC) -c textures.c $(CFLAGS)
  73. $(CC) -c text.c $(CFLAGS)
  74. $(CC) -c models.c $(CFLAGS)
  75. $(CC) -c audio.c $(CFLAGS)
  76. $(CC) -c external/mini_al.c $(CFLAGS)
  77. $(CC) -c external/stb_vorbis.c $(CFLAGS)
  78. $(CC) -c utils.c $(CFLAGS)
  79. echo
  80. echo > Generate raylib library
  81. echo ------------------------------
  82. $(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
  83. echo
  84. echo > Install raylib library
  85. echo --------------------------
  86. cmd /c copy raylib.h ..\release\include\raylib.h /Y
  87. cmd /c copy libraylib.a ..\release\libs\win32\tcc\libraylib.a /Y
  88. cmd /c copy raylib.h $(RELEASEPATH)\include /Y
  89. cmd /c copy libraylib.a $(RELEASEPATH)\lib /Y
  90. echo
  91. echo > Reset Environment
  92. echo --------------------------
  93. ENV_UNSET PATH
  94. ::raylib_makefile
  95. echo > Choose compile options
  96. echo -------------------------------
  97. echo Set desired PLATFORM: DESKTOP, RPI, ANDROID, WEB
  98. SET PLATFORM=PLATFORM_DESKTOP
  99. echo
  100. echo > Setup required Environment
  101. echo -------------------------------------
  102. SET RAYLIB_PATH=C:\raylib
  103. ENV_SET PATH=$(RAYLIB_PATH)\tcc
  104. SET MAKE=make
  105. cd $(CURRENT_DIRECTORY)
  106. echo
  107. echo > Execute makefile
  108. echo -----------------------
  109. $(MAKE) PLATFORM=$(PLATFORM) -B
  110. echo
  111. echo > Reset Environment
  112. echo --------------------------
  113. ENV_UNSET PATH