Download RRT-GPU/Makefile from perrabyte/higher-accuracy-integrals: direct link, hf CLI and curl.
- Browser
- Download file 2.11 kB
-
https://huggingface.co/datasets/perrabyte/higher-accuracy-integrals/resolve/main/RRT-GPU/Makefile
- Command line
-
hf download hf://datasets/perrabyte/higher-accuracy-integrals/RRT-GPU/Makefile
-
curl -L -o Makefile https://huggingface.co/datasets/perrabyte/higher-accuracy-integrals/resolve/main/RRT-GPU/Makefile
2.11 kB
| # RRT-GPU Rotating Wireframe Box Demo | |
| # ===================================== | |
| # Targets: | |
| # make - build everything (shaders + demo) | |
| # make shaders - compile GLSL shaders to SPIR-V | |
| # make demo - compile the C demo | |
| # make run - build and run | |
| # make clean - remove build artifacts | |
| # make validate - run with Vulkan validation layers | |
| CC = gcc | |
| CFLAGS = -Wall -Wextra -Wpedantic -O2 -std=c11 | |
| LDFLAGS = $(shell pkg-config --libs sdl2 vulkan) -lm | |
| INCLUDES = $(shell pkg-config --cflags sdl2 vulkan) | |
| GLSLANG = glslangValidator | |
| SHADER_DIR = shaders | |
| VERT_GLSL = $(SHADER_DIR)/vert.glsl | |
| FRAG_GLSL = $(SHADER_DIR)/frag.glsl | |
| VERT_SPV = $(SHADER_DIR)/vert.spv | |
| FRAG_SPV = $(SHADER_DIR)/frag.spv | |
| SRC = rrt_gpu_demo.c | |
| TARGET = rrt_gpu_demo | |
| # Default target | |
| all: shaders demo | |
| # Compile GLSL shaders to SPIR-V | |
| shaders: $(VERT_SPV) $(FRAG_SPV) | |
| $(VERT_SPV): $(VERT_GLSL) | |
| @mkdir -p $(SHADER_DIR) | |
| $(GLSLANG) -V -S vert $< -o $@ | |
| $(FRAG_SPV): $(FRAG_GLSL) | |
| @mkdir -p $(SHADER_DIR) | |
| $(GLSLANG) -V -S frag $< -o $@ | |
| # Compile C demo | |
| demo: $(SRC) $(VERT_SPV) $(FRAG_SPV) | |
| $(CC) $(CFLAGS) $(INCLUDES) -o $(TARGET) $(SRC) $(LDFLAGS) | |
| # Build and run | |
| run: all | |
| ./$(TARGET) | |
| # Run with Vulkan validation layers enabled | |
| validate: all | |
| VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ./$(TARGET) | |
| # Clean build artifacts | |
| clean: | |
| rm -f $(TARGET) | |
| rm -f $(VERT_SPV) $(FRAG_SPV) | |
| # Check dependencies | |
| check-deps: | |
| @echo "Checking dependencies..." | |
| @which $(CC) > /dev/null || (echo "ERROR: gcc not found" && exit 1) | |
| @which $(GLSLANG) > /dev/null || (echo "ERROR: glslangValidator not found (install vulkan-sdk)" && exit 1) | |
| @pkg-config --exists sdl2 || (echo "ERROR: SDL2 not found" && exit 1) | |
| @pkg-config --exists vulkan || (echo "ERROR: Vulkan not found" && exit 1) | |
| @echo "All dependencies found." | |
| # Print build info | |
| info: | |
| @echo "Compiler: $(CC)" | |
| @echo "CFLAGS: $(CFLAGS)" | |
| @echo "LDFLAGS: $(LDFLAGS)" | |
| @echo "Includes: $(INCLUDES)" | |
| @echo "Shaders: $(VERT_SPV) $(FRAG_SPV)" | |
| @echo "Target: $(TARGET)" | |