# And finally the default rules of the build system
include $(s)/build/Makebottom
+
+ifndef CONFIG_LOCAL
+install: $(INSTALL_TARGETS)
+else
+install:
+ @echo "Nothing to install, this is a local build." && false
+endif
+.PHONY: install
ifdef CONFIG_UCW_SHELL_UTILS
include $(s)/ucw/shell/Makefile
endif
+
+ifdef CONFIG_SHARED
+LIBUCW_NAME=libucw.so
+else
+LIBUCW_NAME=libucw.a
+endif
+
+INSTALL_TARGETS+=install-libucw
+install-libucw:
+ install -d -m 755 $(DESTDIR)$(INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_INCLUDE_DIR)/ucw/ $(DESTDIR)$(INSTALL_PKGCONFIG_DIR)
+ install -m 644 `find run/include/ucw/ -maxdepth 1 -type f` $(DESTDIR)$(INSTALL_INCLUDE_DIR)/ucw/
+ install -m 644 run/lib/pkgconfig/libucw.pc $(DESTDIR)$(INSTALL_PKGCONFIG_DIR)
+ install -m 644 run/lib/$(LIBUCW_NAME) $(DESTDIR)$(INSTALL_LIB_DIR)
+
+.PHONY: install-libucw
# Support routines for shell scripts
DIRS+=ucw/shell
-PROGS+=$(o)/ucw/shell/config $(o)/ucw/shell/logger
+UCW_SHELL_PROGS=$(addprefix $(o)/ucw/shell/,config logger)
+PROGS+=$(UCW_SHELL_PROGS)
DATAFILES+=$(o)/ucw/shell/libucw.sh
$(o)/ucw/shell/config: $(o)/ucw/shell/config.o $(LIBUCW)
TESTS+=$(addprefix $(o)/ucw/shell/,config.test)
$(o)/ucw/shell/config.test: $(o)/ucw/shell/config
+
+INSTALL_TARGETS+=install-ucw-shell
+install-ucw-shell:
+ install -d -m 755 $(DESTDIR)$(INSTALL_BIN_DIR)
+ install -m 755 $(UCW_SHELL_PROGS) $(DESTDIR)$(INSTALL_BIN_DIR)
+
+.PHONY: install-ucw-shell
endif
$(o)/ucw/sorter/sort-test: $(o)/ucw/sorter/sort-test.o $(LIBUCW)
+
+INSTALL_TARGETS+=install-ucw-sorter
+install-ucw-sorter:
+ install -d -m 755 $(DESTDIR)$(INSTALL_INCLUDE_DIR)/ucw/sorter
+ install -m 644 run/include/ucw/sorter/* $(DESTDIR)$(INSTALL_INCLUDE_DIR)/ucw/sorter/
+
+.PHONY: install-ucw-sorter
# Makefile for the UCW utilities (c) 2008 Michal Vaner <vorner@ucw.cz>
-PROGS+=$(addprefix $(o)/ucw/utils/,basecode daemon-helper rotate-log urltool)
+UCW_UTILS=$(addprefix $(o)/ucw/utils/,basecode daemon-helper rotate-log urltool)
+PROGS+=$(UCW_UTILS)
DIRS+=ucw/utils
$(o)/ucw/utils/basecode: $(o)/ucw/utils/basecode.o $(LIBUCW)
TESTS+=$(o)/ucw/utils/basecode.test
$(o)/ucw/utils/basecode.test: $(o)/ucw/utils/basecode
+
+INSTALL_TARGETS+=install-ucw-utils
+install-ucw-utils:
+ install -d -m 755 $(DESTDIR)$(INSTALL_BIN_DIR)
+ install -m 755 $(UCW_UTILS) $(DESTDIR)$(INSTALL_BIN_DIR)
+
+.PHONY: install-ucw-utils