-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile-Linux
More file actions
43 lines (32 loc) · 1.05 KB
/
Makefile-Linux
File metadata and controls
43 lines (32 loc) · 1.05 KB
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
42
43
# Commands
RM := -rm
CC := /C/msys64/mingw64/bin/g++.exe
# Folders
SRCDIR := src
OBJDIR := obj
LIBDIR := lib
BINDIR := bin
# Files
# -lGL is for Unix, -lopengl32 for Windows
CSRC := $(wildcard $(SRCDIR)/*.c)
CPPSRC := $(wildcard $(SRCDIR)/*.cpp)
MAIN := $(wildcard $(SRCDIR)/main.*)
LIB := -lopengl32 -lm -lpthread -lglfw3 # $(wildcard $(LIBDIR)/*)
COBJ := $(CSRC:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
CPPOBJ := $(CPPSRC:$(SRCDIR)/%.cpp=$(OBJDIR)/%.opp)
TARGET := $(BINDIR)/main.exe
# Flags
CXXFLAGS := -Wall -O2 -std=c++17 -Iinclude
all: $(TARGET)
$(TARGET) : $(COBJ) $(CPPOBJ)
$(CC) -o $(TARGET) $(COBJ) $(CPPOBJ) $(LIB)
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(CC) $(CXXFLAGS) -c $< -o $@
$(OBJDIR)/%.opp: $(SRCDIR)/%.cpp
$(CC) $(CXXFLAGS) -c $< -o $@
clean:
$(RM) $(COBJ) $(CPPOBJ) $(TARGET)
# $(CC) -std=c++11 -Wall -Wno-unused-function -g -I ./include/ -o ./bin/Linux/main.exe src/tiny_obj_loader.cpp src/main.cpp src/glad.c src/textrendering.cpp -lopengl32 -lm -lpthread -lglfw3
.PHONY: clean run
run: ./bin/main.exe
cd bin && ./main.exe