RE: help make target .INTERMEDIATE .SECONDARY

2008-03-14 Thread John Calcote
Hi Vad, learn make utility. And i want to know more about target modifiers aside from .PHONY, like this: .INTERMEDIATE .SECONDARY Please show me some simple examples of using this targets Please check out the GNU make manual here: http://www.gnu.org/software/make/manual Look in section 1

Re: help make target .INTERMEDIATE .SECONDARY

2008-03-17 Thread John Calcote
Vad, On Mon, Mar 17, 2008 at 3:02 AM, Vad N <[EMAIL PROTECTED]> wrote: > book: "Managing Projects with GNU make, 3rd Edition" say : > > "Prerequisites of this special target are treated as intermediate files but > are never automatically deleted. The most common use of .SECONDARY is to > mark obj

A new Autotools book

2008-03-25 Thread John Calcote
Sorry for the list spam, but I thought people on this list might be interested in a new book on using the GNU Autotools, called Autotools: A Practitioner's Guide to Autoconf, Automake and Libtool You can find it at free software magazine (freesoftwaremagazine.com): http://www.freesoftwaremagazin

Re: include directory

2008-03-25 Thread John Calcote
Vad, On Tue, Mar 25, 2008 at 1:54 AM, Vad N <[EMAIL PROTECTED]> wrote: > depend : main.c > $(CC) -M $(CPPFLAGS) $^ > $@ > > include depend > -- > > I type in command line: > > >>make -f myMakefile > cc -M main.c > depend > make: 'depend' is up to date. > > I assumed th

Re: how to reply on digest message?

2008-04-29 Thread John Calcote
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Vichy, If this reply is a one-time thing, then you can simply create a new message with the same subject line, and copy those in the sender list of the original message, as well as the list itself. Note that the message id will be different on the rep

Re: clean recursively into sub-directories

2008-04-29 Thread John Calcote
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hongliang, You have multiple conflicting rules for "all" and "clean". Here's the right way to do this (untested): SUBDIRS = gen ora util .PHONY: all clean all clean: for dir in $(SUBDIRS); do \

Re: clean recursively into sub-directories

2008-04-29 Thread John Calcote
ars ago to handle this syntax. Could it have something to do with the fact that some of the syntax you use is GNU make specific? John Paul Smith wrote: > On Tue, 2008-04-29 at 08:57 -0600, John Calcote wrote: > >> You have multiple conflicting rules for "all" and "clean&qu

Re: c and C++ source files in one makefile

2008-05-05 Thread John Calcote
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rupal, Once you've compiled C or C++ source files in to object files, the linker can't really tell the difference between them - they're both object files. The only differences will (probably) be the export signatures - that is, C++ symbols will be ex

RE: Using environmnet variables in make

2009-02-26 Thread John Calcote
Alan, Try adding a backslash after the export QA... statement like this: test: export QA_STEP=start; \ touch ${QA_STEP}; make executes each line in a separate shell, so QA_STEP will not be set in the shell that executes the touch statement unless you execute both commands in the same state

RE: Using environmnet variables in make

2009-02-27 Thread John Calcote
to the shell by using $() syntax, whereas shell variables are dereferenced by the shell after it receives the command, by using the ${} syntax. John From: kalyan [mailto:kalyanateja...@gmail.com] Sent: Thursday, February 26, 2009 8:39 PM To: John Calcote Cc: albob; Help-make@gnu.org

Re: Using environmnet variables in make

2009-02-28 Thread John Calcote
t; case 2: > export QA_STEP=start > > test: > @touch ${QA_STEP} > > This case worked perfectly :) > > Regards > Kalyan > > > > > On Fri, Feb 27, 2009 at 10:20 PM, John Calcote wrote: > >> Kaylan, >> >> >> >> There ar

Re: Removing make goals

