forked from Sour1emon/sand_game
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (29 loc) · 702 Bytes
/
Makefile
File metadata and controls
39 lines (29 loc) · 702 Bytes
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
# Compiler
CC = gcc
# Project files
SRCS = src/main.c src/block.c src/rng.c src/utils.c
OBJ = $(SRCS:.c=.o)
EXEC = main
# Raylib paths
RAYLIB_INC = /opt/homebrew/include
RAYLIB_LIB = /opt/homebrew/lib
# Compilation flags
CFLAGS = -I$(RAYLIB_INC) -Wall -Wextra -std=c99
LDFLAGS = -L$(RAYLIB_LIB) -lraylib -lm -lpthread -ldl \
-framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo
# Default target
all: $(EXEC)
# Compile program
$(EXEC): $(OBJ)
$(CC) $(OBJ) -o $@ $(LDFLAGS)
# Compile object files
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
# Clean
clean:
rm -f $(OBJ) $(EXEC)
# Run program
run: $(EXEC)
./$(EXEC)
check_macros:
$(CC) -E src/block.h > preprocessed.c