-
Notifications
You must be signed in to change notification settings - Fork 34
/
Makefile
31 lines (22 loc) · 664 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
CC = gcc
CFLAGS = -Wall -std=c99 -O2
LDFLAGS = -lpthread -lglfw -lGLEW -framework Cocoa -framework OpenGL -framework IOKit
# Path to the glfw and glew libraries
LIB_DIR = src/dependencies/library
# Path to the include directories of glfw and glew
INCLUDE_DIR = src/dependencies/include
# Name of the output executable
OUTPUT = app
# Source files and object files
SRC_DIR = src
SRC = $(wildcard $(SRC_DIR)/*.c)
OBJ = $(SRC:.c=.o)
all: $(OUTPUT)
$(OUTPUT): $(OBJ)
$(CC) $(CFLAGS) -o $@ $^ -L $(LIB_DIR) $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $< -I $(INCLUDE_DIR)
debug: CFLAGS += -DDEBUG -O0 -g
debug: clean $(OUTPUT)
clean:
rm -f $(OBJ) $(OUTPUT)