Added CMD compilation scripts for examples
They could be useful for some people...
This commit is contained in:
parent
4467292a2d
commit
df40735067
2
.gitignore
vendored
2
.gitignore
vendored
@ -62,6 +62,8 @@ examples/*
|
|||||||
# Unignore examples Makefile
|
# Unignore examples Makefile
|
||||||
!examples/Makefile
|
!examples/Makefile
|
||||||
!examples/Makefile.Android
|
!examples/Makefile.Android
|
||||||
|
!examples/raylib_compile_execute.bat
|
||||||
|
!examples/raylib_makefile_example.bat
|
||||||
|
|
||||||
# Ignore all games files
|
# Ignore all games files
|
||||||
games/*
|
games/*
|
||||||
|
32
examples/raylib_compile_execute.bat
Normal file
32
examples/raylib_compile_execute.bat
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
::@echo off
|
||||||
|
:: .
|
||||||
|
:: Compile your examples using: raylib_compile_execute.bat core/core_basic_window.c
|
||||||
|
:: .
|
||||||
|
:: > Setup required Environment
|
||||||
|
:: -------------------------------------
|
||||||
|
set RAYLIB_INCLUDE_DIR=C:\GitHub\raylib\src
|
||||||
|
set RAYLIB_LIB_DIR=C:\GitHub\raylib\src
|
||||||
|
set RAYLIB_RES_FILE=C:\GitHub\raylib\raylib.rc.data
|
||||||
|
set COMPILER_DIR=C:\raylib\mingw\bin
|
||||||
|
set PATH=%PATH%;%COMPILER_DIR%
|
||||||
|
:: Get full filename path for input file %1
|
||||||
|
set FILENAME=%~f1
|
||||||
|
set NAMEPART=%FILENAME:~0,-2%
|
||||||
|
cd %~dp0
|
||||||
|
:: .
|
||||||
|
:: > Cleaning latest build
|
||||||
|
:: ---------------------------
|
||||||
|
cmd /c if exist %NAMEPART%.exe del /F %NAMEPART%.exe
|
||||||
|
:: .
|
||||||
|
:: > Compiling program
|
||||||
|
:: --------------------------
|
||||||
|
:: -s : Remove all symbol table and relocation information from the executable
|
||||||
|
:: -O2 : Optimization Level 2, this option increases both compilation time and the performance of the generated code
|
||||||
|
:: -std=c99 : Use C99 language standard
|
||||||
|
:: -Wall : Enable all compilation Warnings
|
||||||
|
:: -mwindows : Compile a Windows executable, no cmd window
|
||||||
|
gcc -o %NAMEPART%.exe %FILENAME% %RAYLIB_RES_FILE% -s -O2 -I%RAYLIB_INCLUDE_DIR% -I%RAYLIB_LIB_DIR% -lraylib -lopengl32 -lgdi32 -std=c99 -Wall -mwindows
|
||||||
|
:: .
|
||||||
|
:: > Executing program
|
||||||
|
:: -------------------------
|
||||||
|
cmd /c if exist %NAMEPART%.exe %NAMEPART%.exe
|
27
examples/raylib_makefile_example.bat
Normal file
27
examples/raylib_makefile_example.bat
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
::@echo off
|
||||||
|
:: .
|
||||||
|
:: Compile your examples using: raylib_makefile_example.bat core/core_basic_window
|
||||||
|
:: .
|
||||||
|
:: > Setup required Environment
|
||||||
|
:: -------------------------------------
|
||||||
|
set RAYLIB_INCLUDE_DIR=C:\GitHub\raylib\src
|
||||||
|
set RAYLIB_LIB_DIR=C:\GitHub\raylib\src
|
||||||
|
set RAYLIB_RES_FILE=C:\GitHub\raylib\raylib.rc.data
|
||||||
|
set COMPILER_DIR=C:\raylib\mingw\bin
|
||||||
|
set PATH=%PATH%;%COMPILER_DIR%
|
||||||
|
set FILENAME=%1
|
||||||
|
set FILENAME_FULL_PATH=%~f1
|
||||||
|
cd %~dp0
|
||||||
|
:: .
|
||||||
|
:: > Cleaning latest build
|
||||||
|
:: ---------------------------
|
||||||
|
cmd /c if exist %FILENAME_FULL_PATH%.exe del /F %FILENAME_FULL_PATH%.exe
|
||||||
|
:: .
|
||||||
|
:: > Compiling program
|
||||||
|
:: --------------------------
|
||||||
|
:: -B : Force make recompilation despite file not changed
|
||||||
|
mingw32-make %FILENAME% -B PLATFORM=PLATFORM_DESKTOP
|
||||||
|
:: .
|
||||||
|
:: > Executing program
|
||||||
|
:: -------------------------
|
||||||
|
cmd /c if exist %FILENAME_FULL_PATH%.exe %FILENAME_FULL_PATH%.exe
|
Loading…
Reference in New Issue
Block a user