]> git.sesse.net Git - movit/commitdiff
Split the test program from the actual library.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 11 Oct 2012 17:05:04 +0000 (19:05 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 11 Oct 2012 17:05:04 +0000 (19:05 +0200)
.gitignore
Makefile

index e3c7f0180ebbc15f68e0d34500499c7ff5a530db..0b4a5ba18215529354dff091c7253bf50938eb73 100644 (file)
@@ -1,4 +1,5 @@
 *.o
+*.a
 *.d
 test
 *.jpg
index 301aa2fe297b7561e6d61bcad6e64bee09ceb636..ff768438c45a9366724837b1516b73fc1e209f78 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,34 +2,45 @@ CC=gcc
 CXX=g++
 CXXFLAGS=-Wall -g $(shell pkg-config --cflags eigen3 )
 LDFLAGS=-lSDL -lSDL_image -lGL -lrt
+RANLIB=ranlib
+
+TEST_OBJS=main.o
 
 # Core.
-OBJS=main.o util.o widgets.o effect.o effect_chain.o
+LIB_OBJS=util.o widgets.o effect.o effect_chain.o
 
 # Inputs.
-OBJS += flat_input.o
-OBJS += ycbcr_input.o
+LIB_OBJS += flat_input.o
+LIB_OBJS += ycbcr_input.o
 
 # Effects.
-OBJS += lift_gamma_gain_effect.o
-OBJS += white_balance_effect.o
-OBJS += gamma_expansion_effect.o
-OBJS += gamma_compression_effect.o
-OBJS += colorspace_conversion_effect.o
-OBJS += saturation_effect.o
-OBJS += vignette_effect.o
-OBJS += mirror_effect.o
-OBJS += blur_effect.o
-OBJS += diffusion_effect.o
-OBJS += glow_effect.o
-OBJS += unsharp_mask_effect.o
-OBJS += mix_effect.o
-OBJS += resize_effect.o
-OBJS += deconvolution_sharpen_effect.o
-OBJS += sandbox_effect.o
-
-test: $(OBJS)
-       $(CXX) -o test $(OBJS) $(LDFLAGS)
+LIB_OBJS += lift_gamma_gain_effect.o
+LIB_OBJS += white_balance_effect.o
+LIB_OBJS += gamma_expansion_effect.o
+LIB_OBJS += gamma_compression_effect.o
+LIB_OBJS += colorspace_conversion_effect.o
+LIB_OBJS += saturation_effect.o
+LIB_OBJS += vignette_effect.o
+LIB_OBJS += mirror_effect.o
+LIB_OBJS += blur_effect.o
+LIB_OBJS += diffusion_effect.o
+LIB_OBJS += glow_effect.o
+LIB_OBJS += unsharp_mask_effect.o
+LIB_OBJS += mix_effect.o
+LIB_OBJS += resize_effect.o
+LIB_OBJS += deconvolution_sharpen_effect.o
+LIB_OBJS += sandbox_effect.o
+
+OBJS=$(TEST_OBJS) $(LIB_OBJS)
+
+# A small test program (not a unit test).
+test: libmovit.a $(TEST_OBJS)
+       $(CXX) -o test $(TEST_OBJS) libmovit.a $(LDFLAGS)
+
+# The library itself.
+libmovit.a: $(LIB_OBJS)
+       $(AR) rc $@ $(LIB_OBJS)
+       $(RANLIB) $@
 
 %.o: %.cpp
        $(CXX) -MMD $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
@@ -38,6 +49,6 @@ DEPS=$(OBJS:.o=.d)
 -include $(DEPS)
 
 clean:
-       $(RM) test $(OBJS) $(DEPS)
+       $(RM) test libmovit.a $(OBJS) $(DEPS)
 
 .PHONY: clean