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
-test: test.o
- $(CXX) -o test test.o $(LDFLAGS)
+# Core.
+OBJS=main.o util.o widgets.o effect.o effect_chain.o
-.o: .cpp
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
+# Inputs.
+OBJS += flat_input.o
+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)
+
+%.o: %.cpp
+ $(CXX) -MMD $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
+
+DEPS=$(OBJS:.o=.d)
+-include $(DEPS)
clean:
- $(RM) test test.o
+ $(RM) test $(OBJS) $(DEPS)
.PHONY: clean