includedir = @includedir@
libdir = @libdir@
datarootdir = @datarootdir@
-datadir = @datadir@
top_builddir = @top_builddir@
with_demo_app = @with_demo_app@
with_benchmark = @with_benchmark@
# Unit tests.
TESTS=effect_chain_test fp16_test $(TESTED_INPUTS:=_test) $(TESTED_EFFECTS:=_test)
-LIB_OBJS=effect_util.o util.o effect.o effect_chain.o init.o resource_pool.o ycbcr.o $(INPUTS:=.o) $(EFFECTS:=.o)
+LIB_OBJS=effect_util.o util.o effect.o effect_chain.o init.o resource_pool.o ycbcr.o bundled_shaders.o $(INPUTS:=.o) $(EFFECTS:=.o)
# Default target:
all: libmovit.la $(TESTS)
$(TESTS): %: %.o $(TEST_OBJS) libmovit.la
$(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -o $@ $^ $(TEST_LDLIBS)
-OWN_OBJS=$(DEMO_OBJS) $(LIB_OBJS) $(OWN_TEST_OBJS) $(TESTS:=.o)
-OBJS=$(DEMO_OBJS) $(LIB_OBJS) $(TEST_OBJS) $(TESTS:=.o)
+OWN_OBJS=$(DEMO_OBJS) $(LIB_OBJS) $(OWN_TEST_OBJS) $(TESTS:=.o) make_bundled_shaders.o
+OBJS=$(DEMO_OBJS) $(LIB_OBJS) $(TEST_OBJS) $(TESTS:=.o) make_bundled_shaders.o
# A small demo program.
demo: libmovit.la $(DEMO_OBJS)
clean:
$(LIBTOOL) --mode=clean $(RM) demo $(TESTS) libmovit.la $(OBJS) $(OBJS:.o=.lo)
- $(RM) $(OBJS:.o=.gcno) $(OBJS:.o=.gcda) $(DEPS) step*.dot chain*.frag
+ $(LIBTOOL) --mode=clean $(RM) $(MAKE_BUNDLE_OBJS) $(MAKE_BUNDLE_OBJS:.o=.lo) make_bundled_shaders bundled_shaders.cpp
+ $(RM) $(OBJS:.o=.gcno) $(OBJS:.o=.gcda) $(MAKE_BUNDLE_OBJS:.o=.gcno) $(MAKE_BUNDLE_OBJS:.o=.gcda) $(DEPS) step*.dot chain*.frag
$(RM) -r movit.info coverage/ .libs/
distclean: clean
MISSING_SHADERS += fft_convolution_effect.frag fft_input.frag
SHADERS := $(filter-out $(MISSING_SHADERS),$(SHADERS))
+# A program to compile all the shaders into one bundle that we can link into the library.
+MAKE_BUNDLE_OBJS=make_bundled_shaders.o util.o init.o resource_pool.o
+make_bundled_shaders: $(MAKE_BUNDLE_OBJS)
+ $(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -o make_bundled_shaders $(MAKE_BUNDLE_OBJS) -lepoxy
+bundled_shaders.cpp: make_bundled_shaders $(SHADERS)
+ ./make_bundled_shaders $(SHADERS) > $@
+
install: libmovit.la
$(MKDIR) -p $(DESTDIR)$(libdir)/
$(LIBTOOL) --mode=install $(INSTALL) -m 0644 libmovit.la $(DESTDIR)$(libdir)/
$(MKDIR) -p $(DESTDIR)$(includedir)/movit/
$(INSTALL) -m 0644 $(HDRS) $(DESTDIR)$(includedir)/movit/
- $(MKDIR) -p $(DESTDIR)$(datadir)/movit/
- $(INSTALL) -m 0644 $(SHADERS) $(DESTDIR)$(datadir)/movit/
$(MKDIR) -p $(DESTDIR)$(libdir)/pkgconfig/
$(INSTALL) -m 644 movit.pc $(DESTDIR)$(libdir)/pkgconfig/
DISTDIR=movit-$(movit_version)
-OTHER_DIST_FILES=add.frag autogen.sh blue.frag configure.ac d65.h identity.frag invert_effect.frag Makefile.in mipmap_needing_effect.frag downscale2x.frag downscale2x.comp mirror.comp identity.comp movit.pc.in README NEWS test_util.h widgets.h
+OTHER_DIST_FILES=add.frag autogen.sh blue.frag configure.ac d65.h identity.frag invert_effect.frag Makefile.in mipmap_needing_effect.frag downscale2x.frag downscale2x.comp mirror.comp identity.comp movit.pc.in README NEWS test_util.h widgets.h bundled_shaders.h
dist:
$(MKDIR) $(DISTDIR)