-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (24 loc) · 850 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
32
CXX=g++
LIBS=gl sdl2 glew
LDLIBS=$(shell pkg-config --libs-only-l $(LIBS))
LDFLAGS=$(shell pkg-config --libs-only-L --libs-only-other $(LIBS))
CXXFLAGS=--std=c++11 -g -Wall -DGLM_FORCE_RADIANS $(shell pkg-config --cflags $(LIBS))
BUILDDIR=build
BINDIR=bin
OBJ=$(addprefix $(BUILDDIR)/, Main.o Camera.o Landscape.o BaseShaderProgram.o \
RenderShaderProgram.o RegistrablesContainer.o Clouds.o ComputeShaderProgram.o)
RM=rm -rf
MKDIR=mkdir
first: $(BINDIR)/ray-marching .clang_complete
$(BINDIR)/ray-marching: $(OBJ) | $(BINDIR)
$(CXX) $(LDFLAGS) $(CXXFLAGS) $(OBJ) $(LDLIBS) -o $@
$(BUILDDIR)/%.o: src/%.cpp | $(BUILDDIR)
$(CXX) -c $(CXXFLAGS) -o $@ $<
$(BUILDDIR):
$(MKDIR) $@
$(BINDIR):
$(MKDIR) $@
.clang_complete: Makefile
$(shell pkg-config --cflags $(LIBS) | tr ' ' '\n' > $@)
clean:
$(RM) $(BUILDDIR) $(BINDIR) .clang_complete