Files
Sandbox/makefile
var d1530525ca Animation blending
- transition smoothly between idle and run animations
- use quaternions (versors) instead of yaw/pitch/roll
- hide mouse and enable free-look mode by default on startup
- rotate model 180 degrees in Blender so it faces away from the camera by default
- add some makefile commands
2026-05-03 14:38:57 -05:00

50 lines
960 B
Makefile
Executable File

INC = include
OBJ = obj
SRC = src
EXE = Game
REL = Release
CC = gcc
CFLAGS = -w -ggdb -I$(INC)
LIBS = -lGLEW -lGLU -lGL -lSDL2 -lcglm -lz -lm
RELFLAGS = -O3 -s
OBJFILES := $(patsubst $(SRC)/%.c, $(OBJ)/%.o, $(shell find $(SRC) -name '*.c'))
OBJDIRS := $(patsubst $(SRC)%, $(OBJ)%, $(shell find $(SRC) -type d))
CLEANDIRS := $(addsuffix /.clean, $(OBJDIRS));
# Explicit targets
.PHONY: all release clean rebuild run
.DEFAULT_GOAL := all
# Build executable
all: $(EXE)
$(EXE): $(OBJFILES) | $(OBJDIRS)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
# Compile object files
$(OBJ)/%.o: $(SRC)/%.c | $(OBJDIRS)
$(CC) -c -o $@ $(SRC)/$*.c $(CFLAGS)
# Create obj directory tree if it doesn't exist
$(OBJDIRS):
mkdir -p $@
release: $(REL)
$(REL): $(OBJFILES) | $(OBJDIRS)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) $(RELFLAGS)
# Delete previously built files
clean: $(CLEANDIRS)
rm -f $(EXE) $(REL)
%.clean:
rm -f $**.o
rebuild:
make clean
make all
run:
make all
./$(EXE)