aboutsummaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2012-11-28 11:45:47 +0100
committerAnthony Ramine <[email protected]>2013-01-15 21:42:34 +0100
commitfed9a8415fc77ed42bf9a94ea421eff4f62c5eb4 (patch)
treed0bf98bd4b28d868656224193f838886e0419990 /make
parent3e8a6c8bceea8552ef50bd8dcfc14a0f79c9f32e (diff)
downloadotp-fed9a8415fc77ed42bf9a94ea421eff4f62c5eb4.tar.gz
otp-fed9a8415fc77ed42bf9a94ea421eff4f62c5eb4.tar.bz2
otp-fed9a8415fc77ed42bf9a94ea421eff4f62c5eb4.zip
Implement ./otp_build configure --enable-silent-rules
With silent rules, the output of make is less verbose and compilation warnings are easier to spot. Silent rules are disabled by default and can be disabled or enabled at will by make V=0 and make V=1.
Diffstat (limited to 'make')
-rw-r--r--make/otp.mk.in31
-rw-r--r--make/output.mk.in112
-rw-r--r--make/run_make.mk7
3 files changed, 134 insertions, 16 deletions
diff --git a/make/otp.mk.in b/make/otp.mk.in
index 90f448d4a0..0e58a27016 100644
--- a/make/otp.mk.in
+++ b/make/otp.mk.in
@@ -25,6 +25,11 @@
.3 .1 .fig .dvi .tex .class .java .pdf .fo .psframe .pscrop .el .elc
# ----------------------------------------------------
+# Output
+# ----------------------------------------------------
+include $(ERL_TOP)/make/output.mk
+
+# ----------------------------------------------------
# Cross Compiling
# ----------------------------------------------------
CROSS_COMPILING = @CROSS_COMPILING@
@@ -104,19 +109,19 @@ ESRC = .
endif
$(EBIN)/%.beam: $(EGEN)/%.erl
- $(ERLC) $(ERL_COMPILE_FLAGS) -o$(EBIN) $<
+ $(V_ERLC) $(ERL_COMPILE_FLAGS) -o$(EBIN) $<
$(EBIN)/%.beam: $(ESRC)/%.erl
- $(ERLC) $(ERL_COMPILE_FLAGS) -o$(EBIN) $<
+ $(V_ERLC) $(ERL_COMPILE_FLAGS) -o$(EBIN) $<
ifeq ($(NATIVE_LIBS_ENABLED),yes)
# Special rule for the HIPE bootstrap w/ native libs
../boot_ebin/%.beam: $(ESRC)/%.erl
- $(ERLC) $(ERL_COMPILE_FLAGS) -o../boot_ebin $<
+ $(V_ERLC) $(ERL_COMPILE_FLAGS) -o../boot_ebin $<
endif
.erl.beam:
- $(ERLC) $(ERL_COMPILE_FLAGS) -o$(dir $@) $<
+ $(V_ERLC) $(ERL_COMPILE_FLAGS) -o$(dir $@) $<
#
# When .erl files are automatically created GNU make removes them if
@@ -131,10 +136,10 @@ endif
## $(ERLC) $(IDL_FLAGS) $<
$(EGEN)/%.erl: $(ESRC)/%.yrl
- $(ERLC) $(YRL_FLAGS) -o$(EGEN) $<
+ $(yecc_verbose)$(ERLC) $(YRL_FLAGS) -o$(EGEN) $<
$(EGEN)/%.erl: $(ESRC)/%.xrl
- $(ERLC) $(XRL_FLAGS) -o$(EGEN) $<
+ $(leex_verbose)$(ERLC) $(XRL_FLAGS) -o$(EGEN) $<
# ----------------------------------------------------
# SNMP language section
@@ -149,16 +154,16 @@ endif
$(SNMP_BIN_TARGET_DIR)/%.bin: %.mib
- $(ERLC) -pa $(SNMP_TOOLKIT)/ebin -I $(SNMP_TOOLKIT)/priv/mibs $(SNMP_FLAGS) -o $(SNMP_BIN_TARGET_DIR) $<
+ $(snmp_verbose)$(ERLC) -pa $(SNMP_TOOLKIT)/ebin -I $(SNMP_TOOLKIT)/priv/mibs $(SNMP_FLAGS) -o $(SNMP_BIN_TARGET_DIR) $<
$(SNMP_HRL_TARGET_DIR)/%.hrl: $(SNMP_BIN_TARGET_DIR)/%.bin
- $(ERLC) -pa $(SNMP_TOOLKIT)/ebin -o $(SNMP_HRL_TARGET_DIR) $<
+ $(snmp_verbose)$(ERLC) -pa $(SNMP_TOOLKIT)/ebin -o $(SNMP_HRL_TARGET_DIR) $<
.mib.bin:
- $(ERLC) -pa $(SNMP_TOOLKIT)/ebin -I $(SNMP_TOOLKIT)/priv/mibs $(SNMP_FLAGS) $<
+ $(snmp_verbose)$(ERLC) -pa $(SNMP_TOOLKIT)/ebin -I $(SNMP_TOOLKIT)/priv/mibs $(SNMP_FLAGS) $<
.bin.hrl:
- $(ERLC) -pa $(SNMP_TOOLKIT)/ebin $<
+ $(snmp_verbose)$(ERLC) -pa $(SNMP_TOOLKIT)/ebin $<
# ----------------------------------------------------
# Java language section
@@ -170,11 +175,11 @@ JAVA_DEST_ROOT = ../priv/
endif
.java.class:
- CLASSPATH=$(CLASSPATH) $(JAVA) $(JAVA_OPTIONS) $<
+ $(javac_verbose)CLASSPATH=$(CLASSPATH) $(JAVA) $(JAVA_OPTIONS) $<
$(JAVA_DEST_ROOT)$(JAVA_CLASS_SUBDIR)%.class: %.java
- CLASSPATH=$(CLASSPATH) $(JAVA) $(JAVA_OPTIONS) -d $(JAVA_DEST_ROOT) $<
+ $(javac_verbose)CLASSPATH=$(CLASSPATH) $(JAVA) $(JAVA_OPTIONS) -d $(JAVA_DEST_ROOT) $<
# ----------------------------------------------------
# Emacs byte code compiling
@@ -183,7 +188,7 @@ EMACS_COMPILER=emacs-20
EMACS_COMPILE_OPTIONS=-q --no-site-file -batch -f batch-byte-compile
.el.elc:
- $(EMACS_COMPILER) $(EMACS_COMPILE_OPTIONS) $<
+ $(emacs_verbose)$(EMACS_COMPILER) $(EMACS_COMPILE_OPTIONS) $<
# ----------------------------------------------------
# Documentation section
diff --git a/make/output.mk.in b/make/output.mk.in
new file mode 100644
index 0000000000..2f1a1d3a79
--- /dev/null
+++ b/make/output.mk.in
@@ -0,0 +1,112 @@
+#-*-makefile-*- ; force emacs to enter makefile-mode
+# ----------------------------------------------------
+# Make include file for otp
+#
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+#
+# %CopyrightEnd%
+#
+# Author: Anthony Ramine
+# ----------------------------------------------------
+
+ifeq ($(V),)
+V = @DEFAULT_VERBOSITY@
+endif
+
+ifeq ($(V),0)
+v_p = 0
+else
+v_p = 1
+endif
+
+V_at_0 = @
+V_at = $(V_at_$(V))
+
+V_colon_0 = @: ""
+V_colon = $(V_colon_$(V))
+
+ar_verbose_0 = @echo " AR "$@;
+ar_verbose = $(ar_verbose_$(V))
+V_AR = $(ar_verbose)$(AR)
+
+asn_verbose_0 = @echo " ASN "$@;
+asn_verbose = $(asn_verbose_$(V))
+
+cc_verbose_0 = @echo " CC "$@;
+cc_verbose = $(cc_verbose_$(V))
+V_CC = $(cc_verbose)$(CC)
+
+dia_verbose_0 = @echo " DIA "$@;
+dia_verbose = $(dia_verbose_$(V))
+
+dtrace_verbose_0 = @echo " DTRACE "$@;
+dtrace_verbose = $(dtrace_verbose_$(V))
+
+emacs_verbose_0 = @echo " EMACS "$@;
+emacs_verbose = $(emacs_verbose_$(V))
+
+emu_cc_verbose_0 = @echo " EMU_CC "$@;
+emu_cc_verbose = $(emu_cc_verbose_$(V))
+V_EMU_CC = $(emu_cc_verbose)$(EMU_CC)
+
+erlc_verbose_0 = @echo " ERLC "$@;
+erlc_verbose = $(erlc_verbose_$(V))
+V_ERLC = $(erlc_verbose)$(ERLC)
+
+gen_verbose_0 = @echo " GEN "$@;
+gen_verbose = $(gen_verbose_$(V))
+
+javac_verbose_0 = @echo " JAVAC "$@;
+javac_verbose = $(javac_verbose_$(V))
+V_JAVAC = $(javac_verbose)$(JAVAC)
+
+ld_verbose_0 = @echo " LD "$@;
+ld_verbose = $(ld_verbose_$(V))
+V_LD = $(ld_verbose)$(LD)
+
+leex_verbose_0 = @echo " LEEX "$@;
+leex_verbose = $(leex_verbose_$(V))
+
+lex_verbose_0 = @echo " LEX "$@;
+lex_verbose = $(lex_verbose_$(V))
+V_LEX = $(lex_verbose)$(LEX)
+
+m4_verbose_0 = @echo " M4 "$@;
+m4_verbose = $(m4_verbose_$(V))
+
+make_verbose_0 = @echo " MAKE "$@;
+make_verbose = $(make_verbose_$(V))
+
+mc_verbose_0 = @echo " MC "$@;
+mc_verbose = $(mc_verbose_$(V))
+V_MC = $(mc_verbose)$(MC)
+
+ranlib_verbose_0 = @echo " RANLIB "$@;
+ranlib_verbose = $(ranlib_verbose_$(V))
+V_RANLIB = $(ranlib_verbose)$(RANLIB)
+
+rc_verbose_0 = @echo " RC "$@;
+rc_verbose = $(rc_verbose_$(V))
+V_RC = $(rc_verbose)$(RC)
+
+snmp_verbose_0 = @echo " SNMP "$@;
+snmp_verbose = $(snmp_verbose_$(V))
+
+vsn_verbose_0 = @echo " VSN "$@;
+vsn_verbose = $(vsn_verbose_$(V))
+
+yecc_verbose_0 = @echo " YECC "$@;
+yecc_verbose = $(yecc_verbose_$(V))
diff --git a/make/run_make.mk b/make/run_make.mk
index b7a5a64847..1b4213107f 100644
--- a/make/run_make.mk
+++ b/make/run_make.mk
@@ -25,19 +25,20 @@
#
# ----------------------------------------------------
+include $(ERL_TOP)/make/output.mk
include $(ERL_TOP)/make/target.mk
.PHONY: valgrind
opt debug purify quantify purecov valgrind gcov gprof lcnt:
- $(MAKE) -f $(TARGET)/Makefile TYPE=$@
+ $(make_verbose)$(MAKE) -f $(TARGET)/Makefile TYPE=$@
plain smp frag smp_frag:
- $(MAKE) -f $(TARGET)/Makefile FLAVOR=$@
+ $(make_verbose)$(MAKE) -f $(TARGET)/Makefile FLAVOR=$@
clean generate depend docs release release_spec release_docs release_docs_spec \
tests release_tests release_tests_spec:
- $(MAKE) -f $(TARGET)/Makefile $@
+ $(make_verbose)$(MAKE) -f $(TARGET)/Makefile $@