-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
40 lines (33 loc) · 914 Bytes
/
makefile
File metadata and controls
40 lines (33 loc) · 914 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
# -----------------------
# ZeroGPU Makefile (Cross-platform: Windows / Linux)
# -----------------------
CXX = g++
CXXFLAGS = -O2 -std=c++17
TARGET = ZeroGPU.exe
SRCS = ZeroGPU.cpp
# Base directory = folder where this makefile lives
BASE_DIR := $(CURDIR)
INCLUDE_DIR := $(BASE_DIR)/src/include
LIB_DIR := $(BASE_DIR)/src/lib
# Detect OS
ifeq ($(OS),Windows_NT)
# Windows (MinGW)
CXXFLAGS += -I"$(INCLUDE_DIR)"
LDFLAGS = -L"$(LIB_DIR)" -lmingw32 -lSDL2main -lSDL2
RM = del
else
# Linux / macOS
CXXFLAGS += $(shell sdl2-config --cflags)
LDFLAGS = $(shell sdl2-config --libs)
TARGET = ZeroGPU
RM = rm -f
endif
all: $(TARGET)
$(TARGET): $(SRCS)
$(CXX) $(CXXFLAGS) $(SRCS) -o $(TARGET) $(LDFLAGS)
info:
@echo "Compiler flags: $(CXXFLAGS)"
@echo "Linker flags: $(LDFLAGS)"
@echo "Target: $(TARGET)"
clean:
$(RM) $(TARGET)