xref: /trunk/main/solenv/gbuild/Output.mk (revision cdf0e10c)
1*cdf0e10cSrcweir#*************************************************************************
2*cdf0e10cSrcweir#
3*cdf0e10cSrcweir# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir#
5*cdf0e10cSrcweir# Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir#
7*cdf0e10cSrcweir# OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir#
9*cdf0e10cSrcweir# This file is part of OpenOffice.org.
10*cdf0e10cSrcweir#
11*cdf0e10cSrcweir# OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir# it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir# only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir#
15*cdf0e10cSrcweir# OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir# but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir# GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir# (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir#
21*cdf0e10cSrcweir# You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir# version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir# <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir# for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir#
26*cdf0e10cSrcweir#*************************************************************************
27*cdf0e10cSrcweir
28*cdf0e10cSrcweir# user notifications and formatting
29*cdf0e10cSrcweir
30*cdf0e10cSrcweirdefine gb_Output__format_type
31*cdf0e10cSrcweir[ $(word 2,$(1) build clean) $(2) ]
32*cdf0e10cSrcweirendef
33*cdf0e10cSrcweir
34*cdf0e10cSrcweirdefine gb_Output__format_target
35*cdf0e10cSrcweir$(1)
36*cdf0e10cSrcweirendef
37*cdf0e10cSrcweir
38*cdf0e10cSrcweirdefine gb_Output_error
39*cdf0e10cSrcweir$(error $(1))
40*cdf0e10cSrcweirendef
41*cdf0e10cSrcweir
42*cdf0e10cSrcweirdefine gb_Output_announce_title
43*cdf0e10cSrcweirendef
44*cdf0e10cSrcweir
45*cdf0e10cSrcweirdefine gb_Output_announce_bell
46*cdf0e10cSrcweirendef
47*cdf0e10cSrcweir
48*cdf0e10cSrcweirdefine gb_Output_info
49*cdf0e10cSrcweir$(info [ info  $(2) ] $(1))
50*cdf0e10cSrcweirendef
51*cdf0e10cSrcweir
52*cdf0e10cSrcweirdefine gb_Output_warn
53*cdf0e10cSrcweir$(warning $(NEWLINE)[ WARN  $(2) ] !!!$(NEWLINE)[ WARN  $(2) ] !!! $(1)$(NEWLINE)[ WARN  $(2) ] !!!)
54*cdf0e10cSrcweirendef
55*cdf0e10cSrcweir
56*cdf0e10cSrcweirgb_Output_ESCAPE := $(shell echo|awk 'BEGIN { printf "%c", 27 }' -)
57*cdf0e10cSrcweirgb_Output_BELL := $(shell echo|awk 'BEGIN { printf "%c", 7 }' -)
58*cdf0e10cSrcweir
59*cdf0e10cSrcweir# only enable colorized output if
60*cdf0e10cSrcweir# - gb_COLOR is set
61*cdf0e10cSrcweir# - we have a known term
62*cdf0e10cSrcweirifneq ($(strip $(gb_COLOR)),)
63*cdf0e10cSrcweirifneq ($(filter $(TERM),Eterm aterm gnome kterm linux rxvt rxvt-unicode screen xterm xterm-color),)
64*cdf0e10cSrcweir
65*cdf0e10cSrcweirgb_Output_COLOR_RESET := $(gb_Output_ESCAPE)[0m
66*cdf0e10cSrcweirgb_Output_COLOR_RESETANDESCAPE := $(gb_Output_COLOR_RESET)$(gb_Output_ESCAPE)
67*cdf0e10cSrcweir
68*cdf0e10cSrcweirgb_Output_COLOR_OUTBUILD_LEVEL1 := $(gb_Output_COLOR_RESETANDESCAPE)[37;40m
69*cdf0e10cSrcweirgb_Output_COLOR_OUTBUILD_LEVEL2 := $(gb_Output_COLOR_RESETANDESCAPE)[37;40m
70*cdf0e10cSrcweirgb_Output_COLOR_OUTBUILD_LEVEL3 := $(gb_Output_COLOR_RESETANDESCAPE)[37;40m
71*cdf0e10cSrcweirgb_Output_COLOR_OUTBUILD_LEVEL4 := $(gb_Output_COLOR_RESETANDESCAPE)[37;40m
72*cdf0e10cSrcweirgb_Output_COLOR_OUTBUILD_LEVEL5 := $(gb_Output_COLOR_RESETANDESCAPE)[37;1;46m
73*cdf0e10cSrcweirgb_Output_COLOR_OUTBUILD_LEVEL6 := $(gb_Output_COLOR_RESETANDESCAPE)[37;1;44m
74*cdf0e10cSrcweir
75*cdf0e10cSrcweirgb_Output_COLOR_INBUILD_LEVEL1 := $(gb_Output_COLOR_RESETANDESCAPE)[36;40m
76*cdf0e10cSrcweirgb_Output_COLOR_INBUILD_LEVEL2 := $(gb_Output_COLOR_RESETANDESCAPE)[36;1;40m
77*cdf0e10cSrcweirgb_Output_COLOR_INBUILD_LEVEL3 := $(gb_Output_COLOR_RESETANDESCAPE)[32;40m
78*cdf0e10cSrcweirgb_Output_COLOR_INBUILD_LEVEL4 := $(gb_Output_COLOR_RESETANDESCAPE)[32;1;40m
79*cdf0e10cSrcweirgb_Output_COLOR_INBUILD_LEVEL5 := $(gb_Output_COLOR_RESETANDESCAPE)[37;1;46m
80*cdf0e10cSrcweirgb_Output_COLOR_INBUILD_LEVEL6 := $(gb_Output_COLOR_RESETANDESCAPE)[37;1;44m
81*cdf0e10cSrcweir
82*cdf0e10cSrcweirgb_Output_COLOR_OUTCLEAN_LEVEL1 := $(gb_Output_COLOR_RESETANDESCAPE)[37;40m
83*cdf0e10cSrcweirgb_Output_COLOR_OUTCLEAN_LEVEL2 := $(gb_Output_COLOR_RESETANDESCAPE)[37;40m
84*cdf0e10cSrcweirgb_Output_COLOR_OUTCLEAN_LEVEL3 := $(gb_Output_COLOR_RESETANDESCAPE)[37;40m
85*cdf0e10cSrcweirgb_Output_COLOR_OUTCLEAN_LEVEL4 := $(gb_Output_COLOR_RESETANDESCAPE)[37;40m
86*cdf0e10cSrcweirgb_Output_COLOR_OUTCLEAN_LEVEL5 := $(gb_Output_COLOR_RESETANDESCAPE)[33;1;41m
87*cdf0e10cSrcweirgb_Output_COLOR_OUTCLEAN_LEVEL6 := $(gb_Output_COLOR_RESETANDESCAPE)[37;1;41m
88*cdf0e10cSrcweir
89*cdf0e10cSrcweirgb_Output_COLOR_INCLEAN_LEVEL1 := $(gb_Output_COLOR_RESETANDESCAPE)[33;40m
90*cdf0e10cSrcweirgb_Output_COLOR_INCLEAN_LEVEL2 := $(gb_Output_COLOR_RESETANDESCAPE)[33;1;40m
91*cdf0e10cSrcweirgb_Output_COLOR_INCLEAN_LEVEL3 := $(gb_Output_COLOR_RESETANDESCAPE)[31;40m
92*cdf0e10cSrcweirgb_Output_COLOR_INCLEAN_LEVEL4 := $(gb_Output_COLOR_RESETANDESCAPE)[31;1;40m
93*cdf0e10cSrcweirgb_Output_COLOR_INCLEAN_LEVEL5 := $(gb_Output_COLOR_RESETANDESCAPE)[33;1;41m
94*cdf0e10cSrcweirgb_Output_COLOR_INCLEAN_LEVEL6 := $(gb_Output_COLOR_RESETANDESCAPE)[37;1;41m
95*cdf0e10cSrcweir
96*cdf0e10cSrcweirgb_Output_COLOR_ERROR := $(gb_Output_COLOR_RESETANDESCAPE)[37;1;41m
97*cdf0e10cSrcweir
98*cdf0e10cSrcweirdefine gb_Output__format_type
99*cdf0e10cSrcweir$(subst :, ,$(word 2,$(1) \
100*cdf0e10cSrcweir	$(gb_Output_COLOR_OUTBUILD_LEVEL$(3))[:$(gb_Output_COLOR_INBUILD_LEVEL$(3))build:$(subst $(WHITESPACE),:,$(2))$(gb_Output_COLOR_OUTBUILD_LEVEL$(3)):] \
101*cdf0e10cSrcweir	$(gb_Output_COLOR_OUTCLEAN_LEVEL$(3))[:$(gb_Output_COLOR_INCLEAN_LEVEL$(3))clean:$(subst $(WHITESPACE),:,$(2))$(gb_Output_COLOR_OUTCLEAN_LEVEL$(3)):]))$(gb_Output_COLOR_RESET)
102*cdf0e10cSrcweirendef
103*cdf0e10cSrcweir
104*cdf0e10cSrcweirdefine gb_Output_info
105*cdf0e10cSrcweir$(info $(gb_Output_COLOR_OUTBUILD_LEVEL6)[ $(gb_Output_COLOR_INBUILD_LEVEL6)info  $(2)$(gb_Output_COLOR_OUTBUILD_LEVEL6) ]$(gb_Output_COLOR_RESET) $(1))
106*cdf0e10cSrcweirendef
107*cdf0e10cSrcweir
108*cdf0e10cSrcweirdefine gb_Output_warn
109*cdf0e10cSrcweir$(warning $(NEWLINE)$(gb_Output_COLOR_OUTCLEAN_LEVEL6)[ $(gb_Output_COLOR_INCLEAN_LEVEL6)WARN  $(2)$(gb_Output_COLOR_OUTCLEAN_LEVEL6) ]$(gb_Output_COLOR_RESET) !!!$(NEWLINE)$(gb_Output_COLOR_OUTCLEAN_LEVEL6)[ $(gb_Output_COLOR_INCLEAN_LEVEL6)WARN  $(2)$(gb_Output_COLOR_OUTCLEAN_LEVEL6) ]$(gb_Output_COLOR_RESET) !!! $(1)$(NEWLINE)$(gb_Output_COLOR_OUTCLEAN_LEVEL6)[ $(gb_Output_COLOR_INCLEAN_LEVEL6)WARN  $(2)$(gb_Output_COLOR_OUTCLEAN_LEVEL6) ]$(gb_Output_COLOR_RESET) !!!)
110*cdf0e10cSrcweirendef
111*cdf0e10cSrcweir
112*cdf0e10cSrcweirdefine gb_Output_error
113*cdf0e10cSrcweir$(error $(gb_Output_COLOR_ERROR)$(1)$(gb_Output_COLOR_RESET))
114*cdf0e10cSrcweirendef
115*cdf0e10cSrcweir
116*cdf0e10cSrcweirendif
117*cdf0e10cSrcweirendif
118*cdf0e10cSrcweir
119*cdf0e10cSrcweir# only enable title output if
120*cdf0e10cSrcweir# - gb_TITLES is set
121*cdf0e10cSrcweir# - we have a known term
122*cdf0e10cSrcweirifneq ($(strip $(gb_TITLES)),)
123*cdf0e10cSrcweirifneq ($(filter $(TERM),Eterm aterm gnome kterm rxvt rxvt-unicode screen xterm xterm-color),)
124*cdf0e10cSrcweirdefine gb_Output_announce_title
125*cdf0e10cSrcweir$(info $(gb_Output_ESCAPE)]2;gbuild: $(1)$(gb_Output_BELL)$(gb_Output_ESCAPE)[A)
126*cdf0e10cSrcweirendef
127*cdf0e10cSrcweir
128*cdf0e10cSrcweir$(call gb_Output_announce_title,...)
129*cdf0e10cSrcweir
130*cdf0e10cSrcweirendif
131*cdf0e10cSrcweirendif
132*cdf0e10cSrcweir
133*cdf0e10cSrcweir# only enable bell output if
134*cdf0e10cSrcweir# - gb_BELL is set
135*cdf0e10cSrcweir# - gb_TTY is true (not piping to a file)
136*cdf0e10cSrcweirifneq ($(strip $(gb_BELL)),)
137*cdf0e10cSrcweirdefine gb_Output_announce_bell
138*cdf0e10cSrcweir$(info $(gb_Output_BELL)$(gb_Output_ESCAPE)[A)
139*cdf0e10cSrcweirendef
140*cdf0e10cSrcweirendif
141*cdf0e10cSrcweir
142*cdf0e10cSrcweirdefine gb_Output_announce
143*cdf0e10cSrcweir$(info $(call gb_Output__format_type,$(2),$(3),$(4)) $(call gb_Output__format_target,$(1)))
144*cdf0e10cSrcweirendef
145*cdf0e10cSrcweir
146*cdf0e10cSrcweir
147*cdf0e10cSrcweir# vim: set noet sw=4 ts=4:
148