]> mj.ucw.cz Git - libucw.git/blob - Makefile
9fff0c45055d14811620ac1c48334dd398b2df36
[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 ifdef CONFIG_SHXML
29 LIBSHXML=$(o)/shxml/libshxml.pc
30 endif
31
32 # The UCW library
33 include $(s)/ucw/Makefile
34
35 # Install config files
36 ifdef CONFIG_SHERLOCK_LIB
37 FREE_CONFIGS=sherlock local
38 CONFIGS+=$(FREE_CONFIGS)
39
40 INSTALL_TARGETS+=install-configs
41 install-configs:
42         install -d -m 755 $(DESTDIR)$(INSTALL_CONFIG_DIR)
43         install -m 644 $(addprefix run/$(CONFIG_DIR)/,$(FREE_CONFIGS)) $(DESTDIR)$(INSTALL_CONFIG_DIR)
44 endif
45
46 # Include submakefiles of requested libraries
47 ifdef CONFIG_CHARSET
48 include $(s)/charset/Makefile
49 endif
50
51 ifdef CONFIG_IMAGES
52 LIBIMAGES=$(o)/images/libimages.pc
53 include $(s)/images/Makefile
54 endif
55
56 # Build documentation by default?
57 ifdef CONFIG_DOC
58 all: docs
59 endif
60
61 libs: $(LIBUCW) $(LIBSHXML) $(LIBIMAGES) $(LIBCHARSET)
62
63 # And finally the default rules of the build system
64 include $(BUILDSYS)/Makebottom
65
66 ifndef CONFIG_LOCAL
67 install: all $(INSTALL_TARGETS)
68 else
69 install:
70         @echo "Nothing to install, this is a local build." && false
71 endif
72 .PHONY: install