Re: How do I pass compiler switches into a Make file?
- From: William Pursell <bill.pursell@xxxxxxxxx>
- Date: Tue, 16 Jun 2009 23:01:05 -0700 (PDT)
On 16 June, 19:51, General Schvantzkoph <schvantzk...@xxxxxxxxx>
wrote:
Is there a way to set a default value for the flags in the Makefile which
would be overwritten by the command line argument?
RTFM. Here's a quick example that you might find enlightening:
bash-3.2$ make clean a
rm -f a.o b.o c.o
cc -pg -Dbubba -c -o b.o b.c
cc -pg -Dbubba -c -o c.o c.c
cc -pg -Dbubba a.c b.o c.o -o a
bash-3.2$ make clean a CFLAGS=-g
rm -f a.o b.o c.o
cc -g -Dbubba -c -o b.o b.c
cc -g -Dbubba -c -o c.o c.c
cc -g -Dbubba a.c b.o c.o -o a
bash-3.2$ make clean a CFLAGS=-g CPPFLAGS=-Dfoo
rm -f a.o b.o c.o
cc -g -Dfoo -c -o b.o b.c
cc -g -Dfoo -c -o c.o c.c
cc -g -Dfoo a.c b.o c.o -o a
bash-3.2$ cat Makefile
CPPFLAGS = -Dbubba
CFLAGS = -pg
a: b.o c.o
clean:
rm -f a.o b.o c.o
.
- Follow-Ups:
- Re: How do I pass compiler switches into a Make file?
- From: General Schvantzkoph
- Re: How do I pass compiler switches into a Make file?
- References:
- How do I pass compiler switches into a Make file?
- From: General Schvantzkoph
- Re: How do I pass compiler switches into a Make file?
- From: John Reiser
- Re: How do I pass compiler switches into a Make file?
- From: General Schvantzkoph
- Re: How do I pass compiler switches into a Make file?
- From: Sergei Organov
- Re: How do I pass compiler switches into a Make file?
- From: General Schvantzkoph
- How do I pass compiler switches into a Make file?
- Prev by Date: Re: how to display video frames effectively under gtk+?
- Next by Date: U++ 1314 released
- Previous by thread: Re: How do I pass compiler switches into a Make file?
- Next by thread: Re: How do I pass compiler switches into a Make file?
- Index(es):
Relevant Pages
|