summaryrefslogtreecommitdiff
path: root/config/makefiles/debugmake.mk
blob: 0257f2aa5753ab8d77ae853d675b73dbb4b1f08a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# -*- makefile -*-
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#

###########################################################################
## Intent: Helper targets for displaying variables and state information
###########################################################################

# Support usage outside of config/rules.mk
ifndef INCLUDED_DEBUGMAKE_MK #{

define CR


endef

define shell_quote
'$(subst $(CR),\$(CR),$(subst ','\'',$(1)))'
endef

echo-variable-%:
	@echo $(call shell_quote,$($*))

echo-dirs:
	@echo $(call shell_quote,$(DIRS))

define print_var
@printf '%20s = %s\n' $1 $(call shell_quote,$($1))

endef

define print_vars
$(foreach var,$1,$(call print_var,$(var)))
endef

showtargs:
ifneq (,$(filter $(PROGRAM) $(HOST_PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $(LIBRARY) $(SHARED_LIBRARY),$(TARGETS)))
	@echo --------------------------------------------------------------------------------
	$(call print_vars,\
		PROGRAM \
		SIMPLE_PROGRAMS \
		LIBRARY \
		SHARED_LIBRARY \
		LIBS \
		DEF_FILE \
		IMPORT_LIBRARY \
		STATIC_LIBS \
		SHARED_LIBS \
		EXTRA_DSO_LDOPTS \
		DEPENDENT_LIBS \
	)
	@echo --------------------------------------------------------------------------------
endif
	$(LOOP_OVER_DIRS)

showbuild showhost: _DEPEND_CFLAGS=
showbuild showhost: COMPILE_PDB_FLAG=
showbuild:
	$(call print_vars,\
		MOZ_BUILD_ROOT \
		MOZ_WIDGET_TOOLKIT \
		CC \
		CXX \
		CCC \
		CPP \
		LD \
		AR \
		IMPLIB \
		FILTER \
		MKSHLIB \
		MKCSHLIB \
		RC \
		CFLAGS \
		OS_CFLAGS \
		COMPILE_CFLAGS \
		CXXFLAGS \
		OS_CXXFLAGS \
		COMPILE_CXXFLAGS \
		COMPILE_CMFLAGS \
		COMPILE_CMMFLAGS \
		LDFLAGS \
		OS_LDFLAGS \
		DSO_LDOPTS \
		OS_INCLUDES \
		OS_LIBS \
		EXTRA_LIBS \
		BIN_FLAGS \
		INCLUDES \
		DEFINES \
		ACDEFINES \
		BIN_SUFFIX \
		LIB_SUFFIX \
		DLL_SUFFIX \
		IMPORT_LIB_SUFFIX \
		INSTALL \
		VPATH \
	)

showhost:
	$(call print_vars,\
		HOST_CC \
		HOST_CXX \
		HOST_CFLAGS \
		HOST_LDFLAGS \
		HOST_LIBS \
		HOST_EXTRA_LIBS \
		HOST_EXTRA_DEPS \
		HOST_PROGRAM \
		HOST_OBJS \
		HOST_PROGOBJS \
		HOST_LIBRARY \
	)

INCLUDED_DEBUGMAKE_MK = 1
endif #}