]> mj.ucw.cz Git - libucw.git/blob - free/libs/Makefile
ucw docs: Array sorter
[libucw.git] / free / libs / Makefile
1 # Makefile for the stand-alone release of Sherlock libraries
2 # (c) 2007 Martin Mares <mj@ucw.cz>
3
4 # The default target
5 all: runtree libs api programs extras configs
6
7 # Include configuration
8 s=.
9 -include obj/config.mk
10 obj/config.mk:
11         @echo "You need to run configure first." && false
12
13 BUILDSYS=$(s)/build
14
15 # We will use the libucw build system
16 include $(BUILDSYS)/Maketop
17
18 # Install the build system
19 include $(BUILDSYS)/Makefile
20
21 # Set up names of common libraries (to avoid forward references in rules)
22 ifdef CONFIG_CHARSET
23 LIBCHARSET=$(o)/charset/libcharset.pc
24 endif
25 ifdef CONFIG_SHERLOCK_LIB
26 LIBSH=$(o)/sherlock/libsh.pc
27 LIBSHXML=$(o)/sherlock/xml/libshxml.pc
28 TESTING_DEPS=$(LIBSH)
29 else
30 TESTING_DEPS=$(LIBUCW)
31 endif
32
33 # The UCW library
34 include $(s)/ucw/Makefile
35
36 # Install config files
37 ifdef CONFIG_SHERLOCK_LIB
38 FREE_CONFIGS=sherlock local
39 CONFIGS+=$(FREE_CONFIGS)
40
41 INSTALL_TARGETS+=install-configs
42 install-configs:
43         install -d -m 755 $(DESTDIR)$(INSTALL_CONFIG_DIR)
44         install -m 644 $(addprefix run/$(CONFIG_DIR)/,$(FREE_CONFIGS)) $(DESTDIR)$(INSTALL_CONFIG_DIR)
45 endif
46
47 # Include submakefiles of requested libraries
48 ifdef CONFIG_SHERLOCK_LIB
49 include $(s)/sherlock/Makefile
50 endif
51
52 ifdef CONFIG_CHARSET
53 include $(s)/charset/Makefile
54 endif
55
56 ifdef CONFIG_LANG
57 LIBLANG=$(o)/lang/liblang.pc
58 include $(s)/lang/Makefile
59 endif
60
61 ifdef CONFIG_IMAGES
62 LIBIMAGES=$(o)/images/libimages.pc
63 include $(s)/images/Makefile
64 endif
65
66 # Build documentation by default?
67 ifdef CONFIG_DOC
68 all: docs
69 endif
70
71 libs: $(LIBUCW) $(LIBSH) $(LIBIMAGES) $(LIBCHARSET) $(LIBLANG)
72
73 # And finally the default rules of the build system
74 include $(BUILDSYS)/Makebottom
75
76 ifndef CONFIG_LOCAL
77 install: all $(INSTALL_TARGETS)
78 else
79 install:
80         @echo "Nothing to install, this is a local build." && false
81 endif
82 .PHONY: install