From 86b74f27a95b617008575a9088e4c675e9f956d6 Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Sat, 4 Oct 2008 17:21:35 +0200 Subject: [PATCH] Libucw supports installation * Perl modules not installed, what to do with them? * Need to teach other libraries to install --- free/libs/Makefile | 8 ++++++++ ucw/Makefile | 15 +++++++++++++++ ucw/shell/Makefile | 10 +++++++++- ucw/sorter/Makefile | 7 +++++++ ucw/utils/Makefile | 10 +++++++++- 5 files changed, 48 insertions(+), 2 deletions(-) diff --git a/free/libs/Makefile b/free/libs/Makefile index c2c11b22..09f2c02c 100644 --- a/free/libs/Makefile +++ b/free/libs/Makefile @@ -46,3 +46,11 @@ libs: $(LIBUCW) $(LIBSH) $(LIBIMAGES) $(LIBCHARSET) $(LIBLANG) # 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 diff --git a/ucw/Makefile b/ucw/Makefile index 36ab965c..4e50e7ce 100644 --- a/ucw/Makefile +++ b/ucw/Makefile @@ -141,3 +141,18 @@ endif 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 diff --git a/ucw/shell/Makefile b/ucw/shell/Makefile index f9f6e076..d45895ac 100644 --- a/ucw/shell/Makefile +++ b/ucw/shell/Makefile @@ -1,7 +1,8 @@ # 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) @@ -10,3 +11,10 @@ $(o)/ucw/shell/logger: $(o)/ucw/shell/logger.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 diff --git a/ucw/sorter/Makefile b/ucw/sorter/Makefile index a3e538e1..5bbf178f 100644 --- a/ucw/sorter/Makefile +++ b/ucw/sorter/Makefile @@ -11,3 +11,10 @@ PROGS+=$(o)/ucw/sorter/sort-test 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 diff --git a/ucw/utils/Makefile b/ucw/utils/Makefile index aa9f96a0..3227bb0a 100644 --- a/ucw/utils/Makefile +++ b/ucw/utils/Makefile @@ -1,6 +1,7 @@ # Makefile for the UCW utilities (c) 2008 Michal Vaner -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) @@ -9,3 +10,10 @@ $(o)/ucw/utils/urltool: $(o)/ucw/utils/urltool.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 -- 2.39.2