# Variables CC = gcc CFLAGS = -Wall -Wextra -std=c11 -I/usr/local/include/SDL2 LDFLAGS = -L/usr/local/lib -lSDL2 SRC_DIR = src SOURCES = $(wildcard $(SRC_DIR)/*.c) OBJECTS = $(SOURCES:$(SRC_DIR)/%.c=%.o) TARGET = bsx # Default target all: $(TARGET) # Linking $(TARGET): $(OBJECTS) $(CC) $(LDFLAGS) -o $@ $^ # Compiling %.o: $(SRC_DIR)/%.c $(CC) $(CFLAGS) -c -o $@ $< # Clean up clean: rm -f $(OBJECTS) $(TARGET) # Phony targets .PHONY: all clean