85 lines
1.7 KiB
Makefile
85 lines
1.7 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 -Iebcl/include \
|
|
-DREAL_BUILD -DGLM_ENABLE_EXPERIMENTAL
|
|
LIBS += $(shell sdl2-config --libs) -lGL -lGLEW -ldl \
|
|
$(LIBEBCL) -latomic
|
|
|
|
FILEDUMPS =
|
|
|
|
IMGUI = imgui.cpp imgui_draw.cpp
|
|
DEMO = \
|
|
main.cc \
|
|
imgui_impl_sdl.cc \
|
|
\
|
|
utilities.cc \
|
|
texture.cc \
|
|
rendertarget.cc \
|
|
uniforms.cc \
|
|
camera.cc \
|
|
\
|
|
filewatcher.cc \
|
|
window.cc \
|
|
globals.cc \
|
|
profiling.cc \
|
|
shaders.cc \
|
|
odbg.cc \
|
|
sync.cc \
|
|
control.cc \
|
|
\
|
|
demo.cc \
|
|
\
|
|
raymarcher.cc \
|
|
bloom.cc \
|
|
dof.cc \
|
|
combine.cc \
|
|
fxaa.cc
|
|
|
|
|
|
IMGUI_OBJS = $(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(IMGUI))))
|
|
DEMO_OBJS = $(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(DEMO))))
|
|
OBJS = $(IMGUI_OBJS) $(DEMO_OBJS)
|
|
LIBEBCL = $(OUTDIR)/ebcl/libebcorelib.a
|
|
PCH=externals.hh.gch
|
|
|
|
DEMO_DEPS = $(DEMO_OBJS:$(OUTDIR)/%.o=$(OUTDIR)/%.d)
|
|
|
|
demo: $(LIBEBCL) $(OBJS)
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o demo \
|
|
$(OBJS) $(LIBS)
|
|
|
|
clean:
|
|
rm -f $(OBJS) $(FILEDUMPS) demo $(PCH)
|
|
|
|
fullclean: clean
|
|
@+make -C ebcl fullclean CONFIG=../ebcl-config
|
|
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 $@ $<
|
|
|
|
$(LIBEBCL): ebcl-config
|
|
+make -C ebcl CONFIG=../ebcl-config
|
|
|
|
$(PCH): externals.hh
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|