Big initial commit: States, simulation, presentation, menus, some art.

This commit is contained in:
2025-12-10 23:12:19 +01:00
parent 0b0d920c84
commit 5a71d16d1f
49 changed files with 15852 additions and 0 deletions

60
Makefile Normal file
View File

@@ -0,0 +1,60 @@
CC := gcc
SRC_DIR := src
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Linux)
PLATFORM := linux
else ifeq ($(OS), Windows_NT)
PLATFORM := windows
else
PLATFORM := unknown
endif
BUILD_DIR := build/$(PLATFORM)
CFLAGS := -g -Isrc -Wextra -MMD -MP -Wall -pedantic
LDFLAGS := -flto -Wl,--gc-sections
LIB_DIR := $(abspath libs/$(PLATFORM))
CFLAGS += -I$(LIB_DIR)
LDFLAGS += -L$(LIB_DIR)
ifeq ($(PLATFORM), linux)
LIBS += -lraylib -lm -lraygui
endif
SRC := $(shell find -L $(SRC_DIR) -type f -name '*.c')
OBJ := $(patsubst $(SRC_DIR)/%.c,$(BUILD_DIR)/%.o,$(SRC))
DEP := $(OBJ:.o=.d)
ifeq ($(PLATFORM), windows)
BIN := $(BUILD_DIR)/main.exe
endif
ifeq ($(PLATFORM), linux)
BIN := $(BUILD_DIR)/main
endif
all: $(BIN)
run: $(BIN)
@cd $(BUILD_DIR) && ./$(notdir $(BIN))
$(BIN): $(OBJ)
@mkdir -p $(dir $@)
@cp -r $(SRC_DIR)/assets $(BUILD_DIR)
@cp -r libs $(BUILD_DIR)
@$(CC) $(LDFLAGS) $(OBJ) -o $@ $(LIBS)
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.c
@echo "Compiling $<..."
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
clean:
@rm -rf $(BUILD_DIR)
-include $(DEP)
.PHONY: all clean