Skip to content

Commit 474e7fb

Browse files
authored
Merge pull request #450 from sterin/master
Reduce the amount of text printed when building `abc`.
2 parents 8f06ce9 + f8981d4 commit 474e7fb

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

Makefile

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,19 @@ MSG_PREFIX ?=
88
ABCSRC ?= .
99
VPATH = $(ABCSRC)
1010

11-
$(info $(MSG_PREFIX)Using CC=$(CC))
12-
$(info $(MSG_PREFIX)Using CXX=$(CXX))
13-
$(info $(MSG_PREFIX)Using AR=$(AR))
14-
$(info $(MSG_PREFIX)Using LD=$(LD))
11+
# whether to print build options, tools, and echo commands while building
12+
ifdef ABC_MAKE_VERBOSE
13+
VERBOSE=
14+
abc_info = $(info $(1))
15+
else
16+
VERBOSE=@
17+
abc_info =
18+
endif
19+
20+
$(call abc_info,$(MSG_PREFIX)Using CC=$(CC))
21+
$(call abc_info,$(MSG_PREFIX)Using CXX=$(CXX))
22+
$(call abc_info,$(MSG_PREFIX)Using AR=$(AR))
23+
$(call abc_info,$(MSG_PREFIX)Using LD=$(LD))
1524

1625
PROG := abc
1726
OS := $(shell uname -s)
@@ -66,14 +75,14 @@ endif
6675
ifdef ABC_USE_NAMESPACE
6776
CFLAGS += -DABC_NAMESPACE=$(ABC_USE_NAMESPACE) -fpermissive -x c++
6877
CC := $(CXX)
69-
$(info $(MSG_PREFIX)Compiling in namespace $(ABC_USE_NAMESPACE))
78+
$(call abc_info,$(MSG_PREFIX)Compiling in namespace $(ABC_USE_NAMESPACE))
7079
endif
7180

7281
# compile CUDD with ABC
7382
ifndef ABC_USE_NO_CUDD
7483
CFLAGS += -DABC_USE_CUDD=1
7584
MODULES += src/bdd/cudd src/bdd/extrab src/bdd/dsd src/bdd/epd src/bdd/mtr src/bdd/reo src/bdd/cas src/bdd/bbr src/bdd/llb
76-
$(info $(MSG_PREFIX)Compiling with CUDD)
85+
$(call abc_info,$(MSG_PREFIX)Compiling with CUDD)
7786
endif
7887

7988
ABC_READLINE_INCLUDES ?=
@@ -87,28 +96,21 @@ ifndef ABC_USE_NO_READLINE
8796
CFLAGS += -I/usr/local/include
8897
LDFLAGS += -L/usr/local/lib
8998
endif
90-
$(info $(MSG_PREFIX)Using libreadline)
99+
$(call abc_info,$(MSG_PREFIX)Using libreadline)
91100
endif
92101

93102
# whether to compile with thread support
94103
ifndef ABC_USE_NO_PTHREADS
95104
CFLAGS += -DABC_USE_PTHREADS
96105
LIBS += -lpthread
97-
$(info $(MSG_PREFIX)Using pthreads)
106+
$(call abc_info,$(MSG_PREFIX)Using pthreads)
98107
endif
99108

100109
# whether to compile into position independent code
101110
ifdef ABC_USE_PIC
102111
CFLAGS += -fPIC
103112
LIBS += -fPIC
104-
$(info $(MSG_PREFIX)Compiling position independent code)
105-
endif
106-
107-
# whether to echo commands while building
108-
ifdef ABC_MAKE_VERBOSE
109-
VERBOSE=
110-
else
111-
VERBOSE=@
113+
$(call abc_info,$(MSG_PREFIX)Compiling position independent code)
112114
endif
113115

114116
# Set -Wno-unused-bug-set-variable for GCC 4.6.0 and greater only
@@ -120,16 +122,16 @@ GCC_VERSION=$(shell $(CC) -dumpversion)
120122
GCC_MAJOR=$(word 1,$(subst .,$(space),$(GCC_VERSION)))
121123
GCC_MINOR=$(word 2,$(subst .,$(space),$(GCC_VERSION)))
122124

123-
$(info $(MSG_PREFIX)Found GCC_VERSION $(GCC_VERSION))
125+
$(call abc_info,$(MSG_PREFIX)Found GCC_VERSION $(GCC_VERSION))
124126
ifeq ($(findstring $(GCC_MAJOR),0 1 2 3),)
125127
ifeq ($(GCC_MAJOR),4)
126-
$(info $(MSG_PREFIX)Found GCC_MAJOR==4)
128+
$(call abc_info,$(MSG_PREFIX)Found GCC_MAJOR==4)
127129
ifeq ($(findstring $(GCC_MINOR),0 1 2 3 4 5),)
128-
$(info $(MSG_PREFIX)Found GCC_MINOR>=6)
130+
$(call abc_info,$(MSG_PREFIX)Found GCC_MINOR>=6)
129131
CFLAGS += -Wno-unused-but-set-variable
130132
endif
131133
else
132-
$(info $(MSG_PREFIX)Found GCC_MAJOR>=5)
134+
$(call abc_info,$(MSG_PREFIX)Found GCC_MAJOR>=5)
133135
CFLAGS += -Wno-unused-but-set-variable
134136
endif
135137
endif
@@ -148,10 +150,10 @@ endif
148150

149151
ifdef ABC_USE_LIBSTDCXX
150152
LIBS += -lstdc++
151-
$(info $(MSG_PREFIX)Using explicit -lstdc++)
153+
$(call abc_info,$(MSG_PREFIX)Using explicit -lstdc++)
152154
endif
153155

154-
$(info $(MSG_PREFIX)Using CFLAGS=$(CFLAGS))
156+
$(call abc_info,$(MSG_PREFIX)Using CFLAGS=$(CFLAGS))
155157
CXXFLAGS += $(CFLAGS) -std=c++17 -fno-exceptions
156158

157159
SRC :=

0 commit comments

Comments
 (0)