]> mj.ucw.cz Git - libucw.git/blob - Makefile
Conf: Split off everything related to cf_getopt()
[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/libcharset.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/libimages.pc
50 include $(s)/images/Makefile
51 endif
52
53 ifdef CONFIG_SHXML
54 LIBSHXML=$(o)/shxml/libshxml.pc
55 include $(s)/shxml/Makefile
56 endif
57
58 # Build documentation by default?
59 ifdef CONFIG_DOC
60 all: docs
61 endif
62
63 libs: $(LIBUCW) $(LIBSHXML) $(LIBIMAGES) $(LIBCHARSET)
64
65 # And finally the default rules of the build system
66 include $(BUILDSYS)/Makebottom
67
68 ifndef CONFIG_LOCAL
69 install: all $(INSTALL_TARGETS)
70 else
71 install:
72         @echo "Nothing to install, this is a local build." && false
73 endif
74 .PHONY: install