]> git.sesse.net Git - movit/blobdiff - Makefile
Split the test program from the actual library.
[movit] / Makefile
index b8b0f37a41b754099ad1c99327127bd048b84a13..ff768438c45a9366724837b1516b73fc1e209f78 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,54 @@
 CC=gcc
 CXX=g++
-CXXFLAGS=-Wall
-LDFLAGS=-lSDL -lSDL_image -lGL
+CXXFLAGS=-Wall -g $(shell pkg-config --cflags eigen3 )
+LDFLAGS=-lSDL -lSDL_image -lGL -lrt
+RANLIB=ranlib
 
-test: test.o util.o
-       $(CXX) -o test test.o util.o $(LDFLAGS)
+TEST_OBJS=main.o
 
-.o: .cpp
-       $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
+# Core.
+LIB_OBJS=util.o widgets.o effect.o effect_chain.o
+
+# Inputs.
+LIB_OBJS += flat_input.o
+LIB_OBJS += ycbcr_input.o
+
+# Effects.
+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 $<
+
+DEPS=$(OBJS:.o=.d)
+-include $(DEPS)
 
 clean:
-       $(RM) test test.o util.o
+       $(RM) test libmovit.a $(OBJS) $(DEPS)
 
 .PHONY: clean