2017-09-30 10:26:30 +02:00
|
|
|
CXXFLAGS += $(shell sdl2-config --cflags) -std=c++14 -Wall
|
|
|
|
CFLAGS += $(shell sdl2-config --cflags)
|
2017-09-30 10:37:45 +02:00
|
|
|
CPPFLAGS += -I. -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 10:46:01 +02:00
|
|
|
FILEDUMPS = \
|
|
|
|
fd-raymarch-header.glsl.h \
|
|
|
|
fd-raymarcher.glsl.h
|
2017-09-30 10:26:30 +02:00
|
|
|
|
2017-09-30 10:37:45 +02:00
|
|
|
IMGUI = imgui.o imgui_demo.o imgui_draw.o
|
|
|
|
DEMO = \
|
|
|
|
main.o \
|
2017-09-30 10:26:30 +02:00
|
|
|
imgui_impl_sdl.o \
|
2017-09-30 10:37:45 +02:00
|
|
|
utilities.o
|
2017-09-30 10:26:30 +02:00
|
|
|
|
2017-09-30 10:37:45 +02:00
|
|
|
DEMO_DEPS = $(DEMO:%.o=.%.d)
|
2017-09-30 10:26:30 +02:00
|
|
|
|
|
|
|
|
2017-09-30 10:37:45 +02:00
|
|
|
demo: $(DEMO) $(IMGUI)
|
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o demo \
|
|
|
|
$(DEMO) $(IMGUI) $(LIBS)
|
2017-09-30 10:26:30 +02:00
|
|
|
|
|
|
|
clean:
|
2017-09-30 10:37:45 +02:00
|
|
|
rm -f $(IMGUI) $(DEMO) $(FILEDUMPS) demo externals.hh.gch
|
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 $< $@
|
|
|
|
|
|
|
|
|
|
|
|
imgui.o: imgui/imgui.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
imgui_demo.o: imgui/imgui_demo.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
imgui_draw.o: imgui/imgui_draw.cpp
|
|
|
|
$(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-09-30 10:37:45 +02:00
|
|
|
$(DEMO): %.o: %.cc externals.hh.gch | $(FILEDUMPS)
|
2017-09-30 10:26:30 +02:00
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -M -MF $(@:%.o=.%.d) -MT $@ $<
|
|
|
|
|
|
|
|
externals.hh.gch: externals.hh
|
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|