1 # Makefile for the Image Library (c) 2006 Pavel Charvat <pchar@ucw.cz>
5 PROGS+=$(o)/images/image-tool $(o)/images/color-tool
7 LIBIMAGES_MODS=math config context image scale color io-main
8 LIBIMAGES_INCLUDES=images.h error.h color.h math.h
11 LIBIMAGES_MODS+=object
12 LIBIMAGES_DEPS=$(LIBSH)
14 LIBIMAGES_DEPS=$(LIBUCW)
17 ifdef CONFIG_IMAGES_DUP
18 PROGS+=$(o)/images/image-dup-test
19 LIBIMAGES_MODS+=dup-init dup-cmp
20 LIBIMAGES_INCLUDES+=duplicates.h
22 ifdef CONFIG_IMAGES_SIM
23 PROGS+=$(o)/images/image-sim-test
24 LIBIMAGES_MODS+=sig-cmp
26 ifneq ($(CONFIG_IMAGES_DUP)$(CONFIG_IMAGES_SIM),)
27 LIBIMAGES_MODS+=sig-dump sig-init sig-seg sig-txt
28 LIBIMAGES_INCLUDES+=signature.h
31 LIBIMAGES_LIBS=-lm -lpthread
33 ifdef CONFIG_IMAGES_LIBJPEG
34 LIBIMAGES_MODS+=io-libjpeg
35 LIBIMAGES_LIBS+=-ljpeg
38 ifdef CONFIG_IMAGES_LIBPNG
39 LIBIMAGES_MODS+=io-libpng
43 ifdef CONFIG_IMAGES_LIBUNGIF
44 LIBIMAGES_MODS+=io-libungif
45 LIBIMAGES_LIBS+=-lungif
47 ifdef CONFIG_IMAGES_LIBGIF
48 LIBIMAGES_MODS+=io-libungif
53 ifdef CONFIG_IMAGES_LIBMAGICK
54 LIBIMAGES_MODS+=io-libmagick
55 MAGICK_LIBS:=$(shell GraphicsMagick-config --libs)
56 MAGICK_CPPFLAGS:=$(shell GraphicsMagick-config --cppflags)
57 LIBIMAGES_LIBS+=$(MAGICK_LIBS)
58 $(o)/images/io-libmagick.o: CFLAGS+=$(MAGICK_CPPFLAGS)
61 $(o)/images/libimages.a: $(addsuffix .o,$(addprefix $(o)/images/,$(LIBIMAGES_MODS)))
62 $(o)/images/libimages.so: $(addsuffix .oo,$(addprefix $(o)/images/,$(LIBIMAGES_MODS)))
64 $(o)/images/image-tool: $(o)/images/image-tool.o $(LIBIMAGES) $(LIBIMAGES_DEPS)
65 $(o)/images/image-tool: LIBS+=$(LIBIMAGES_LIBS)
67 $(o)/images/color-tool: $(o)/images/color-tool.o $(LIBIMAGES) $(LIBIMAGES_DEPS)
68 $(o)/images/color-tool: LIBS+=$(LIBIMAGES_LIBS)
70 $(o)/images/image-dup-test: $(o)/images/image-dup-test.o $(LIBIMAGES) $(LIBIMAGES_DEPS)
71 $(o)/images/image-dup-test: LIBS+=$(LIBIMAGES_LIBS)
73 $(o)/images/image-sim-test: $(o)/images/image-sim-test.o $(LIBIMAGES) $(LIBIMAGES_DEPS)
74 $(o)/images/image-sim-test: LIBS+=$(LIBIMAGES_LIBS)
76 TESTS+=$(o)/images/image-test.test
77 $(o)/images/image-test: $(o)/images/image-test.o $(LIBIMAGES) $(LIBIMAGES_DEPS)
78 $(o)/images/image-test: LIBS+=$(LIBIMAGES_LIBS)
79 $(o)/images/image-test.test: $(o)/images/image-test
81 TESTS+=$(o)/images/hilbert-test.test
82 $(o)/images/hilbert-test: $(LIBIMAGES_DEPS)
83 $(o)/images/hilbert-test: LIBS+=-lm
84 $(o)/images/hilbert-test.test: $(o)/images/hilbert-test
86 TESTS+=$(o)/images/color.test
87 $(o)/images/color-t: $(LIBIMAGES) $(LIBIMAGES_DEPS)
88 $(o)/images/color-t: LIBS+=$(LIBIMAGES_LIBS) $(LIBIMAGES_DEPS)
89 $(o)/images/color.test: $(o)/images/color-t
91 INCLUDES+=$(o)/images/.include-stamp
92 $(o)/images/.include-stamp: $(addprefix $(s)/images/,$(LIBIMAGES_INCLUDES))
93 $(s)/build/install-includes $(s)/images run/include/images $(?F)
94 touch $(o)/images/.include-stamp