DIRS+=images
-PROGS+=$(o)/images/image-tool $(o)/images/color-tool
-CONFIGS+=images
+LIBIMAGES_PROGS=$(o)/images/image-tool $(o)/images/color-tool
+LIBIMAGES_CONFIGS+=images
LIBIMAGES_MODS=math config context image scale color io-main
LIBIMAGES_INCLUDES=images.h error.h color.h math.h
export LIBIMAGES_LIBS=
endif
ifdef CONFIG_IMAGES_DUP
-PROGS+=$(o)/images/image-dup-test
+LIBIMAGES_PROGS+=$(o)/images/image-dup-test
LIBIMAGES_MODS+=dup-init dup-cmp
LIBIMAGES_INCLUDES+=duplicates.h
endif
ifdef CONFIG_IMAGES_SIM
-PROGS+=$(o)/images/image-sim-test
+LIBIMAGES_PROGS+=$(o)/images/image-sim-test
LIBIMAGES_MODS+=sig-cmp
endif
ifneq ($(CONFIG_IMAGES_DUP)$(CONFIG_IMAGES_SIM),)
$(o)/images/io-libmagick.o: CFLAGS+=$(MAGICK_CPPFLAGS)
endif
+PROGS+=$(LIBIMAGES_PROGS)
+CONFIGS+=$(LIBIMAGES_CONFIGS)
+
$(o)/images/libimages.a: $(addsuffix .o,$(addprefix $(o)/images/,$(LIBIMAGES_MODS)))
$(o)/images/libimages.so: $(addsuffix .oo,$(addprefix $(o)/images/,$(LIBIMAGES_MODS)))
$(o)/images/libimages.pc: $(LIBIMAGES_DEPS)
$(o)/images/.include-stamp: $(addprefix $(s)/images/,$(LIBIMAGES_INCLUDES))
$(o)/images/.include-stamp: IDST=images
run/lib/pkgconfig/libimages.pc: $(o)/images/libimages.pc
+
+ifdef CONFIG_SHARED
+LIBIMAGES_NAME=libimages.so
+else
+LIBIMAGES_NAME=libimages.a
+endif
+
+INSTALL_TARGETS+=install-libimages
+install-libimages:
+ install -d -m 755 $(addprefix $(DESTDIR),$(INSTALL_BIN_DIR) $(INSTALL_INCLUDE_DIR)/images $(INSTALL_LIB_DIR) $(INSTALL_PKGCONFIG_DIR) $(INSTALL_CONFIG_DIR))
+ install -m 755 $(LIBIMAGES_PROGS) $(DESTDIR)$(INSTALL_BIN_DIR)
+ install -m 644 $(addprefix run/include/images/,$(LIBIMAGES_INCLUDES)) $(DESTDIR)$(INSTALL_INCLUDE_DIR)/images
+ install -m 644 run/lib/$(LIBIMAGES_NAME) $(DESTDIR)$(INSTALL_LIB_DIR)
+ install -m 644 run/lib/pkgconfig/libimages.pc $(DESTDIR)$(INSTALL_PKGCONFIG_DIR)
+ install -m 644 $(addprefix run/cf/,$(LIBIMAGES_CONFIGS)) $(DESTDIR)$(INSTALL_CONFIG_DIR)
+
+.PHONY: install-libimages