-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (24 loc) · 767 Bytes
/
Makefile
File metadata and controls
36 lines (24 loc) · 767 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
CXX = g++
CXXFLAGS = -g -Wall -Wextra -std=c++17 -fPIC -Iinclude -Ilib -fopenmp -I C:\msys64\mingw64\include
SRCDIR = lib
OUTDIR = build
SOURCES = $(wildcard $(SRCDIR)/**/*.cpp)
OBJECTS = $(SOURCES:$(SRCDIR)/%.cpp=$(OUTDIR)/%.o)
TARGET = ItsAnotherEngine.dll
TEST_EXE = main.exe
all: $(TARGET)
#Linking
$(TARGET): $(OBJECTS)
$(CXX) -shared -o $@ $^ -L C:\msys64\mingw64\lib -lglfw3 -lopengl32 -fopenmp
#Compiling
$(OUTDIR)/%.o: $(SRCDIR)/%.cpp
$(shell if not exist "$(dir $@)" mkdir "$(dir $@)")
$(CXX) $(CXXFLAGS) -c $< -o $@
clean:
if exist $(OUTDIR) rd /s /q $(OUTDIR)
if exist $(TARGET) del $(TARGET)
if exist $(TEST_EXE) del $(TEST_EXE)
test: tests/main.cpp $(TARGET)
g++ -Iinclude -o $(TEST_EXE) $< -L. -lItsAnotherEngine
run: test
main.exe