Hi help-make,
I am a new user of Make & my question is whether is it possible to generate a
help sort of a message, or maybe, have a help target in the makefile,
then when an invalid target is specified, make should just run the "make help"
target.
Thanks,
shell script program the shell script
program emits a helpful message.
In make what I seeing was a terse one-liner:
make: *** No rule to make target `wrong_target' ***. Stop.
Thanks,
Rakesh
Sharma
> Date: Sun, 19 Aug 2012 12:33:24 -0700
> Subject: Re: generating helpful mess
Hello Makers,
I have a niggling query regarding how to remove the spaces from the output of a
foreach command in GNU Make.
I have this code:
## begin make file ###
SHELL := /bin/sh
empty :=
sp ;= $(empty) $(empty)
k0 := $(empty)
k1 := x
k2 := $(k1) x
k3 := $(k2) x
k4 := $(k3) x
k5 := $(k4)
TIA from a gmaker in making,
-rakesh sharma.
___
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make
kesh Sharma
> Subject: Re: About .INTERMEDIATE in gmake
> From: psm...@gnu.org
> To: britton.ke...@gmail.com
> CC: sharma...@hotmail.com; help-make@gnu.org
> Date: Sun, 2 Jun 2013 21:51:35 -0400
>
> On Sun, 2013-06-02 at 14:38 -0800, Britton Kerin wrote:
> > On Sun,
Hello makers,
Is it possible to use the shell indirection operator (<<) inside the command
section of GNU Make?
When I try to use the following construct in my makefile:
all:
cat -<< EOF; \
Testing line 1 \
Testing line 2 \
EOF
Then run make, it exits with
ow the makefile will have access to
this multiline variable as well. then i do a printf $$multiline variable
inside the makefile.
Regards,
Rakesh Sharma
> Date: Thu, 16 Jan 2014 14:41:54 +
> Subject: Re: Indirection Operators in the Command section of a makefile
> doesnt work.
&g
first define a multiline env variable from a csh
file, then invoke the make from this csh file,
finally use the $$multiline variable in the makefile , since it's now visible
to the make by virtue of importing the environment.
Regards,
Rakesh
Sharma
> Date: Fri, 17 Jan 2014 1
Hello GNU Makers,
I stumbled on a simple feature which I thought should be very doable in GNU
Make (I use 3.82)
but found it stubbornly resisting a make-bulitins based solution. 😞
Wanted to do a lowercase => uppercase conversion so wrote this (picked from
stackoverflow)
lc = $(subst a,A,$(sub
does that mean it is impossible to generate strings from gnu make which
contain imbalanced ( ... ) pairs?
Hope I was clear in getting across my query. In case not, then you can just
play with the ( before the subst & it's corresponding closing ) by chaniging it.
Thanks,
Rakesh S
Hello,
Is there a function/command for determining the number of arguments passed to a
user-defined function (== macro) in GNU make?
Thanks,
Rakesh Sharma
___
Help-make mailing list
Help-make@gnu.org
https
n=$(x)";
###
> Subject: Re: Number of arguments, a. la $# in gnu make?
> From: psm...@gnu.org
> To: sharma...@hotmail.com
> CC: help-make@gnu.org
> Date: Sat, 15 Feb 2014 09:46:58 -0500
>
> On Sat, 2014-0
the case of
eval?
Thanks,
Rakesh
Sharma
> Subject: Re: Number of arguments, a. la $# in gnu make?
> From: psm...@gnu.org
> To: sharma...@hotmail.com
> CC: help-make@gnu.org
> Date: Sat, 15 Feb 2014 12:50:13 -0500
>
> On Sat, 2014-02-15 at 09:17 -0800, Rakesh Sharma wrote:
>
alues from its' own argument list. And,
that is also why when we write $(macro,,) this seems to rid the problem of the
unintentional grabbing of the parent macro's arguments.
I would want some light thrown on this issue
o: sharma...@hotmail.com
> CC: help-make@gnu.org
> Date: Tue, 18 Feb 2014 08:04:35 -0500
>
> On Tue, 2014-02-18 at 02:14 -0800, Rakesh Sharma wrote:
> > What's going on here? Apparently, the construct $(macro) picks up the
> > $1/$2/... values from the macro in which it was pla
Hello GNU Makers,
Is there a way to find out if a variable is unset in a Makefile? The `ifdef'
condtional directive appears to do something different from what it's name
suggests.
Take for example this make snippet below:
ifdef DEBUG
# debug:=> /\S/
$(info DEBUG=[$(DEBUG)] debug mode ON.)
e
9 Apr 2014 07:36:53 -0700
> Subject: Re: Detect unset variables in gnu make
> From: guent...@gmail.com
> To: sharma...@hotmail.com
> CC: help-make@gnu.org
>
> On Tue, Apr 8, 2014 at 10:39 PM, Rakesh Sharma wrote:
> > Is there a way to find out if a variable is unset in a Makef
Re: Detect unset variables in gnu make
>
> On 04/09/2014 11:40 AM, Rakesh Sharma wrote:
> > Hello Guenther,
> >
> > Thanks for the tips about the $(origin varname) function. That is solving
> > the problems I was having. As regards the value of the variable I lik
Hello GNU makers,
Is there any tool/utility which can diagram the DAG of the rules/targets by
going thru the makefile? And I don't mean this in a generic way, that all sorts
of complex $(eval-ed) rules
need to be diagrammed.
What I feel is that if we have a picture of the DAG of a makefile, the
st of dependencies, unless your build is
> very small. You will wonder what use the graph is because it will
> look like a pile of cut grass - with thousands of lines going all over
> the place.
>
> I think there are useful lessons to learn but not the ones that might
> app
able to generate DAGs.
Regards,
Rakesh
> Date: Mon, 14 Apr 2014 12:14:42 +0200
> From: reinp...@win.tue.nl
> To: help-make@gnu.org
> Subject: Re: Diagramming a makefile?
>
> On Sun Apr 13 22:44:58 2014, sharma...@hotmail.com (Rakesh Sharma) wrote:
> > Hello GNU m
t; Date: Tue, 15 Apr 2014 18:37:01 +0200
> From: reinp...@win.tue.nl
> To: help-make@gnu.org
> Subject: Re: Diagramming a makefile?
>
> Op di 15 apr 2014 04:00:16 GMT schreef sharma...@hotmail.com (Rakesh Sharma):
> >
> > Hello Reinier,
> >
> > Thanks for t
Hi David,
The best way to deal with this particular scenario in GNU make (IMHO) is via
the use
of the $(origin ..) & the $(error ..) functions, like as:
Makefile:
NULL :=
SP := $(NULL) $(NULL)
# $(call bad_var,variablename)
bad_var = $(error The variable '$1' cannot be declared on the command
Hi Sam,
LISTx := A A B C D D E
LISTd := $(strip \
$(foreach v,$(sort $(LISTx)),\
$(if $(filter-out 1,$(words $(filter $(v),$(LISTx,\
$(v
$(info My make version=$(MAKE_VERSION))
$(info Original list => $(LISTx))
$(info Duplicates
Hi Sam,
Here's another method, this time uses the recursive nature of user-defined
functions of GNU make. I'd like to add that this is the preferred way, as the
order of elements as in the original list is maintained.
The algo is very straightforward: we invoke the function "dupp" with an input
Your makefile serves as a perfect example of the need to set the SHELL env from
within the makefile, to prevent such shell-dependent vagaries affect make's
execution.
What is happening is that the default SHELL in Ubuntu is /bin/sh , which would
not be having the brace expansion {...} built in
You are correct when you say that even the simply expanded variables are
recursive; butthey are recursive in time, meaning, they won't be impacting the
stack space. While thedeferred variables are recursive in space, as they would
impact the stack space. So I guessthe authors of GNU make chose t
>From your description what seems to be ailing your build systemis the
>architecture of your makefile itself.
Without any clues as to what ails your build (since you didnt provide the
makefile), you need to make your makefile non-recursive in order to reap the
speed dividends. The changes that
Hello DaveK,
I was going though the GNU Make mailing list & somehow stumbled upon a
very-oldquery that you had posted on this list.
You were reporting a problem due to comma variables. But actually the problemis
not that, rather it is the age-old problem of make allowing the use of
undefinedvari
You may also want to put the following code at the top of your main Makefile to
make the output comingfrom somewhat tractable.
# Disable built in pattern rules.
MAKEFLAGS += -r
# Disable built in variables.
MAKEFLAGS += -R
# Disable
Let me quote from the GNU make manual on the "eval function". It says:
The argument to the eval function is expanded, then the results of that
expansion are parsed as makefile syntax.
Now in this case, of $(eval include /path/to/file.mk)the two arguments to eval
are the keyword include & the ful
r just include the Makefile directly.
Because still, there are no characters to be expanded here, and the two
arguments to eval remain the same.
Thanks again!Hiran
On Thu, Jul 23, 2015 at 2:03 AM, Rakesh Sharma wrote:
Let me quote from the GNU make manual on the "eval function".
Hi all,
Please ignore this mail. this is justing why my mail client is clobbering
the newlines thereby changing the look/feel of the real message.
Has anyone else also faced similar issues?
FWIW, I send replies to this site on MS Outlook Win-XP
_
One way can be as follows:
## pre-define your library directories based on the output of the "getconf"
output format
LIB_32 := /stage2/lib/dbus-1.0/include
LIB_64 := /stage2/lib64/dbus-1.0/include
# then compute the architecture of the machine running gmake
CFLAGS := -I$(LIB_$(strip $(shell getc
> To: help-make@gnu.org
> Subject: Re: Conditional include directories
>
> On Tue Aug 4 04:03:32 2015, sharma...@hotmail.com (Rakesh Sharma) wrote:
>> One way can be as follows:
>>
>> ## pre-define your library directories based on the output of the "getconf"
Mark Galeck pacbell.net> writes:
>
> All right, after all I will have to modify Make source code.
> David's idea is very good... for recursive Make systems.
> Unfortunately in practice, a system like does not just have Make calls
itself recursively, that would be
> too simple :)
> It has
Tony Theodore me.com> writes:
>
> When there is an `else` in a complex section, it sometimes looks like:
>
> $(if , \
> \
> , \
> )
>
> These can be deeply nested and the dangling `, \` can get really hard to
parse. Constructs like:
>
> $(if , \
> \
>
Afif Elghraoui sdsu.edu> writes:
>
> Hello,
> I'm looking for a way to be able to store custom makefile rules in
> special folders.
> I see that the Makefile variable .INCLUDE_DIRS is set to "/usr/include
> /usr/local/include /usr/include" on my machine by default, but is there
> an environme
Afif Elghraoui sdsu.edu> writes:
>
> Hello,
> I'm looking for a way to be able to store custom makefile rules in
> special folders.
> I see that the Makefile variable .INCLUDE_DIRS is set to "/usr/include
> /usr/local/include /usr/include" on my machine by default, but is there
> an environme
.
From: help-make-bounces+sharma__r=hotmail@gnu.org
on behalf of Sideboard
Sent: Tuesday, March 22, 2016 1:25 AM
To: Bob Proulx
Cc: help-make@gnu.org
Subject: Re: Make opens Android Studio
On 22.03.2016 01:08, Bob Proulx wrote:
>> > This also works
Did you check your PATH variable? Why should a symlink in your home/bin to as
modify the behavior
of your makefile unless home/bin is included in your PATH and that too earlier
than the regular /usr/bin
etc. directories.
From: help-make-bounces+sharma__r=
With GNU Make, we can implement a fairly effective version check mechanism.
# *-*-* vim settings *-*-*# :set list ts=3# inspired from:# a) J. Cumming
make book#b ) O'Reilly Mecklenburg make book.#c ) Paul Smith GNU Make
author.
SHELL := /bin/sh
NULL := ONE := 1
SPC := $(NULL) $(NULL
I am re-posting since the newlines are not working properly in the site:
# *-*-* vim settings *-*-*# :set list ts=3
SHELL := /bin/sh
NULL := ONE := 1
SPC := $(NULL) $(NULL)TAB := $(NULL) $(NULL)DOT := .
TRUE := $(ONE)FALSE := $(NULL)
VALID_FALSE_VALUES := 0 -0 0. $(NULL) 0.0
[0-9] := 0 1 2 3 4
The problem is with the line preceding the vlog line, where the order is
reversed.
dut: @echo phase 1;./shell_script 1> phase.log2>&1
vlog $(VOPTS) 1>> phase.log 2>&1
From: thomas.ly...@mrcy.com
To: help-make@gnu.org
Subject: Target appends to file?
Date: T
3
#i := 43
#i := 2 02 002 20 200 0 00 000
From: Help-make on behalf of
rakesh sharma
Sent: Thursday, April 14, 2016 7:11 AM
To: help-make@gnu.org
Subject: RE: How to switch behaviour according to glibc version?
I am re-posting sinc
GNU make is lacking the feature to find out how many arguments a
macro/user-defined function was called with. The code presented below helps in
finding that out and pushes that value in the make variable $#.
The max number of arguments that are computable is 16^4 = 65,536. (limited by
the MAX_
Jannick gmx.net> writes:
> Here some options I can see right now:
>
> * Invoking Make like 'Make -IC:/path/to/make/lib' (as already
> discussed)
>
> * Compile an additional hard coded path (like 'C:/path/to/make/lib')
> into Make (running build_w32.bat with some tweaks to use mingw3
There is no difference between the two. They both declare environment variables
for make.
From: Help-make on behalf of
Pietro
Sent: Monday, September 19, 2016 9:32 AM
To: help-make@gnu.org
Subject: Exported vs command line variables
Hi,
I have noticed that t
The environment is passed on to it's child processes by make, so if you can
find a way to push the pid of your make run into one then you're done.
a) Invoke make as follows:
tmpf=`mktemp`
TMPF="$tmpf" make -f yourmakefile yourtarget &
pid=$!
echo "$pid" > $tmpf
wait "$pid"
rm -f "$tmpf"
unday, November 6, 2016 2:27 PM
To: Rakesh Sharma
Cc: help-make@gnu.org
Subject: Re: pgid of spawned processes
Thanks for the nudge in the right direction but...
... an easier way to make that happen is to introduce an initial bash script:
#!/bin/bash
export ROOT_PID=$$
make -f yourmakefile yo
Hi Sebstien,
You could also choose to make do with the GNU-make's builtins and avoid forking
to the shell.
TARGET := i386--openbsd5.8
1-9 := 1 2 3 4 5 6 7 8 9
flags := \
$(strip \
$(if $(subst i386,,$(firstword $(subst -, ,$(TARGET,,\
$(if $(strip \
There was a slight error in the previous version as it was not testing the dot
"." after the
openbsd versions 6,7,8, & 9.
TARGET := i386-$(rand)-openbsd8.$(rand)
1-9 := 1 2 3 4 5 6 7 8 9
flags := \
$(strip \
$(if $(patsubst i386-%,,$(TARGET)),,\
$(if $(strip \
Hi Sebastien,
If you prefer sticking to the more maintainable, shell-based version then I
would suggest that you change the double quotes around the $(TARGET) in the
case structure, as this would hinder the shell from working if there were to be
dollar signs $ , double quotes " , or back quote
Hi TP ,
You can make use of the $(if ...) construct of GNU make for this scenario.
$(if $(call strip,$(filter $(1),$(PACKAGES_ALL))),true_portion,false_portion)
The true portion you already noted as a warning funtion.
And in case the false portion of the $(if ...) clause is too big and hamp
54 matches
Mail list logo