-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (31 loc) · 763 Bytes
/
Makefile
File metadata and controls
42 lines (31 loc) · 763 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
39
40
41
# Makefile for building the rotating_cube project
# Compiler
CXX = g++
# Common source files
SOURCES = rotating_cube.cpp
# Common compiler flags
CXXFLAGS = -std=c++11
# Target executable
TARGET = rotating_cube
# Platform-specific settings
ifeq ($(shell uname), Darwin)
# macOS settings
HOMEBREW_PREFIX = $(shell brew --prefix)
CXXFLAGS += -I$(HOMEBREW_PREFIX)/include/
LDFLAGS = -L$(HOMEBREW_PREFIX)/lib/ -lSDL2 -lGLEW -framework OpenGL
else
# Linux settings
LDFLAGS = -lSDL2 -lGLEW -lGL
endif
# Default target
all: $(TARGET)
# Build target
$(TARGET): $(SOURCES)
$(CXX) -o $(TARGET) $(SOURCES) $(CXXFLAGS) $(LDFLAGS)
# Clean target
clean:
rm -f $(TARGET)
# Run the executable
run: $(TARGET)
./$(TARGET)
.PHONY: all clean run