2017-11-22 08:53:31 +01:00
|
|
|
OUTDIR = build
|
2017-10-02 10:00:39 +02:00
|
|
|
|
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-31 09:22:38 +01:00
|
|
|
CPPFLAGS += -I. -I$(OUTDIR) \
|
2017-11-22 08:59:06 +01:00
|
|
|
-I3rdparty/imgui -I3rdparty/glm \
|
|
|
|
-I3rdparty/icon-font-headers \
|
|
|
|
-I3rdparty/ebcl/include \
|
2017-09-30 10:26:30 +02:00
|
|
|
-DREAL_BUILD -DGLM_ENABLE_EXPERIMENTAL
|
2017-11-24 10:08:41 +01:00
|
|
|
|
|
|
|
BUILDER_LIBS = $(LIBEBCL) -latomic
|
|
|
|
TOOL_LIBS = $(shell sdl2-config --libs) -lGL -lGLEW -ldl $(BUILDER_LIBS)
|
|
|
|
|
2017-09-30 10:26:30 +02:00
|
|
|
|
2017-11-24 13:46:43 +01:00
|
|
|
BUILTIN_SHADERS = \
|
|
|
|
copy \
|
|
|
|
dbg-alpha \
|
|
|
|
dbg-depth-linear \
|
|
|
|
dbg-depth-reinhard \
|
|
|
|
dbg-reinhard \
|
|
|
|
fullscreen \
|
|
|
|
# END BUILTIN_SHADERS
|
2017-09-30 10:26:30 +02:00
|
|
|
|
2017-10-02 10:00:39 +02:00
|
|
|
IMGUI = imgui.cpp imgui_draw.cpp
|
2017-11-06 10:33:18 +01:00
|
|
|
|
|
|
|
COMMON = \
|
2017-11-23 23:05:14 +01:00
|
|
|
common.cc \
|
2017-12-02 18:38:34 +01:00
|
|
|
c-buildcfg.cc \
|
2017-11-24 07:28:17 +01:00
|
|
|
c-camera.cc \
|
2017-11-23 23:05:14 +01:00
|
|
|
c-filewatcher.cc \
|
2017-11-24 14:13:39 +01:00
|
|
|
c-project.cc \
|
2017-11-24 16:44:18 +01:00
|
|
|
c-shaders.cc \
|
2017-11-23 23:31:24 +01:00
|
|
|
c-utilities.cc \
|
2017-11-23 23:37:52 +01:00
|
|
|
c-undo.cc \
|
2017-11-23 23:31:24 +01:00
|
|
|
\
|
|
|
|
c-ops.cc \
|
|
|
|
c-opast.cc \
|
2017-12-01 07:30:03 +01:00
|
|
|
c-opopt.cc \
|
2017-11-23 23:31:24 +01:00
|
|
|
c-opparser.cc \
|
|
|
|
c-opcomp.cc \
|
|
|
|
c-opmgr.cc \
|
2017-11-23 23:05:14 +01:00
|
|
|
\
|
2017-11-23 23:37:52 +01:00
|
|
|
c-sync.cc \
|
|
|
|
c-syncedit.cc \
|
|
|
|
c-syncoverrides.cc \
|
2017-12-26 12:00:41 +01:00
|
|
|
\
|
|
|
|
p-filesystem.cc \
|
2017-11-24 09:52:47 +01:00
|
|
|
# END COMMON
|
|
|
|
|
2017-11-24 10:08:41 +01:00
|
|
|
TOOL = \
|
|
|
|
m-tool.cc \
|
2017-11-23 22:44:20 +01:00
|
|
|
ui.cc \
|
2017-11-23 14:47:25 +01:00
|
|
|
ui-actions.cc \
|
2017-11-23 23:31:24 +01:00
|
|
|
ui-app.cc \
|
2017-11-23 14:47:25 +01:00
|
|
|
ui-colorgrading.cc \
|
2017-11-24 09:51:05 +01:00
|
|
|
ui-demo.cc \
|
2017-11-23 14:47:25 +01:00
|
|
|
ui-dialogs.cc \
|
|
|
|
ui-imgui-sdl.cc \
|
2017-11-23 23:31:24 +01:00
|
|
|
ui-odbg.cc \
|
2017-11-24 07:28:17 +01:00
|
|
|
ui-opemu.cc \
|
2017-11-23 22:44:20 +01:00
|
|
|
ui-overrides.cc \
|
2017-11-23 23:31:24 +01:00
|
|
|
ui-profiling.cc \
|
|
|
|
ui-rendertarget.cc \
|
2017-11-23 22:44:20 +01:00
|
|
|
ui-sequencer.cc \
|
2017-11-23 23:31:24 +01:00
|
|
|
ui-shaders.cc \
|
2017-11-23 22:44:20 +01:00
|
|
|
ui-sync.cc \
|
2017-11-23 23:31:24 +01:00
|
|
|
ui-texture.cc \
|
2017-11-23 14:47:25 +01:00
|
|
|
ui-utilities.cc \
|
2017-11-24 10:08:41 +01:00
|
|
|
# END TOOL
|
2017-11-06 10:33:18 +01:00
|
|
|
|
2017-11-24 10:08:41 +01:00
|
|
|
BUILDER = \
|
|
|
|
m-builder.cc \
|
|
|
|
# END BUILDER
|
2017-10-02 10:00:39 +02:00
|
|
|
|
2017-09-30 10:26:30 +02:00
|
|
|
|
2017-11-24 13:46:43 +01:00
|
|
|
BUILTIN_SHADERS_SRC = $(addprefix toolshaders/, $(addsuffix .glsl, $(BUILTIN_SHADERS)))
|
|
|
|
BUILTIN_SHADERS_H = $(addprefix $(OUTDIR)/bs-, $(addsuffix .inl, $(BUILTIN_SHADERS)))
|
|
|
|
|
2017-10-02 10:00:39 +02:00
|
|
|
IMGUI_OBJS = $(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(IMGUI))))
|
2017-11-06 10:33:18 +01:00
|
|
|
COMMON_OBJS = $(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(COMMON))))
|
2017-11-24 10:08:41 +01:00
|
|
|
TOOL_OBJS = $(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(TOOL))))
|
|
|
|
BUILDER_OBJS = $(addprefix $(OUTDIR)/, $(addsuffix .o, $(basename $(BUILDER))))
|
2017-11-04 09:17:31 +01:00
|
|
|
LIBEBCL = $(OUTDIR)/ebcl/libebcorelib.a
|
2017-10-02 10:00:39 +02:00
|
|
|
PCH=externals.hh.gch
|
2017-09-30 10:26:30 +02:00
|
|
|
|
2017-11-06 10:33:18 +01:00
|
|
|
COMMON_DEPS = $(COMMON_OBJS:$(OUTDIR)/%.o=$(OUTDIR)/%.d)
|
2017-11-24 10:08:41 +01:00
|
|
|
DEMO_DEPS = $(TOOL_OBJS:$(OUTDIR)/%.o=$(OUTDIR)/%.d)
|
|
|
|
BUILDER_DEPS = $(BUILDER_OBJS:$(OUTDIR)/%.o=$(OUTDIR)/%.d)
|
2017-09-30 10:26:30 +02:00
|
|
|
|
2017-11-24 10:08:41 +01:00
|
|
|
COMMON_REQ = $(COMMON_OBJS)
|
2017-11-06 10:33:18 +01:00
|
|
|
|
2017-11-24 10:08:41 +01:00
|
|
|
DEMO_BUILD = $(TOOL_OBJS) $(COMMON_REQ) $(IMGUI_OBJS)
|
|
|
|
BUILDER_BUILD = $(BUILDER_OBJS) $(COMMON_REQ)
|
2017-11-06 10:33:18 +01:00
|
|
|
|
2017-11-24 10:08:41 +01:00
|
|
|
ALL_OBJS = $(TOOL_OBJS) $(BUILDER_OBJS) $(COMMON_REQ)
|
|
|
|
ALL_DEPS = $(COMMON_DEPS) $(DEMO_DEPS) $(BUILDER_DEPS)
|
2017-11-06 10:33:18 +01:00
|
|
|
|
|
|
|
|
2017-11-24 10:08:41 +01:00
|
|
|
all: tourista tourista-builder
|
2017-11-06 10:33:18 +01:00
|
|
|
|
2017-11-24 10:08:41 +01:00
|
|
|
tourista: $(LIBEBCL) $(DEMO_BUILD)
|
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o tourista \
|
|
|
|
$(DEMO_BUILD) $(TOOL_LIBS)
|
2017-11-06 10:33:18 +01:00
|
|
|
|
2017-11-24 10:08:41 +01:00
|
|
|
tourista-builder: $(LIBEBCL) $(BUILDER_BUILD)
|
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o tourista-builder \
|
|
|
|
$(BUILDER_BUILD) $(BUILDER_LIBS)
|
2017-09-30 10:26:30 +02:00
|
|
|
|
|
|
|
clean:
|
2017-11-24 13:46:43 +01:00
|
|
|
rm -f $(ALL_OBJS) $(BUILTIN_SHADERS_H) tourista tourista-builder $(PCH) $(OUTDIR)/font-awesome.inl
|
2017-09-30 10:26:30 +02:00
|
|
|
|
2017-11-23 14:15:17 +01:00
|
|
|
depclean: clean
|
|
|
|
rm -f $(ALL_DEPS)
|
|
|
|
|
|
|
|
fullclean: depclean
|
2017-11-22 20:35:05 +01:00
|
|
|
@+make -C 3rdparty/ebcl fullclean CONFIG=../../ebcl-config
|
2017-11-23 14:15:17 +01:00
|
|
|
rm -f $(OUTDIR)/font-to-c
|
2017-09-30 10:26:30 +02:00
|
|
|
|
2017-11-06 10:33:18 +01:00
|
|
|
.PHONY: all clean fullclean
|
2017-09-30 10:26:30 +02:00
|
|
|
|
|
|
|
|
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-11-06 10:33:18 +01:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
|
2017-11-22 08:59:06 +01:00
|
|
|
$(IMGUI_OBJS): $(OUTDIR)/%.o: 3rdparty/imgui/%.cpp | outdir
|
2017-09-30 10:26:30 +02:00
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
|
|
|
|
2017-11-06 10:33:18 +01:00
|
|
|
#-------------------------------------------------------------------------------
|
2017-09-30 10:26:30 +02:00
|
|
|
|
2017-11-06 10:33:18 +01:00
|
|
|
-include $(DEMO_DEPS)
|
2017-11-24 13:46:43 +01:00
|
|
|
$(TOOL_OBJS): $(OUTDIR)/%.o: %.cc $(PCH) | outdir $(BUILTIN_SHADERS_H)
|
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-11-06 10:33:18 +01:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
-include $(COMMON_DEPS)
|
2017-11-24 13:46:43 +01:00
|
|
|
$(COMMON_OBJS): $(OUTDIR)/%.o: %.cc $(PCH) | outdir
|
2017-11-06 10:33:18 +01:00
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -M -MF $(@:%.o=%.d) -MT $@ $<
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
|
2017-11-24 10:08:41 +01:00
|
|
|
-include $(BUILDER_DEPS)
|
2017-11-24 13:46:43 +01:00
|
|
|
$(BUILDER_OBJS): $(OUTDIR)/%.o: %.cc $(PCH) | outdir
|
2017-11-06 10:33:18 +01:00
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
|
|
|
|
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -M -MF $(@:%.o=%.d) -MT $@ $<
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
|
2017-11-01 23:34:31 +01:00
|
|
|
$(LIBEBCL): ebcl-config
|
2017-11-22 08:59:06 +01:00
|
|
|
+make -C 3rdparty/ebcl CONFIG=../../ebcl-config
|
2017-11-01 23:34:31 +01: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 $@ $<
|
2017-11-21 17:32:52 +01:00
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
|
2017-11-24 13:46:43 +01:00
|
|
|
$(BUILTIN_SHADERS_H): $(OUTDIR)/bs-%.inl: toolshaders/%.glsl | outdir
|
|
|
|
xxd -i < $< > $@
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
|
2017-11-23 22:51:50 +01:00
|
|
|
$(OUTDIR)/ui-app.o: ui-app.cc $(OUTDIR)/font-awesome.inl
|
2017-11-21 17:32:52 +01:00
|
|
|
|
2017-11-22 08:59:06 +01:00
|
|
|
$(OUTDIR)/font-awesome.inl: 3rdparty/font-awesome/fonts/fontawesome-webfont.ttf $(OUTDIR)/font-to-c
|
|
|
|
$(OUTDIR)/font-to-c -base85 3rdparty/font-awesome/fonts/fontawesome-webfont.ttf \
|
2017-11-21 17:32:52 +01:00
|
|
|
FontAwesome_ >$@
|
|
|
|
|
2017-11-22 08:59:06 +01:00
|
|
|
$(OUTDIR)/font-to-c: 3rdparty/imgui/extra_fonts/binary_to_compressed_c.cpp
|
2017-11-21 17:32:52 +01:00
|
|
|
$(CXX) -o $@ $<
|