Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

makefile calling itself

Tags:

makefile

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!

like image 464
Ryan Avatar asked Feb 09 '12 19:02

Ryan


2 Answers

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.

like image 198
Eldar Abusalimov Avatar answered Nov 01 '22 02:11

Eldar Abusalimov


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
like image 24
William Pursell Avatar answered Nov 01 '22 02:11

William Pursell