]> mj.ucw.cz Git - libucw.git/commitdiff
Libucw supports installation
authorMichal Vaner <vorner@ucw.cz>
Sat, 4 Oct 2008 15:21:35 +0000 (17:21 +0200)
committerMichal Vaner <vorner@ucw.cz>
Wed, 8 Oct 2008 12:57:13 +0000 (14:57 +0200)
* Perl modules not installed, what to do with them?
* Need to teach other libraries to install

free/libs/Makefile
ucw/Makefile
ucw/shell/Makefile
ucw/sorter/Makefile
ucw/utils/Makefile

index c2c11b221ff9c29027f11fee984e2fc6e01c2079..09f2c02cd9bbd2f6e98b864894589f07abe3ce20 100644 (file)
@@ -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
index 36ab965c4d858d16ede949e484a8f4ac8bb077d1..4e50e7ce1a48618d8f578955e7763537b870d1b7 100644 (file)
@@ -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
index f9f6e076b15e6102513a2ac1e583b8fedf44f907..d45895acfd561cb183d5f03404a5afd28ad3baea 100644 (file)
@@ -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
index a3e538e185e3a999a4e978bd1763c60164965fb1..5bbf178fbf49e2b1db8ef2924ba42a782f98ee01 100644 (file)
@@ -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
index aa9f96a0d7475f0f90df884b0962dad3a3a0efad..3227bb0a7401a302a33d63ed77c6f784aa14aab8 100644 (file)
@@ -1,6 +1,7 @@
 # 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)
@@ -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