71 lines
1.4 KiB
Makefile
71 lines
1.4 KiB
Makefile
OUTDIR = output
|
|
|
|
CXXFLAGS += $(shell sdl2-config --cflags) -std=c++14 -Wall -g
|
|
CFLAGS += $(shell sdl2-config --cflags)
|
|
CPPFLAGS += -I. -I$(OUTDIR) -Iimgui -Iglm \
|
|
-DREAL_BUILD -DGLM_ENABLE_EXPERIMENTAL
|
|
LIBS += $(shell sdl2-config --libs) -lGL -lGLEW -ldl
|
|
|
|
FILEDUMPS =
|
|
|
|
IMGUI = imgui.cpp imgui_draw.cpp
|
|
DEMO = \
|
|
main.cc \
|
|
imgui_impl_sdl.cc \
|
|
\
|
|
utilities.cc \
|
|
texture.cc \
|
|
rendertarget.cc \
|
|
programs.cc \
|
|
shaders.cc \
|
|
camera.cc \
|
|
demo.cc \
|
|
\
|
|
raymarcher.cc \
|
|
\
|
|
bloom.cc \
|
|
dof.cc \
|
|
combine.cc \
|
|
\
|
|
profiling.cc
|
|
|
|
|
|
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
|
|
|
|
DEMO_DEPS = $(DEMO_OBJS:$(OUTDIR)/%.o=$(OUTDIR)/%.d)
|
|
|
|
demo: $(OBJS)
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o demo \
|
|
$(OBJS) $(LIBS)
|
|
|
|
clean:
|
|
rm -f $(OBJS) $(FILEDUMPS) demo $(PCH)
|
|
|
|
fullclean: clean
|
|
rm -f $(DEMO_DEPS)
|
|
|
|
.PHONY: clean fullclean
|
|
|
|
|
|
$(FILEDUMPS): fd-%.h: %
|
|
xxd -i $< $@
|
|
|
|
|
|
outdir:
|
|
@if ! [ -d "$(OUTDIR)" ]; then mkdir "$(OUTDIR)"; fi
|
|
.PHONY: outdir
|
|
|
|
$(IMGUI_OBJS): $(OUTDIR)/%.o: imgui/%.cpp | outdir
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
|
|
|
-include $(DEMO_DEPS)
|
|
|
|
$(DEMO_OBJS): $(OUTDIR)/%.o: %.cc $(PCH) | outdir $(FILEDUMPS)
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -M -MF $(@:%.o=%.d) -MT $@ $<
|
|
|
|
$(PCH): externals.hh
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|