]> mj.ucw.cz Git - eval.git/blob - build/Maketop
MO-P: Let KDE template contain a confirmed server certificate
[eval.git] / build / Maketop
1 # Top part of Makefile for the UCW Libraries
2 # (c) 1997--2008 Martin Mares <mj@ucw.cz>
3
4 # Set to 1 if you want verbose output
5 V=0
6
7 # Set to 'y' (or 'n') if you want to auto-confirm (auto-reject) all questions in build/installer
8 CONFIRM=
9
10 # Disable all built-in rules and variables. Speeds up make and simplifies debugging.
11 MAKEFLAGS+=-rR
12
13 CFLAGS=$(CLANG) $(COPT) $(CDEBUG) $(CWARNS) $(CEXTRA) -I. -I$(o) -I$(s)
14 LDFLAGS=$(LOPT) $(LEXTRA)
15
16 DIRS=
17 PROGS=
18 CONFIGS=
19 CONFIG_SRC_DIR=$(CONFIG_DIR)
20 TESTS=
21 EXTRA_RUNDIRS=tmp log
22 INSTALL_RUNDIRS=bin lib
23 API_INCLUDES=
24 API_LIBS=
25
26 # Various files whose type does not fit into PROGS
27 DATAFILES=
28
29 ifdef CONFIG_DARWIN
30 DYNAMIC_LIBRARIES=dylib
31 SOEXT=bundle
32 HOST_PREFIX=/sw
33 else
34 DYNAMIC_LIBRARIES=so
35 SOEXT=so
36 HOST_PREFIX=
37 endif
38
39 ifdef CONFIG_SHARED
40 LS=$(DYNAMIC_LIBRARIES)
41 OS=oo
42 else
43 LS=a
44 OS=o
45 endif
46
47 SO_RUNDIR=lib
48
49 # Whenever "make -s" (silent) is run, turn on verbose mode (paradoxical, but gives the right result)
50 ifneq ($(findstring s,$(MAKEFLAGS)),)
51 V=1
52 endif
53
54 # Define M (message) and Q (quiet command prefix) macros and also MAKESILENT passed to sub-makes
55 ifeq ($(V),1)
56 M=@\#
57 Q=
58 MAKESILENT=
59 else
60 M=@echo #
61 Q=@
62 MAKESILENT=-s
63 endif
64
65 # Clean needs to be a double-colon rule since we want sub-makefiles to be able
66 # to define their own cleanup actions.
67 dust::
68         rm -f `find . -path "*~" -or -name "\#*\#"`
69         rm -f allocs.tmp cscope.out TAGS
70
71 clean:: dust
72         rm -rf `find obj/ucw -mindepth 1 -maxdepth 1 -not -name autoconf.h`
73         rm -rf `find obj -mindepth 1 -maxdepth 1 -not \( -name config.mk -o -name autoconf.h -o -name ucw \)`
74         rm -rf tests run/{bin,lib,include,.tree-stamp,doc}
75
76 distclean:: clean
77         rm -rf obj run
78
79 testclean::
80         rm -f `find obj -name "*.test"`
81
82 docclean::
83         rm -f $(DOCS) $(patsubst %.html,%.txt,$(DOCS))
84
85 # Extra default rules (appended to by submakefiles)
86 extras::
87
88 # Relative symlinks and other pathname manipulation macros
89 empty:=
90 space:=$(empty) $(empty)
91 backref=$(subst $(space),/,$(patsubst %,..,$(subst /,$(space),$(1))))
92 tack-on=$(if $(patsubst /%,,$(2)),$(1)/$(2),$(2))
93 symlink=ln -sf $(call tack-on,$(call backref,$(2)),$(1)) $(2)/
94 symlink-alias=ln -sf $(call tack-on,$(call backref,$(2)),$(1)) $(2)/$(3)