bessarabov
bessarabov

Reputation: 11871

How to run target after some commands in gnumake

I have Makefile like this:

b:  
        @echo "b" 

a:  
        @echo "a" 
        @make b

I want this Makefile to print "a\nb" after i execute 'make a'. It does the thing, but It also prints "Entering directory" and "Leaving directory":

$ make a
a   
make[1]: Entering directory `/home/bessarabov'
b   
make[1]: Leaving directory `/home/bessarabov'

Actually that lines doesn't disturb me, but I'm not sure that this is the correct way of running some targets in the end of other targets.

Upvotes: 1

Views: 1974

Answers (1)

just somebody
just somebody

Reputation: 19247

GNU make has a switch to silence the Entering/Leaving messages: --no-print-directory. using make usually isn't right, you probably want to change it to $(MAKE).

rationale for $(MAKE) versus "make" is given in the GNU make manual here and here

Upvotes: 4

Related Questions