::basic_c_compilation
echo > Setup required Environment
echo -------------------------------------
SET RAYLIB_PATH=C:\raylib\raylib
SET COMPILER_PATH=C:\raylib\w64devkit\bin
ENV_SET PATH=$(COMPILER_PATH)
SET CC=gcc
cd $(CURRENT_DIRECTORY)
echo
echo > Saving Current File
echo -------------------------
npp_save
echo
echo > Compile simple C file
echo ----------------------------
$(CC) -o $(NAME_PART).exe $(FILE_NAME) -Wall -Wextra -std=c99
echo
echo > Reset Environment
echo --------------------------
ENV_UNSET PATH

::resource_file_compilation
echo > Setup required Environment
echo -------------------------------------
SET RAYLIB_PATH=C:\raylib\raylib
SET COMPILER_PATH=C:\raylib\w64devkit\bin
ENV_SET PATH=$(COMPILER_PATH)
SET RESC=windres
cd $(CURRENT_DIRECTORY)
echo
echo > Compile simple .rc file
echo ----------------------------
// Choose CPU architecture target: --target=pe-i386 (32bit) / --target=pe-x86-64 (64bit)
//$(RESC) $(NAME_PART).rc -o $(NAME_PART).rc.data --target=pe-x86-64
$(RESC) $(NAME_PART).rc -o $(NAME_PART).rc.data
echo
echo > Reset Environment
echo --------------------------
ENV_UNSET PATH

::raylib_compile_execute
echo > Setup required Environment
echo -------------------------------------
SET RAYLIB_PATH=C:\raylib\raylib
SET COMPILER_PATH=C:\raylib\w64devkit\bin
ENV_SET PATH=$(COMPILER_PATH)
SET CC=gcc
SET CFLAGS=$(RAYLIB_PATH)\src\raylib.rc.data -s -static -O3 -std=c99 -Wall -Wshadow -Wunused-parameter -I$(RAYLIB_PATH)\src -Iexternal -DPLATFORM_DESKTOP -L.
SET LDFLAGS=-lraylib -lopengl32 -lgdi32 -lwinmm -lshcore
cd $(CURRENT_DIRECTORY)
echo
echo > Clean latest build
echo ------------------------
cmd /c IF EXIST $(NAME_PART).exe del /F $(NAME_PART).exe
echo
echo > Saving Current File
echo -------------------------
npp_save
echo
echo > Compile program
echo -----------------------
$(CC) --version
$(CC) -o $(NAME_PART).exe $(FILE_NAME) $(CFLAGS) $(LDFLAGS)
echo
echo > Reset Environment
echo --------------------------
ENV_UNSET PATH
echo
echo > Execute program
echo -----------------------
cmd /c IF EXIST $(NAME_PART).exe $(NAME_PART).exe

::raylib_source_compile
echo > Choose compile options
echo -------------------------------
echo Set desired OpenGL API version: 1.1, 2.1, 3.3, 4.3
SET GRAPHIC_API=GRAPHICS_API_OPENGL_33
echo
echo > Setup required Environment
echo -------------------------------------
SET RAYLIB_PATH=C:\raylib\raylib
SET COMPILER_PATH=C:\raylib\w64devkit\bin
ENV_SET PATH=$(COMPILER_PATH)
SET CC=gcc
SET AR=ar
SET CFLAGS=-std=c99 -Wall -DPLATFORM_DESKTOP -D$(GRAPHIC_API) -Wno-unused-parameter
SET RELEASE_PATH=$(COMPILER_PATH)\..
cd $(RAYLIB_PATH)\src
echo
echo > Clean latest build
echo -----------------------
cmd /c del /F *.o
cmd /c del /F libraylib.a
echo
echo > Compile raylib modules
echo ------------------------------
$(CC) --version
$(CC) -c rcore.c -Iexternal/glfw/include $(CFLAGS)
$(CC) -c rglfw.c $(CFLAGS)
$(CC) -c rshapes.c $(CFLAGS)
$(CC) -c rtextures.c $(CFLAGS)
$(CC) -c rtext.c $(CFLAGS)
$(CC) -c rmodels.c $(CFLAGS)
$(CC) -c raudio.c $(CFLAGS)
echo
echo > Generate raylib library
echo ------------------------------
$(AR) rcs libraylib.a rcore.o rglfw.o rshapes.o rtextures.o rtext.o rmodels.o raudio.o
echo
echo > Install raylib library
echo --------------------------
cmd /c copy raylib.h $(RELEASE_PATH)\include /Y
cmd /c copy rlgl.h $(RELEASE_PATH)\include /Y
cmd /c copy libraylib.a $(RELEASE_PATH)\lib /Y
echo
echo > Reset Environment
echo --------------------------
ENV_UNSET PATH

::raylib_makefile
echo > Choose compile options
echo -------------------------------
echo Set desired PLATFORM: DESKTOP, DESKTOP_SDL, WEB, DRM, ANDROID
SET PLATFORM=PLATFORM_DESKTOP
echo
echo > Setup required Environment
echo -------------------------------------
SET RAYLIB_PATH=C:\raylib\raylib
SET COMPILER_PATH=C:\raylib\w64devkit\bin
ENV_SET PATH=$(COMPILER_PATH)
SET MAKE=mingw32-make
cd $(CURRENT_DIRECTORY)
echo
echo WARNING: Makefile to be executed must be open and selected!
echo
echo > Clean latest build
echo -----------------------
cmd /c del /F *.o
cmd /c del /F libraylib.a
echo
echo > Execute makefile (generic)
echo -----------------------------
$(MAKE)  PLATFORM=$(PLATFORM) -B
echo
//echo > Compile one specific example
//$(MAKE) core/core_basic_window PLATFORM=$(PLATFORM) -B
echo
//echo > Compile one specific example, using Web custom Makefile.Web
//$(MAKE) -f Makefile.Web shaders/shaders_deferred_render PLATFORM=$(PLATFORM) -B
echo
echo > Reset Environment
echo --------------------------
ENV_UNSET PATH

