When a makefile calls itself like
test :
@ mv $(BIN_SRC) $(BIN_SCR_TMP)
@ mv $(BIN_TEST_SRC) $(BIN_TEST_SRC_TMP)
@ make runtest
@ mv $(BIN_SCR_TMP) $(BIN_SRC)
@ mv $(BIN_TEST_SRC_TMP) $(BIN_TEST_SRC)
runtest : $(OBJS) $(LIB)
g++ -o $(TEST_BIN_FILE) $(OBJS) $(LIB)
@ chmod ugo+x $(TEST_BIN_FILE)
$(TEST_BIN_FILE)
and you run make test
it prints this out to the terminal:
make test
make[1]: Entering directory `/users/home2/admin/stringha/cs240/webcrawler'
g++ -o bin/webcrawler-tests obj/URL.o obj/webcrawler-tests.o lib/libcs240utils.a bin/webcrawler-tests
Hello webcrawler test!
make[1]: Leaving directory `/users/home2/admin/stringha/cs240/webcrawler'
I was wondering how to make it not print out the lines
make[1]: Entering directory `/users/home2/admin/stringha/cs240/webcrawler'
and
make[1]: Leaving directory `/users/home2/admin/stringha/cs240/webcrawler'
Thanks!
Add --no-print-directory
flag:
MAKEFLAGS += --no-print-directory
Or add it to the sub-make invocation command directly:
test :
...
@$(MAKE) runtest --no-print-directory
...
Read also about using MAKE
variable.
Add --no-print-directory to MAKEFLAGS:
$ export MAKEFLAGS=--no-print-directory
or add that option to your invocation of make:
$ make test --no-print-directory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With