]> mj.ucw.cz Git - moe.git/blob - build/Maketop
Cleanups in mop/score/.
[moe.git] / build / Maketop
1 # Top part of Makefile for the UCW Libraries
2 # (c) 1997--2007 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 TESTS=
20 EXTRA_RUNDIRS=tmp log
21 INSTALL_RUNDIRS=bin lib
22 API_INCLUDES=
23 API_LIBS=
24
25 # Various files whose type does not fit into PROGS
26 DATAFILES=
27
28 ifdef CONFIG_SHARED
29 LS=so
30 OS=oo
31 else
32 LS=a
33 OS=o
34 endif
35
36 ifdef CONFIG_DARWIN
37 SOEXT=bundle
38 else
39 SOEXT=so
40 endif
41
42 # Whenever "make -s" (silent) is run, turn on verbose mode (paradoxical, but gives the right result)
43 ifneq ($(findstring s,$(MAKEFLAGS)),)
44 V=1
45 endif
46
47 # Define M (message) and Q (quiet command prefix) macros and also MAKESILENT passed to sub-makes
48 ifeq ($(V),1)
49 M=@\#
50 Q=
51 MAKESILENT=
52 else
53 M=@echo #
54 Q=@
55 MAKESILENT=-s
56 endif
57
58 # Clean needs to be a double-colon rule since we want sub-makefiles to be able
59 # to define their own cleanup actions.
60 dust::
61         rm -f `find . -path "*~" -or -name "\#*\#" -or -name core`
62         rm -f allocs.tmp cscope.out TAGS
63
64 clean:: dust
65         rm -rf `find obj -mindepth 1 -maxdepth 1 -not \( -name config.mk -o -name autoconf.h \)`
66         rm -rf tests run/{bin,lib,include,.tree-stamp}
67
68 distclean:: clean
69         rm -rf obj run
70
71 testclean::
72         rm -f `find obj -name "*.test"`
73
74 # Extra default rules (appended to by submakefiles)
75 extras::
76
77 # Relative symlinks and other pathname manipulation macros
78 empty:=
79 space:=$(empty) $(empty)
80 backref=$(subst $(space),/,$(patsubst %,..,$(subst /,$(space),$(1))))
81 tack-on=$(if $(patsubst /%,,$(2)),$(1)/$(2),$(2))
82 symlink=ln -sf $(call tack-on,$(call backref,$(2)),$(1)) $(2)/