chain pattern rules

2010-04-26 Thread Luke Shumaker
Hello, I'm a little confused about how chained pattern rules work, I though I understood it, but now I'm getting cases where make cannot figure out how to make my files. For example, I have a Makefile containing: %: %.gz; gzip -cd $< > $@ %: %.tar; tar -xf $< If I have the file ``bash-4.1.tar.g

Re: chain pattern rules

2010-04-27 Thread Luke Shumaker
On Mon, 2010-04-26 at 20:02 -0700, Philip Guenther wrote: > You're hitting the special handling of rules whose target is '%' > that's described in the info pages in "10.5.5 Match-Anything Pattern > Rules". If you stare at that doc a bit as well as the output from > running make with the -d option,

add option to generate dependency graph

2010-08-18 Thread Luke Shumaker
> Hi, > is that possible that we can add an option to "make" that we can > generatge dependency graph? This will help us to debug issues (I know > we already have --debug and --print-data-base option) > > > Thanks > Lynn Since the dependency graph is more complex than just a tree (lines mus

Re: add option to generate dependency graph

2010-08-19 Thread Luke Shumaker
ependency graph > > On 8/19/10, Luke Shumaker wrote: > >> Hi, > >> is that possible that we can add an option to "make" that we can > >> generatge dependency graph? This will help us to debug issues (I know > >> we already have --debug and --p

Re: add option to generate dependency graph

2010-08-19 Thread Luke Shumaker
Oh, about the graphs: dotted line means it's an order-only dependency, not an actual dependency, and a blue bubble indicates a PHONY target. ~ LukeShu On Thu, 2010-08-19 at 23:45 -0400, Luke Shumaker wrote: > Thank you for showing me graphviz, it's pretty neat! > > The atta

Re: add option to generate dependency graph

2010-08-21 Thread Luke Shumaker
> > > > The attached patch adds the ``-g, --graph'' options to make; it will > > > > spit out a graphviz file to stdout. (The patch is against the 3.82 > > > > release) > > > > > > I test the patch,it's great although it has bug. > > > > What bug? > > I compile cgit project with your patch > >

Re: Timestamps comparison code?

2010-08-24 Thread Luke Shumaker
On Tue, 2010-08-24 at 13:32 -0400, Aleksey Yakovlev wrote: > What is the file timestamps comparison code, used by the make? (in C/C > ++ I guess) > Is there any way to redefine it? > > Thanks > Alex It's in C. Download the latest release's source code from ftp://ftp.gnu.org/gnu/make/ or grab the

Re: to know the meaning of makefiles!

2010-08-27 Thread Luke Shumaker
On Sat, 2010-08-28 at 09:02 +0430, ali hagigat wrote: > 3.9 How make Reads a Makefile > GNU make does its work in two distinct phases. During the first phase > it reads all the make- > files, included makefiles, etc. and internalizes all the variables and > their values, implicit and >

Re: wildcard character in target

2010-09-06 Thread Luke Shumaker
On Mon, 2010-09-06 at 10:20 +0430, ali hagigat wrote: > print: *.c > @echo "example" > > Considering the above rule in a makefile, what strings will be > replaced with *.c in the first phase and the second phase of make > process? This is equivalent to print: $(wildcard *.c) @echo "

Re: There is a bug in the make manual!!

2010-09-06 Thread Luke Shumaker
$$(addsuffix /%.c,foo bar) foo.h > @echo '$+' > > and the result is: > make: Nothing to be done for `/tmp/foo.o'. > > it did not expand to what you said! > > On Mon, Sep 6, 2010 at 8:53 PM, Luke Shumaker wrote: > > On Mon, 2010-09-06 at 08:21

Re: help with prerequisites

2010-09-07 Thread Luke Shumaker
On Tue, 2010-09-07 at 15:40 -0400, Polder, Matthew J wrote: > ... > $(OBJS): $(patsubst %.o,%.cpp,$(notdir $@)) > $(CC) -c $^ -o $@ > $(CC) -c $(SRC_DIR)/$(*F).cpp -o $@ There are a few problems here: First $@ is not yet set when the dependencies are being evaluated. To use $@ in the de

Re: Conditionals, step one

2010-09-16 Thread Luke Shumaker
On Thu, 2010-09-16 at 15:10 -0600, Daryl Lee wrote: > So I added "export OSTYPE=$OSTYPE to my .bashrc and that cleaned > everything up nicely. THANKS!! That only needs to be "export OSTYPE"; without specifying a value bash exports the current value. ~ LukeShu _

Re: Problem with phony target

2010-09-18 Thread Luke Shumaker
On Sat, 2010-09-18 at 21:17 -0300, Sergio Belkin wrote: > Hi folks, > > I have a Makefile that even when issuing for the first time the PHONY > target clean wants to recompile as you can see below: ... > What am I doing wrong? > > You can read the Makefile on http://pastebin.com/8zKGBQBt > > Tha

[Fwd: Re: Problem with phony target]

2010-09-19 Thread Luke Shumaker
Forwarded Message From: Sergio Belkin > 2010/9/18 Luke Shumaker : > I'm getting > > Unknown paste ID, it may have expired or been deleted! > from pastebin. > > ~ LukeShu Oops... strike two. Here we go :) http://

Re: Problem with phony target

2010-09-19 Thread Luke Shumaker
Don't forget to CC the mailing list! ~ LukeShu On Sun, 2010-09-19 at 19:17 -0300, Sergio Belkin wrote: > 2010/9/19 Luke Shumaker : > > On Sun, 2010-09-19 at 00:51 -0300, Sergio Belkin wrote: > >> 2010/9/18 Luke Shumaker : > >> > On Sat, 2010-09-18 at 21:17 -03

RE: variables-as-targets driving me insane

2010-10-01 Thread Luke Shumaker
Don't do that. Try this: ifneq ($(filter avrlib avrtest,$(MAKECMDGOALS)),) PLATFORM=avr endif ifneq ($(filter dylib,$(MAKECMDGOALS)),) PLATFORM=osx endif ### end ### This does make the assumption that the only way to make the dylib, avrlib, and avrtest targets is to specify them on the command

RE: variables-as-targets driving me insane

2010-10-03 Thread Luke Shumaker
, > Matt van de Werken. > ____ > From: Luke Shumaker [luke...@sbcglobal.net] > Sent: Saturday, October 02, 2010 8:13 AM > To: Van De Werken, Matt (CESRE, Pullenvale) > Cc: Help-make@gnu.org > Subject: RE: variables-as-targets driving me insane > > Don&

Re: Crossing directories for target and source

2010-10-07 Thread Luke Shumaker
On Thu, 2010-10-07 at 17:10 -0400, David Boyce wrote: > On Thu, Oct 7, 2010 at 4:44 PM, David Boyce wrote: > > I like to use full paths everywhere, using a > > BASE_DIR variable which can be inherited from an env var or derived > > from $(MAKEFILES), but that's just me. > > Sorry, I meant MAKEFIL

Re: Problem with a directory name in a rule

2010-10-22 Thread Luke Shumaker
On Fri, 2010-10-22 at 00:16 +0200, Vincent De Groote wrote: > Hello, > > I have a problem with a makefile (sic !). gmake is executed in a build > directory, with several subdirectories. > I want to build a library from several sources, and then build an executable > from a test file and that libr

Re: Partial checkout builds

2010-10-22 Thread Luke Shumaker
I would suggest trying UnionFS (supported either natively, or via FUSE on most *NIXen). What you do is mount /release/src under /local/src, with /local/src/ on top and /release/src on bottom. UnionFS first checks if a file exists on at the top layer, and keeps checking the next layer until it fin

Re: Evaluating Target Name

2010-10-28 Thread Luke Shumaker
n all files listed in the file `md5sums' and make each of those depend on `md5sums'. (The sed script breaks on filenames with spaces... but so does make, so it's OK) I hope this helps. ~ Luke Shumaker On Thu, 2010-10-28 at 17:37 +0200, erik.r...@--.-- wrote: > Hi all,

Re: variable parameter list

2010-11-12 Thread Luke Shumaker
On Wed, 2010-11-10 at 14:55 +0100, Warlich, Christof wrote: > Hi, > > consider this makefile: > > .PHONY: all > all: sorted.tgt header.tgt reverse.tgt footer.tgt > # The lines below are supposed to do this: > #sorted.tgt: list1.lst list2.lst > # cat $^ | sort >$@ > #header.tgt: list1.lst list2.ls

Re: Ordering targets as arguments

2010-11-14 Thread Luke Shumaker
On Sat, 2010-11-13 at 23:58 +0100, Erik Rull wrote: > Well yes - I could write a rule like > copy_object: object > [] > > But this would mean that object gets executed also if I did not give it as > an argument to the make command. > > I don't need a general handling of the sequence of

Re: 5.3 Recipe Execution

2010-12-25 Thread Luke Shumaker
On Sun, 2010-12-26 at 08:17 +0330, ali hagigat wrote: > 5.3 Recipe Execution > (In practice, make may take shortcuts that do not affect the results.) > - > What does it mean? It means that GNU Make may

Re: .ONESHELL target seems not working

2010-12-25 Thread Luke Shumaker
On Sun, 2010-12-26 at 08:37 +0330, ali hagigat wrote: > makefile21: > > .ONESHELL: > all: > y1=bbeeggiinn;echo $$y1 > echo $$y1 > echo eenndd > > /root/makefiles_examples> make -s -f makefile21 > bbeeggiinn > > eenndd > --

Re: make manual and +/- as prefix character

2010-12-29 Thread Luke Shumaker
On Wed, 2010-12-29 at 10:12 +0330, ali hagigat wrote: > Would you please explain the use of +/- as a prefix character? How > they are used and what make will do based on these characters? > Why the manual does not explain them clearly and separately? `-' is explained in section 5.5: Errors in Reci

Re: wildcard dependency

2010-12-29 Thread Luke Shumaker
On Wed, 2010-12-29 at 13:32 +0100, Warlich, Christof wrote: > Hi, > > I need to ensure that a certain tool is generated before any reciepes are > executed for a certain extension. To better understand what I need, consider > the following makefile: > > xxx.ext: > ./tool > > xxx.ext: tool #

RE: wildcard dependency

2010-12-30 Thread Luke Shumaker
On Thu, 2010-12-30 at 13:17 +0100, Warlich, Christof wrote: > Hi Luke, > > Thanks for your ideas. You are right, pattern rules is what I need to look at. > > Cheers, > > Christof No problem! Don't forget to CC: the mailing list, reply-to-all usually does this. -- ~ LukeShu http://lukeshu.ath

Re: Using grep inside makefile for loop

2011-01-17 Thread Luke Shumaker
On Mon, 2011-01-17 at 10:28 -0800, givemecode wrote: > I saw this question was posted but never answered on this forum. Hopefully > this can be done: > > I have code in a makefile that creates a new file called "allheaders.h" > which includes ALL the headers, and is intended to verify they compile

Re: load average and parallel execution

2011-01-17 Thread Luke Shumaker
On Tue, 2011-01-18 at 07:51 +0330, ali hagigat wrote: > The ‘-l’ option with no following number removes the load limit, if > one was given with a previous ‘-l’ option. > - > How -l option without number removes the limit? I us

Re: load average and parallel execution

2011-01-18 Thread Luke Shumaker
On Tue, 2011-01-18 at 09:13 +0330, ali hagigat wrote: > it does not make sense we specify -l 2.5 and then use -l on command > line, if we write: > make -l 2.5 > will sub-makes inherit "-l 2.5" from their parent? It does seem a little silly, but there are cases where it is useful. If you don't nee

Re: Correct dependency for Fortran .MOD and .O files

2011-01-28 Thread Luke Shumaker
On Thu, 2011-01-27 at 17:28 +0100, Tobias Burnus wrote: > Hello, > > I have a Makefile-dependency question regarding Fortran: In Fortran one > can have so-called modules. If one compiles such a file, a .mod file is > generated which contains the public interface and a .o file which > contains t

Re: desperate situation with $(shell ... :(

2011-02-26 Thread Luke Shumaker
Like everyone else, I really don't know where your problem is coming from. However, if I had to guess, I'd say that one shell didn't close the file in time for the next to open it, and one of them lost out. I'd try doing something like $(foreach item, $(very_long_list), $(shell echo '$(item)'>>

Re: HELP! Can I construct individial shell commands using a function

2011-02-26 Thread Luke Shumaker
The trick is to get the different commands on different lines. Try this: define _ExecuteShcmdArray $(foreach c,$1,@$($c) ) endef shellcmd1 = cd .. ; pwd shellcmd2 = cd .. ; pwd all: $(call _ExecuteShcmdArray,shellcmd1 shellcmd2) -- ~ LukeShu http://lukeshu.ath.cx On Sun, 2011-02-27

Re: HELP! Can I construct individial shell commands using a function

2011-02-27 Thread Luke Shumaker
gt; On Sat, 26 Feb 2011 21:23:15 -0500, Luke Shumaker > > wrote: > >> The trick is to get the different commands on different lines. Try > >> this: > >> > >> define _ExecuteShcmdArray > >> $(foreach c,$1,@$($c) > >> ) > >> ende

Re: why does touching Makefile allow make to know how to build dependency?

2011-03-07 Thread Luke Shumaker
I'm willing to write that off as a fault belonging to his email editor; otherwise I would expect make to bork about a syntax error. The problem is that recursive make doesn't track dependencies between instances of make. However, it is hard to diagnose, because you have fabricated the error messa

Re: manual execution of make works, but not from another makefile

2011-03-07 Thread Luke Shumaker
This is an ElectricMake issue, and this is a GNU Make mailing list, so we may not be able to help you much. However, it sounds like ElectricMake is setting some environmental variables that it passes to GNU Make. For example if the GNU Makefile sets `CFLAGS+=-g' then when you run it from the comm

Re: autodependencies

2011-03-09 Thread Luke Shumaker
I've always used the example from the GNU Make manual: %.d: %.c @set -e; rm -f $@; \ $(CC) -M $(CPPFLAGS) $< > $@.; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@. > $@; \ rm -f $@. sources = foo.c bar.c include $(sources:.c=.d) -- ~ LukeShu http

Re: multiple targets

2016-02-01 Thread Luke Shumaker
ou linked, if {a,b,c,d,e} and at least one of {x,y,z} have a common stem, then pattern rules can be used with GNU Make (this syntax is non-portable). However, if the filenames have nothing to do with eachother, then GNU Make has no way of expressing that. -- Happy hacking, ~ Luke Shumaker __

Re: Finding second route through rules

2016-02-01 Thread Luke Shumaker
Paul. Without looking at the source, this feels a lot like the .DELETE_ON_ERROR: bug that was in either 3.81 or 3.82 (I can't recall which). -- Happy hacking, ~ Luke Shumaker ___ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make

Re: Finding second route through rules

2016-02-02 Thread Luke Shumaker
erstand it :) I just wanted there to be one fewer thing for someone looking at it to have to think about. -- Happy hacking, ~ Luke Shumaker ___ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make