2009-04-05 Thread John Calcote
Werner, On 4/5/2009 4:49 AM, Werner LEMBERG wrote: Doing so works fine, however, make says something like nothing to be done for `debug' Currently, I do .PHONY major ifneq ($(findstring debug,$(MAKECMDGOALS)),) ... debug: @: endif I've dealt with large G

Re: Question about recursive make

2009-05-22 Thread John Calcote
Hi Paul, On 5/22/2009 4:01 PM, Paul Smith wrote: On Fri, 2009-05-22 at 16:24 -0500, Erik Lotspeich wrote: I have a question about recursive make. I have the FSF GNU Make book by Richard Stallman& Roland McGrath (covering Make version 3.77). In this book, it describes the following as equ

Re: build system rules & algorithms

2009-06-09 Thread John Calcote
Hi Mike, This is probably the most thought that's gone into make in 25 years. I'm sure I'm wrong, actually, since I'm not very familiar with the current state of the literature, but let me restate to make it an opinoin instead of a statement: This is really cool stuff. I'm going to download,

Re: build system rules & algorithms

2009-06-09 Thread John Calcote
so I may just take a stab at it. John On 6/9/2009 10:37 PM, John Calcote wrote: Hi Mike, This is probably the most thought that's gone into make in 25 years. I'm sure I'm wrong, actually, since I'm not very familiar with the current state of the literature, but le

Re: Make File depends upon another Make File

2009-06-23 Thread John Calcote
Hi Jason, You can either include one makefile in the other: --- # Makefile A ... include directory-b/makefile ... --- or you can call one makefile from the other: --- # Makefile A all: $(deps) ... cd directory-b && $(MAKE) $(MAKEFLAGS) $@ ... ... -

Re: Specific C Compiler with GNU make

2009-07-13 Thread John Calcote
Hi Eduardo, On 7/13/2009 8:10 AM, Eduardo Sorribas wrote: Hello. I have some time using GNU Make, and It has always been ok to me. It's just that I want to do something I hadn't needed to do, I need to compile using a mekefile and another compiler different to GCC. How can I do that? I know

Re: How does make compare the timestamp if the file does not exist

2009-07-13 Thread John Calcote
Hello, On 7/13/2009 8:51 PM, 雷 高 wrote: If the target of a rule does not exist or the timestamp of the target is older than any of the prerequisites, the target is out of date. My question is that if some files of prerequisites does not exist, how can we compare the timestamp. For example: fo

Re: Pre-including a generated file

2009-08-12 Thread John Calcote
Hi Leandro, On 8/12/2009 8:46 AM, Leandro Lucarella wrote: Hi. I would like to be able to include a generated file each time I run make. I have a small script that generates some make rules. The file should be generated *always*, and the results of the file should be included by make. I tried s

Re: Is there some option to make all targets phony?

2009-08-17 Thread John Calcote
Hi Pan, On 8/17/2009 12:22 AM, Pan ruochen wrote: Hi All, Here is my Makefile: PHONY: api FW all: api FW api: @make -C DIR1 -n api @make -C DIR2 -n api FW: @make -C DIR1 -n clean depend all @make -C DIR2 -n clean depend al

Re: Is there some option to make all targets phony?

2009-08-17 Thread John Calcote
On 8/17/2009 11:34 AM, John Calcote wrote: Hi Pan, On 8/17/2009 12:22 AM, Pan ruochen wrote: Hi All, Here is my Makefile: PHONY: api FW all: api FW api: @make -C DIR1 -n api @make -C DIR2 -n api FW: @make -C DIR1 -n clean

Re: Build Rule Race Condition

2009-08-18 Thread John Calcote
On 8/18/2009 9:56 PM, Eric Melski wrote: Schuster, Peter wrote: The ideal solution is for make to link all 3 output files together, so that as soon as it fires the job to process any of the 3, all 3 are marked as “running” and no further jobs are started. Is this possible with make? I recen

Re: Bug

2009-08-22 Thread John Calcote
On 8/21/2009 9:14 AM, Yuri Shtil wrote: Philip Guenther wrote: On Thursday, August 20, 2009, Yuri Shtil wrote: It look like the shell function is evaluated even though commented out in the following code: define FUNC ###FOO := $(shell sleep 10) endef all: @echo DONE $(eval $(call FUNC,$

Re: Bug

2009-08-22 Thread John Calcote
On 8/22/2009 5:04 PM, Philip Guenther wrote: On Sat, Aug 22, 2009 at 2:38 PM, John Calcote wrote: ... You have to admit that Yuri has a valid point here. 99. percent of all developers know that a hash mark starts a comment, wherein the following text is ignored until the next newline

Re: print project compile date

2009-08-31 Thread John Calcote
Hi Kevin, On 8/31/2009 7:09 PM, Kevin wrote: Hi, all: I have a question about print the project compile date. I have a project which contains 2 files: "a.c" and "b.c"*. *I want to print project compile date in one of these 2 files. I put it in a.c: >>> // This is a.c #inc

Re: print project compile date

2009-09-01 Thread John Calcote
On 8/31/2009 10:29 PM, Mike Shal wrote: On 9/1/09, John Calcote wrote: Basically, you're telling us that you want a.c to compile every time you build your project, so that you get the latest date/time stamp from the latest build. I guess the exception to this might be that you only

Re: how to create a single rule to build a directory as necessary

2009-09-22 Thread John Calcote
On 9/22/2009 10:18 AM, Paul Smith wrote: So, in your case, running the command "mkdir -p gllib; cd gllib; make" (which by the way, is not well-formed; it should be: mkdir -p $@&& cd $@&& $(MAKE) I'm kinda curious to know what $(MAKE) is expected to do in this case. You just crea

Re: Getting list of source files from directory hierarchy

2009-09-28 Thread John Calcote
Hi Paul, On 9/28/2009 3:22 PM, Paul Smith wrote: On Mon, 2009-09-28 at 13:50 -0700, Michael Morrell wrote: I was wide open to ideas on ways people deal with not wanting to hardcode a list of source filenames in the Makefiles. I thought this was common enough that perhaps there was a builti

Re: bug or feature ?

2009-10-13 Thread John Calcote
On 10/13/2009 12:41 PM, Denis Onischenko wrote: .../arch/powerpc/Makefile:168: *** mixed implicit and normal rules. Stop. The message means that some targets in the target list have '%' (the pattern character) in them, and some don't. This isn't allowed because pattern rule commands can

Re: Trouble linking through g++

2009-10-15 Thread John Calcote
Hi Madhav, On 10/15/2009 8:03 AM, Madhav Ancha wrote: Hi, When I run the linker through the command line like this, it works. g++ -g -pg -fprofile-arcs -ftest-coverage -Lrelease1 -o testApp file.o -lSharedLib But when i run from a make file with the follow equivalent commands, it

Re: how to do recursive "subsystem" make properly?

2009-11-03 Thread John Calcote
Hi Mark, On 11/3/2009 1:54 PM, Mark Galeck (CW) wrote: Hello, I see the following recommendation for a "subsystem" recursive make in the gnu make manual: subsystem: $(MAKE) -C subdir Well, I must not be understanding something, because this does not make (no pun) sense to me

Re: How to specify a dependence on a directory?

2009-11-20 Thread John Calcote
On 11/20/2009 4:18 PM, Peng Yu wrote: On Fri, Nov 20, 2009 at 5:11 PM, David Boyce wrote: On Fri, Nov 20, 2009 at 5:42 PM, Peng Yu wrote: Is there way to specify a dependence on a directory? directory: somefile some_command If any file in 'directory' is older than 'somefile', th

Re: Make question

2010-02-05 Thread John Calcote
Hi Timothy, On 2/5/2010 8:59 AM, Canham, Timothy K (316C) wrote: Newbie on the list, so forgive me if this is asked frequently: We have code generation, and we have a rule like this: fileout1.txt fileout2.txt fileout3.txt: filein.txt filegen.sh filein.txt What you need to realiz

Re: Make question

2010-02-05 Thread John Calcote
Darn it Eric! I keep forgetting about your site. I'm going to have to put a yellow sticky note on my computer so I remember to go read this stuff. These are GREAT articles. Thanks, John On 2/5/2010 9:40 AM, Eric Melski wrote: Canham, Timothy K (316C) wrote: We have code generation, and we ha

Re: Maintaining PATH while running make with sudo

2010-03-01 Thread John Calcote
Hi Steve, I this what you're talking about: $ sudo -s root's password: # echo $PATH /usr/sbin:/bin:/usr/bin:/sbin # make /usr/sbin:/bin:/usr/bin:/sbin # # cat Makefile all: @echo $(PATH) # # make --version GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free soft

Re: ignore errors on specific command

2010-03-31 Thread John Calcote
On 3/31/2010 2:27 AM, Payal wrote: Hi, all: cmd1 ; cmd2; cmd3 How to ignore errors from cmd2 only? Putting -cmd2 will not work here. How about this: all: c1 c2 c3 c1: cmd1 c2: -cmd2 c3: cmd3 John ___ Help-

Re: ignore errors on specific command

2010-03-31 Thread John Calcote
On 3/31/2010 9:59 AM, David Boyce wrote: On Wed, Mar 31, 2010 at 11:37 AM, John Calcote wrote: How about this: all: c1 c2 c3 c1: cmd1 c2: -cmd2 c3: cmd3 This would work but would also require: .PHONY: c1 c2 c3 .NOTPARALLEL: and is generally less useful

Re: ignore errors on specific command

2010-03-31 Thread John Calcote
On 3/31/2010 11:05 AM, David Boyce wrote: On Wed, Mar 31, 2010 at 12:36 PM, John Calcote wrote: On 3/31/2010 9:59 AM, David Boyce wrote: On Wed, Mar 31, 2010 at 11:37 AM, John Calcote wrote: How about this: all: c1 c2 c3 c1: cmd1 c2: -cmd2 c3

Re: Have no MAKE

2010-04-26 Thread John Calcote
Hi Charles, I'm sorry you've spent so much time looking for a version of make for your system. I'm surprised you need to search for it. Most systems come with a version of make already installed. GNU make is not required to build the GNU make source distribution - any make will do - even the o

Re: shell script return on a makefile.

2010-06-14 Thread John Calcote
German, This is easier than you think. Just remove the $(shell ... ) from around your shell call and add the call to a target like this: check_code: /path/to/my/script.sh Then put the check_code target in your dependency graph somewhere. Scripts return values to the shell. If you call th

Re: the character ‘%’

2010-08-29 Thread John Calcote
On 8/28/2010 5:42 PM, Paul Smith wrote: > On Sat, 2010-08-21 at 14:13 +0430, ali hagigat wrote: >> Each explanation has some components. An explanation is written IF AND >> ONLY IF its components have been written and explained FIRST. > If you ever try to write documentation for a complicated soft

RE: the gun make code

2011-08-28 Thread John Calcote
Hi Luyang, It's well understood by the community that example code is one area where the GNU manuals are lacking. The trouble is that the GNU efforts are mostly volunteer and the people who contribute barely have enough time to write the reference material. We thank them for their efforts. Neverth

RE: Usage: CPPFLAGS vs VPATH

2011-10-03 Thread John Calcote
> But if I remove the following line: > CPPFLAGS = -I include > The make file is not working..meaning that this line is needed for finding header > files from include directory. Please make me correct if I am missing something... > Than why the line "VPATH = src include " is not serving the purpos

RE: CFLAGS/LDFLAGS for PIE vs PIC?

2012-04-01 Thread John Calcote
> -Original Message- > From: help-make-bounces+john.calcote=gmail@gnu.org [mailto:help- > make-bounces+john.calcote=gmail@gnu.org] On Behalf Of Bryan Ischo > Sent: Sunday, April 01, 2012 5:18 PM > To: help-make@gnu.org > Subject: Re: CFLAGS/LDFLAGS for PIE vs PIC? > > On 04/01/12 1

Re: help on simple makefile

2017-04-05 Thread John Calcote
Jarod, You're trying to use make as a procedural language processor. Make is a declarative language. With procedural languages, you describe tasks that need to be done and the process for executing those tasks. With declarative languages, you describe the relationships between input objects and ou

Re: Limiting expansion of make variables

2017-04-18 Thread John Calcote
Use \$. On Apr 18, 2017 10:14 AM, "Richard Cavell" wrote: >Hello all. For debugging purposes, I am trying to put this into my >makefile: > >.PHONY: dumpvars > >dumpvars: source.c source.h >@echo "$(RM) is " $(RM) >@echo "$? expands to : " $? > >and so on. But obviou

Re: Limiting expansion of make variables

2017-04-18 Thread John Calcote
Actually, use \$$. Double the dollar sign to escape it for make. Prepend the slash (or put it in single quotes) to keep the shell from expanding it. On Apr 18, 2017 10:16 AM, "John Calcote" wrote: > Use \$. > > On Apr 18, 2017 10:14 AM, "Richard Cavell" wrote: >

Re: Running case commands with the shell function?

2017-09-14 Thread John Calcote
$ cat Makefile TARGET := i386-x-openbsd5.5y iflags := \ case "$(TARGET)" in \ i386-*-openbsd5.[5-9]*|i386-*-openbsd[6-9].*)\ echo "-ccopt -nopie";; \ *);; \ esac flags := $(shell $(iflags)) all: echo $(flags) $ make echo -ccopt -nopie -ccopt -nopie If you can't get

Re: How does make decide if a binary is 'up to date'

2019-05-02 Thread John Calcote
Hi Chris, Make uses file existence and last-modified timestamps to determine if a target is newer than it's prerequisites. There are other tools that use checksums like md5, but make only uses presence and timestamps. John On Thu, May 2, 2019 at 11:52 AM wrote: > Hi all > > Say I would like t