|
From: | Oleksandr Gavenko |
Subject: | Re: How to print at the start of Makefile |
Date: | Fri, 01 Apr 2011 15:09:27 +0300 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 |
On 01.04.2011 14:42, Ajay Jain wrote:
Hi, I would like to print a banner string whenever user does any operation in my makefile. The banner echoes some information on the shell. Since there are many many targets in the makefile, I do not know what the user will run and therefore I cannot assign the banner target as one of my rules' dependencies. Could you suggest something? What I want is : When I do: make x Or make y OR .... The Makefile always prints the following as the first operation: echo "logname, hostname, date, time etc etc"
Use $(info TEXT) func. Like: uname_s := $(shell uname -s) $(info Hello to GNU Make build!) $(info You run at $(uname_s) OS) Note that $(info) function is in introduced in GNU Make version 3.79 or 3.80 (if I am not wrong). Current is 3.82. Previous (3.81) released in 2006 and have 'info'. Also you can use $(shell echo TEXT) but this some ineffective. -- С уважением, Александр Гавенко.
[Prev in Thread] | Current Thread | [Next in Thread] |