]> mj.ucw.cz Git - libucw.git/blob - Makefile
Build: Added support for custom PKG_CONFIG_PATH in UCW::Configure::PkgConfig().
[libucw.git] / Makefile
1 # Makefile for the UCW libraries
2 # (c) 2007--2010 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 CONFIG_SRC_DIR=etc
19 TESTING_DEPS=$(LIBUCW)
20
21 # Install the build system
22 include $(BUILDSYS)/Makefile
23
24 # Set up names of common libraries (to avoid forward references in rules)
25 ifdef CONFIG_CHARSET
26 LIBCHARSET=$(o)/charset/libucw-charset.pc
27 endif
28
29 # The UCW library
30 include $(s)/ucw/Makefile
31
32 # Install config files
33 ifdef CONFIG_SHERLOCK_LIB
34 FREE_CONFIGS=sherlock local
35 CONFIGS+=$(FREE_CONFIGS)
36
37 INSTALL_TARGETS+=install-configs
38 install-configs:
39         install -d -m 755 $(DESTDIR)$(INSTALL_CONFIG_DIR)
40         install -m 644 $(addprefix run/$(CONFIG_DIR)/,$(FREE_CONFIGS)) $(DESTDIR)$(INSTALL_CONFIG_DIR)
41 endif
42
43 # Include submakefiles of requested libraries
44 ifdef CONFIG_CHARSET
45 include $(s)/charset/Makefile
46 endif
47
48 ifdef CONFIG_IMAGES
49 LIBIMAGES=$(o)/images/libucw-images.pc
50 include $(s)/images/Makefile
51 endif
52
53 ifdef CONFIG_XML
54 LIBXML=$(o)/ucw-xml/libucw-xml.pc
55 include $(s)/ucw-xml/Makefile
56 endif
57
58 ifdef CONFIG_JSON
59 LIBJSON=$(o)/ucw-json/libucw-json.pc
60 include $(s)/ucw-json/Makefile
61 endif
62
63 # Build documentation by default?
64 ifdef CONFIG_DOC
65 all: docs
66 endif
67
68 libs: $(LIBUCW) $(LIBXML) $(LIBJSON) $(LIBIMAGES) $(LIBCHARSET)
69
70 # And finally the default rules of the build system
71 include $(BUILDSYS)/Makebottom
72
73 ifndef CONFIG_LOCAL
74 install: all $(INSTALL_TARGETS)
75 else
76 install:
77         @echo "Nothing to install, this is a local build." && false
78 endif
79 .PHONY: install