]> mj.ucw.cz Git - libucw.git/blob - images/Makefile
removed MAX_ATTR_SIZE from images/*
[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 LIBIMAGES_INCLUDES=images.h error.h color.h math.h
9
10 ifdef CONFIG_SHERLOCK
11 LIBIMAGES_MODS+=object
12 LIBIMAGES_DEPS=$(LIBSH)
13 else
14 LIBIMAGES_DEPS=$(LIBUCW)
15 endif
16
17 ifdef CONFIG_IMAGES_DUP
18 PROGS+=$(o)/images/image-dup-test
19 LIBIMAGES_MODS+=dup-init dup-cmp
20 LIBIMAGES_INCLUDES+=duplicates.h
21 endif
22 ifdef CONFIG_IMAGES_SIM
23 PROGS+=$(o)/images/image-sim-test
24 LIBIMAGES_MODS+=sig-cmp
25 endif
26 ifneq ($(CONFIG_IMAGES_DUP)$(CONFIG_IMAGES_SIM),)
27 LIBIMAGES_MODS+=sig-dump sig-init sig-seg sig-txt
28 LIBIMAGES_INCLUDES+=signature.h
29 endif
30
31 LIBIMAGES_LIBS=-lm -lpthread
32
33 ifdef CONFIG_IMAGES_LIBJPEG
34 LIBIMAGES_MODS+=io-libjpeg
35 LIBIMAGES_LIBS+=-ljpeg
36 endif
37
38 ifdef CONFIG_IMAGES_LIBPNG
39 LIBIMAGES_MODS+=io-libpng
40 LIBIMAGES_LIBS+=-lpng
41 endif
42
43 ifdef CONFIG_IMAGES_LIBUNGIF
44 LIBIMAGES_MODS+=io-libungif
45 LIBIMAGES_LIBS+=-lungif
46 else
47 ifdef CONFIG_IMAGES_LIBGIF
48 LIBIMAGES_MODS+=io-libungif
49 LIBIMAGES_LIBS+=-lgif
50 endif
51 endif
52
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)
59 endif
60
61 $(o)/images/libimages.a: $(addsuffix .o,$(addprefix $(o)/images/,$(LIBIMAGES_MODS)))
62 $(o)/images/libimages.so: $(addsuffix .oo,$(addprefix $(o)/images/,$(LIBIMAGES_MODS)))
63
64 $(o)/images/image-tool: $(o)/images/image-tool.o $(LIBIMAGES) $(LIBIMAGES_DEPS)
65 $(o)/images/image-tool: LIBS+=$(LIBIMAGES_LIBS)
66
67 $(o)/images/color-tool: $(o)/images/color-tool.o $(LIBIMAGES) $(LIBIMAGES_DEPS)
68 $(o)/images/color-tool: LIBS+=$(LIBIMAGES_LIBS)
69
70 $(o)/images/image-dup-test: $(o)/images/image-dup-test.o $(LIBIMAGES) $(LIBIMAGES_DEPS)
71 $(o)/images/image-dup-test: LIBS+=$(LIBIMAGES_LIBS)
72
73 $(o)/images/image-sim-test: $(o)/images/image-sim-test.o $(LIBIMAGES) $(LIBIMAGES_DEPS)
74 $(o)/images/image-sim-test: LIBS+=$(LIBIMAGES_LIBS)
75
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
80
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
85
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
90
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