::basic_cpp_compilation
echo > Setup required Environment
echo -------------------------------------
SET RAYLIB_PATH=C:\raylib\raylib
SET COMPILER_PATH=C:\raylib\w64devkit\bin
ENV_SET PATH=$(COMPILER_PATH)
SET CC=g++
cd $(CURRENT_DIRECTORY)
echo
echo > Saving Current File
echo -------------------------
npp_save
echo
echo > Compile simple C file
echo ----------------------------
$(CC) -o $(NAME_PART).exe $(FILE_NAME) -Os -Wall -Wextra
echo
echo > Reset Environment
echo --------------------------
ENV_UNSET PATH

::raylib_source_compile_web
echo > Setup required Environment
echo -------------------------------------
SET RAYLIB_PATH=C:\raylib\raylib
SET EMSDK_PATH=C:\raylib\emsdk
SET EMSCRIPTEN_PATH=$(EMSDK_PATH)\upstream\emscripten
SET CLANG_PATH=$(EMSDK_PATH)\upstream\bin
SET PYTHON_PATH=$(EMSDK_PATH)\python\3.13.3_64bit
SET NODE_PATH=$(EMSDK_PATH)\node\22.16.0_64bit\bin
ENV_SET PATH=$(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH)
echo
echo > Set required web compilation options
echo -----------------------------------------------
SET CC=$(EMSDK_PATH)\upstream\emscripten\emcc
SET AR=$(EMSDK_PATH)\upstream\emscripten\emar
SET CFLAGS= -Wall -D_GNU_SOURCE -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2 -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing -std=gnu99 -Os  -I.
cd $(RAYLIB_PATH)\src
echo
echo > Clean latest raylib web build
echo -------------------------------------
cmd /c del /F *.o
cmd /c del /F libraylib.web.a
echo
echo > Compile raylib modules
echo ------------------------------
cmd /c $(CC) -c rcore.c $(CFLAGS)
cmd /c $(CC) -c rshapes.c $(CFLAGS)
cmd /c $(CC) -c rtextures.c $(CFLAGS)
cmd /c $(CC) -c rtext.c $(CFLAGS)
cmd /c $(CC) -c rmodels.c $(CFLAGS)
cmd /c $(CC) -c raudio.c $(CFLAGS)
echo
echo > Generate raylib web library
echo ------------------------------------
cmd /c $(AR) rcs libraylib.web.a rcore.o rshapes.o rtextures.o rtext.o rmodels.o raudio.o
echo
echo > Reset Environment
echo --------------------------
ENV_UNSET PATH

::raylib_compile_execute_web
echo > Setup required Environment
echo -------------------------------------
SET RAYLIB_PATH=C:\raylib\raylib
SET EMSDK_PATH=C:\raylib\emsdk
SET EMSCRIPTEN_PATH=$(EMSDK_PATH)\upstream\emscripten
SET CLANG_PATH=$(EMSDK_PATH)\upstream\bin
SET PYTHON_PATH=$(EMSDK_PATH)\python\3.13.3_64bit
SET NODE_PATH=$(EMSDK_PATH)\node\22.16.0_64bit\bin
ENV_SET PATH=$(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH)
echo Set required web compilation options
SET CC=$(EMSDK_PATH)\upstream\emscripten\emcc
SET CFLAGS=-Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result -O3 -I. -Iexternal -I$(RAYLIB_PATH)\src -I$(RAYLIB_PATH)\external -DPLATFORM_WEB
SET LDFLAGS=-L. -L$(RAYLIB_PATH)\src -sUSE_GLFW=3 -sEXPORTED_RUNTIME_METHODS=ccall -sASYNCIFY --shell-file $(RAYLIB_PATH)\src\shell.html
//SET LDFLAGS=-L. -L$(RAYLIB_PATH)\src -sEXPORTED_RUNTIME_METHODS=ccall -sASYNCIFY --shell-file $(RAYLIB_PATH)\src\shell.html
SET LDLIBS=$(RAYLIB_PATH)\src\libraylib.web.a
// TODO: If your game uses some resources/assets, set the directory path as shown in the commented line!
SET RESOURCES_PATH= resources
SET RESOURCES=--preload-file $(RESOURCES_PATH)
cd $(CURRENT_DIRECTORY)
echo
echo > Clean latest build
echo ------------------------
cmd /c IF EXIST $(NAME_PART).html del /F $(NAME_PART).html
cmd /c IF EXIST $(NAME_PART).wasm del /F $(NAME_PART).wasm
cmd /c IF EXIST $(NAME_PART).js del /F $(NAME_PART).js
cmd /c IF EXIST $(NAME_PART).data del /F $(NAME_PART).data
echo
echo > Saving Current File
echo -------------------------
npp_save
echo
echo > Compile program
echo -----------------------
cmd /c $(CC) --version
cmd /c $(CC) -o $(NAME_PART).html $(FILE_NAME) $(CFLAGS) $(LDFLAGS) $(LDLIBS)
echo
echo > Reset Environment
echo --------------------------
ENV_UNSET PATH
echo
echo > Execute program: Use local server!
echo ----------------------------------------------
// WARNING: To launch the web, a local host is required
NPP_RUN python -m http.server 8080
cmd /c IF EXIST $(NAME_PART).html explorer "http:\\localhost:8080/$(NAME_PART).html"

