-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (27 loc) · 878 Bytes
/
Copy pathMakefile
File metadata and controls
35 lines (27 loc) · 878 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
CC = gcc
SRCS = $(wildcard src/*.c)
OBJS = $(SRCS:.c=.o)
TARGET = sortviz
# Detecta o Sistema Operacional
UNAME_S := $(shell uname -s)
# --- Configuração para macOS ---
ifeq ($(UNAME_S), Darwin)
RAYLIB_PATH = /opt/homebrew
CFLAGS = -std=c11 -Wall -Wextra -O2 -I$(CURDIR)/include -I$(RAYLIB_PATH)/include
LDFLAGS = -L$(RAYLIB_PATH)/lib -lraylib -framework CoreVideo -framework IOKit -framework Cocoa -framework OpenGL
# --- Configuração para Linux ---
else
RAYLIB_PATH = /usr
CFLAGS = -std=c11 -Wall -Wextra -O2 -I$(CURDIR)/include -I$(RAYLIB_PATH)/include
LDFLAGS = -L$(RAYLIB_PATH)/lib -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
endif
.PHONY: all clean run
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(OBJS) -o $@ $(LDFLAGS)
src/%.o: src/%.c include/common.h
$(CC) $(CFLAGS) -c $< -o $@
run: all
./$(TARGET)
clean:
rm -f src/*.o $(TARGET)