+ifndef VERBOSE
+MAKEFLAGS += --no-print-directory
+endif
+
PREFIX?=/usr
LIBDIR?=$(PREFIX)/lib
SBINDIR?=/sbin
all: Config
@set -e; \
for i in $(SUBDIRS); \
- do $(MAKE) $(MFLAGS) -C $$i; done
+ do echo; echo $$i; $(MAKE) $(MFLAGS) -C $$i; done
Config:
sh configure $(KERNEL_INCLUDE)
all: bridge
bridge: $(BROBJ) $(LIBNETLINK)
+ $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
install: all
install -m 0755 bridge $(DESTDIR)$(SBINDIR)
rm -f $TMPDIR/dbtest.c $TMPDIR/dbtest
}
+quiet_config()
+{
+ cat <<EOF
+# user can control verbosity similar to kernel builds (e.g., V=1)
+ifeq ("\$(origin V)", "command line")
+ VERBOSE = \$(V)
+endif
+ifndef VERBOSE
+ VERBOSE = 0
+endif
+ifeq (\$(VERBOSE),1)
+ Q =
+else
+ Q = @
+endif
+
+ifeq (\$(VERBOSE), 0)
+ QUIET_CC = @echo ' CC '\$@;
+ QUIET_AR = @echo ' AR '\$@;
+ QUIET_LINK = @echo ' LINK '\$@;
+ QUIET_YACC = @echo ' YACC '\$@;
+ QUIET_LEX = @echo ' LEX '\$@;
+endif
+EOF
+}
+
echo "# Generated config based on" $INCLUDE >Config
+quiet_config >> Config
+
check_toolchain
echo "TC schedulers"
echo -n "docs:"
check_docs
echo
+
+echo >> Config
+echo "%.o: %.c" >> Config
+echo ' $(QUIET_CC)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<' >> Config
all: $(TARGETS) $(LIBS)
devlink: $(DEVLINKOBJ)
+ $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
install: all
install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR)
all: genl
genl: $(GENLOBJ) $(LIBNETLINK) $(LIBUTIL) $(GENLLIB)
+ $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
install: all
install -m 0755 genl $(DESTDIR)$(SBINDIR)
all: $(TARGETS) $(SCRIPTS)
ip: $(IPOBJ) $(LIBNETLINK)
+ $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
rtmon: $(RTMONOBJ)
+ $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
install: all
install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR)
all: libnetlink.a libutil.a
libnetlink.a: $(NLOBJ)
- $(AR) rcs $@ $(NLOBJ)
+ $(QUIET_AR)$(AR) rcs $@ $^
libutil.a: $(UTILOBJ) $(ADDLIB)
- $(AR) rcs $@ $(UTILOBJ) $(ADDLIB)
+ $(QUIET_AR)$(AR) rcs $@ $^
install:
all: $(TARGETS)
ss: $(SSOBJ)
+ $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
nstat: nstat.c
- $(CC) $(CFLAGS) $(LDFLAGS) -o nstat nstat.c $(LIBNETLINK) -lm
+ $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o nstat nstat.c $(LIBNETLINK) -lm
ifstat: ifstat.c
- $(CC) $(CFLAGS) $(LDFLAGS) -o ifstat ifstat.c $(LIBNETLINK) -lm
+ $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o ifstat ifstat.c $(LIBNETLINK) -lm
rtacct: rtacct.c
- $(CC) $(CFLAGS) $(LDFLAGS) -o rtacct rtacct.c $(LIBNETLINK) -lm
+ $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o rtacct rtacct.c $(LIBNETLINK) -lm
arpd: arpd.c
- $(CC) $(CFLAGS) -I$(DBM_INCLUDE) $(LDFLAGS) -o arpd arpd.c $(LIBNETLINK) -ldb -lpthread
+ $(QUIET_CC)$(CC) $(CFLAGS) -I$(DBM_INCLUDE) $(LDFLAGS) -o arpd arpd.c $(LIBNETLINK) -ldb -lpthread
ssfilter.c: ssfilter.y
- bison ssfilter.y -o ssfilter.c
+ $(QUIET_YACC)bison ssfilter.y -o ssfilter.c
lnstat: $(LNSTATOBJ)
+ $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
install: all
install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR)
MODDESTDIR := $(DESTDIR)$(LIBDIR)/tc
%.so: %.c
- $(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic $< -o $@
+ $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic $< -o $@
all: libtc.a tc $(TCSO)
tc: $(TCOBJ) $(TCLIB)
+ $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
libtc.a: $(TCLIB)
- $(AR) rcs $@ $(TCLIB)
+ $(QUIET_AR)$(AR) rcs $@ $(TCLIB)
install: all
mkdir -p $(MODDESTDIR)
rm -f emp_ematch.yacc.*
q_atm.so: q_atm.c
- $(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o q_atm.so q_atm.c -latm
+ $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o q_atm.so q_atm.c -latm
m_xt.so: m_xt.c
- $(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o m_xt.so m_xt.c $$($(PKG_CONFIG) xtables --cflags --libs)
+ $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o m_xt.so m_xt.c $$($(PKG_CONFIG) xtables --cflags --libs)
m_xt_old.so: m_xt_old.c
- $(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o m_xt_old.so m_xt_old.c $$($(PKG_CONFIG) xtables --cflags --libs)
+ $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o m_xt_old.so m_xt_old.c $$($(PKG_CONFIG) xtables --cflags --libs)
em_ipset.o: CFLAGS += $$($(PKG_CONFIG) xtables --cflags)
%.yacc.c: %.y
- $(YACC) $(YACCFLAGS) -o $@ $<
+ $(QUIET_YACC)$(YACC) $(YACCFLAGS) -o $@ $<
%.lex.c: %.l
- $(LEX) $(LEXFLAGS) -o$@ $<
+ $(QUIET_LEX)$(LEX) $(LEXFLAGS) -o$@ $<
# our lexer includes the header from yacc, so make sure
# we don't attempt to compile it before the header has
all: $(TARGETS) $(LIBS)
tipc: $(TIPCOBJ)
+ $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
install: all
install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR)