]> mj.ucw.cz Git - libucw.git/blob - free/libs/Makefile
Options to include separate libraries in build
[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
46 include $(s)/sherlock/Makefile
47 endif
48
49 ifdef CONFIG_CHARSET
50 # Include makefiles of libraries we wish to use
51 include $(s)/charset/Makefile
52 endif
53
54 ifdef CONFIG_LANG
55 LIBLANG=$(o)/lang/liblang.pc
56 include $(s)/lang/Makefile
57 endif
58
59 ifdef CONFIG_IMAGES
60 LIBIMAGES=$(o)/images/libimages.pc
61 include $(s)/images/Makefile
62 endif
63
64 # Build documentation by default?
65 ifdef CONFIG_DOC
66 all: docs
67 endif
68
69 libs: $(LIBUCW) $(LIBSH) $(LIBIMAGES) $(LIBCHARSET) $(LIBLANG)
70
71 # And finally the default rules of the build system
72 include $(BUILDSYS)/Makebottom
73
74 ifndef CONFIG_LOCAL
75 install: all $(INSTALL_TARGETS)
76 else
77 install:
78         @echo "Nothing to install, this is a local build." && false
79 endif
80 .PHONY: install