]> mj.ucw.cz Git - libucw.git/blob - images/Makefile
Merge with git+ssh://git.ucw.cz/projects/sherlock/GIT/sherlock.git#v3.10
[libucw.git] / images / Makefile
1 # Makefile for the Image Library (c) 2006 Pavel Charvat <pchar@ucw.cz>
2
3 DIRS+=images
4
5 PROGS+=$(o)/images/image-tool $(o)/images/color-tool
6 CONFIGS+=images
7 LIBIMAGES_MODS=math config context image scale color io-main
8
9 ifdef CONFIG_SHERLOCK
10 LIBIMAGES_MODS+=object
11 LIBIMAGES_DEPS=$(LIBSH)
12 else
13 LIBIMAGES_DEPS=$(LIBUCW)
14 endif
15
16 ifdef CONFIG_IMAGES_DUP
17 PROGS+=$(o)/images/image-dup-test
18 LIBIMAGES_MODS+=dup-init dup-cmp
19 endif
20 ifdef CONFIG_IMAGES_SIM
21 PROGS+=$(o)/images/image-sim-test
22 LIBIMAGES_MODS+=sig-cmp
23 endif
24 ifneq ($(CONFIG_IMAGES_DUP)$(CONFIG_IMAGES_SIM),)
25 LIBIMAGES_MODS+=sig-dump sig-init sig-seg sig-txt
26 endif
27
28 LIBIMAGES_LIBS=-lm -lpthread
29
30 ifdef CONFIG_IMAGES_LIBJPEG
31 LIBIMAGES_MODS+=io-libjpeg
32 LIBIMAGES_LIBS+=-ljpeg
33 endif
34
35 ifdef CONFIG_IMAGES_LIBPNG
36 LIBIMAGES_MODS+=io-libpng
37 LIBIMAGES_LIBS+=-lpng
38 endif
39
40 ifdef CONFIG_IMAGES_LIBUNGIF
41 LIBIMAGES_MODS+=io-libungif
42 LIBIMAGES_LIBS+=-lungif
43 else
44 ifdef CONFIG_IMAGES_LIBGIF
45 LIBIMAGES_MODS+=io-libungif
46 LIBIMAGES_LIBS+=-lgif
47 endif
48 endif
49
50 ifdef CONFIG_IMAGES_LIBMAGICK
51 LIBIMAGES_MODS+=io-libmagick
52 MAGICK_LIBS:=$(shell GraphicsMagick-config --libs)
53 MAGICK_CPPFLAGS:=$(shell GraphicsMagick-config --cppflags)
54 LIBIMAGES_LIBS+=$(MAGICK_LIBS)
55 $(o)/images/io-libmagick.o: CFLAGS+=$(MAGICK_CPPFLAGS)
56 endif
57
58 $(o)/images/libimages.a: $(addsuffix .o,$(addprefix $(o)/images/,$(LIBIMAGES_MODS)))
59 $(o)/images/libimages.so: $(addsuffix .oo,$(addprefix $(o)/images/,$(LIBIMAGES_MODS)))
60
61 $(o)/images/image-tool: $(o)/images/image-tool.o $(LIBIMAGES) $(LIBIMAGES_DEPS)
62 $(o)/images/image-tool: LIBS+=$(LIBIMAGES_LIBS)
63
64 $(o)/images/color-tool: $(o)/images/color-tool.o $(LIBIMAGES) $(LIBIMAGES_DEPS)
65 $(o)/images/color-tool: LIBS+=$(LIBIMAGES_LIBS)
66
67 $(o)/images/image-dup-test: $(o)/images/image-dup-test.o $(LIBIMAGES) $(LIBIMAGES_DEPS)
68 $(o)/images/image-dup-test: LIBS+=$(LIBIMAGES_LIBS)
69
70 $(o)/images/image-sim-test: $(o)/images/image-sim-test.o $(LIBIMAGES) $(LIBIMAGES_DEPS)
71 $(o)/images/image-sim-test: LIBS+=$(LIBIMAGES_LIBS)
72
73 TESTS+=$(o)/images/image-test.test
74 $(o)/images/image-test: $(o)/images/image-test.o $(LIBIMAGES) $(LIBIMAGES_DEPS)
75 $(o)/images/image-test: LIBS+=$(LIBIMAGES_LIBS)
76 $(o)/images/image-test.test: $(o)/images/image-test
77
78 TESTS+=$(o)/images/hilbert-test.test
79 $(o)/images/hilbert-test: $(LIBIMAGES_DEPS)
80 $(o)/images/hilbert-test: LIBS+=-lm
81 $(o)/images/hilbert-test.test: $(o)/images/hilbert-test
82
83 TESTS+=$(o)/images/color.test
84 $(o)/images/color-t: $(LIBIMAGES) $(LIBIMAGES_DEPS)
85 $(o)/images/color-t: LIBS+=$(LIBIMAGES_LIBS) $(LIBIMAGES_DEPS)
86 $(o)/images/color.test: $(o)/images/color-t