54 lines
1.1 KiB
Makefile
54 lines
1.1 KiB
Makefile
CXXFLAGS += $(shell sdl2-config --cflags) -std=c++14 -Wall -g
|
|
CFLAGS += $(shell sdl2-config --cflags)
|
|
CPPFLAGS += -I. -Iimgui -Iglm \
|
|
-DREAL_BUILD -DGLM_ENABLE_EXPERIMENTAL
|
|
LIBS += $(shell sdl2-config --libs) -lGL -lGLEW -ldl
|
|
|
|
FILEDUMPS =
|
|
|
|
IMGUI = imgui.o imgui_demo.o imgui_draw.o
|
|
DEMO = \
|
|
main.o \
|
|
imgui_impl_sdl.o \
|
|
utilities.o \
|
|
texture.o \
|
|
rendertarget.o \
|
|
bloom.o
|
|
|
|
DEMO_DEPS = $(DEMO:%.o=.%.d)
|
|
|
|
|
|
demo: $(DEMO) $(IMGUI)
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o demo \
|
|
$(DEMO) $(IMGUI) $(LIBS)
|
|
|
|
clean:
|
|
rm -f $(IMGUI) $(DEMO) $(FILEDUMPS) demo externals.hh.gch
|
|
|
|
fullclean: clean
|
|
rm -f $(DEMO_DEPS)
|
|
|
|
.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 $@ $<
|
|
|
|
-include $(DEMO_DEPS)
|
|
|
|
$(DEMO): %.o: %.cc externals.hh.gch | $(FILEDUMPS)
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -M -MF $(@:%.o=.%.d) -MT $@ $<
|
|
|
|
externals.hh.gch: externals.hh
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|