Files
snake2025/Makefile
2025-05-14 14:15:45 +02:00

35 lines
507 B
Makefile

# Compiler
CC = gcc
# Compiler flags
CFLAGS = -Wall -pedantic -ansi
# Linker flags
LDFLAGS = -lMLV
# Target executable
TARGET = game
# Source files
SRCS = game.c grid.c snake.c
# Object files
OBJS = $(SRCS:.c=.o)
# Default target
all: $(TARGET)
# Link the target executable
$(TARGET): $(OBJS)
$(CC) $(OBJS) -o $(TARGET) $(LDFLAGS)
# Compile source files to object files
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
# Clean up build files
clean:
rm -f $(OBJS) $(TARGET)
# Phony targets
.PHONY: all clean