2017-10-02 10:00:39 +02:00
|
|
|
OUTDIR = output
|
|
|
|
|
2017-09-30 21:22:38 +02:00
|
|
|
CXXFLAGS += $(shell sdl2-config --cflags) -std=c++14 -Wall -g
|
2017-09-30 10:26:30 +02:00
|
|
|
CFLAGS += $(shell sdl2-config --cflags)
|
2017-10-02 10:00:39 +02:00
|
|
|
CPPFLAGS += -I. -I$(OUTDIR) -Iimgui -Iglm \
|
2017-09-30 10:26:30 +02:00
|
|
|
-DREAL_BUILD -DGLM_ENABLE_EXPERIMENTAL
|
|
|
|
LIBS += $(shell sdl2-config --libs) -lGL -lGLEW -ldl
|
|
|
|
|
2017-09-30 11:23:14 +02:00
|
|
|
FILEDUMPS =
|
2017-09-30 10:26:30 +02:00
|
|
|
|
2017-10-02 10:00:39 +02:00
|
|
|
IMGUI = imgui.cpp imgui_draw.cpp
|
2017-09-30 10:37:45 +02:00
|
|
|
DEMO = \
|
2017-10-02 10:00:39 +02:00
|
|
|
main.cc \
|
|
|
|
imgui_impl_sdl.cc \
|
2017-10-01 19:40:38 +02:00
|
|
|
\
|
2017-10-04 11:20:27 +02:00
|
|
|
filewatcher.cc \
|
|
|
|
window.cc \
|
2017-10-02 10:00:39 +02:00
|
|
|
utilities.cc \
|
|
|
|
texture.cc \
|
|
|
|
rendertarget.cc \
|
2017-10-03 13:53:50 +02:00
|
|
|
shaders.cc \
|
2017-10-02 10:12:27 +02:00
|
|
|
camera.cc \
|
2017-10-02 13:51:08 +02:00
|
|
|
demo.cc \
|
2017-10-04 11:20:27 +02:00
|
|
|
globals.cc \
|
2017-10-01 19:40:38 +02:00
|
|
|
\
|
2017-10-02 10:00:39 +02:00
|
|
|
raymarcher.cc \
|
2017-10-01 19:40:38 +02:00
|
|
|
\
|
2017-10-02 10:00:39 +02:00
|
|
|
bloom.cc \
|
|
|
|
dof.cc \
|
|
|
|
combine.cc \
|
2017-10-01 19:40:38 +02:00
|
|
|
\
|
2017-10-02 10:00:39 +02:00
|
|
|
profiling.cc
|
|
|
|
|
2017-09-30 10:26:30 +02:00
|
|
|
|
2017-10-02 10:00:39 +02:00
|
|
|
IMGUI_OBJS = $(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(IMGUI))))
|
|
|
|
DEMO_OBJS = $(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(DEMO))))
|
|
|
|
OBJS = $(IMGUI_OBJS) $(DEMO_OBJS)
|
|
|
|
PCH=externals.hh.gch
|
2017-09-30 10:26:30 +02:00
|
|
|
|
2017-10-02 10:00:39 +02:00
|
|
|
DEMO_DEPS = $(DEMO_OBJS:$(OUTDIR)/%.o=$(OUTDIR)/%.d)
|
2017-09-30 10:26:30 +02:00
|
|
|
|
2017-10-02 10:00:39 +02:00
|
|
|
demo: $(OBJS)
|
2017-09-30 10:37:45 +02:00
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o demo \
|
2017-10-02 10:00:39 +02:00
|
|
|
$(OBJS) $(LIBS)
|
2017-09-30 10:26:30 +02:00
|
|
|
|
|
|
|
clean:
|
2017-10-02 10:00:39 +02:00
|
|
|
rm -f $(OBJS) $(FILEDUMPS) demo $(PCH)
|
2017-09-30 10:26:30 +02:00
|
|
|
|
|
|
|
fullclean: clean
|
2017-09-30 10:37:45 +02:00
|
|
|
rm -f $(DEMO_DEPS)
|
2017-09-30 10:26:30 +02:00
|
|
|
|
|
|
|
.PHONY: clean fullclean
|
|
|
|
|
|
|
|
|
|
|
|
$(FILEDUMPS): fd-%.h: %
|
|
|
|
xxd -i $< $@
|
|
|
|
|
|
|
|
|
2017-10-02 10:00:39 +02:00
|
|
|
outdir:
|
|
|
|
@if ! [ -d "$(OUTDIR)" ]; then mkdir "$(OUTDIR)"; fi
|
|
|
|
.PHONY: outdir
|
2017-09-30 10:26:30 +02:00
|
|
|
|
2017-10-02 10:00:39 +02:00
|
|
|
$(IMGUI_OBJS): $(OUTDIR)/%.o: imgui/%.cpp | outdir
|
2017-09-30 10:26:30 +02:00
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
|
|
|
|
2017-09-30 10:37:45 +02:00
|
|
|
-include $(DEMO_DEPS)
|
2017-09-30 10:26:30 +02:00
|
|
|
|
2017-10-02 10:00:39 +02:00
|
|
|
$(DEMO_OBJS): $(OUTDIR)/%.o: %.cc $(PCH) | outdir $(FILEDUMPS)
|
2017-09-30 10:26:30 +02:00
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
2017-10-02 10:00:39 +02:00
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -M -MF $(@:%.o=%.d) -MT $@ $<
|
2017-09-30 10:26:30 +02:00
|
|
|
|
2017-10-02 10:00:39 +02:00
|
|
|
$(PCH): externals.hh
|
2017-09-30 10:26:30 +02:00
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|