-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (29 loc) · 823 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
CC = gcc
CFLAGS = -Wall -Wextra -std=c11 -O2
# raylib directory (adjust this to your setup)
RAYLIB_DIR = /opt/homebrew/Cellar/raylib/5.0
INCLUDES = -I$(RAYLIB_DIR)/include
LIBS = -L$(RAYLIB_DIR)/lib -lraylib -lm -lpthread -ldl -framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo
# Source files
SRCS = src/snake.c src/drawGrid.c
SRCS = src/snake.c src/linkedList.c
# Object files
OBJS = $(SRCS:.c=.o)
# Output executable
TARGET = snake_game
# Default target
all: $(TARGET)
# Link object files to create the final executable
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
# Compile source files
%.o: %.c
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
# Clean up build files
clean:
rm -f $(TARGET) $(OBJS)
# Run the executable
run: $(TARGET)
./$(TARGET)
# Phony targets
.PHONY: all clean run