Re: How do I pass compiler switches into a Make file?



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
.



Relevant Pages

  • RE: How to remove all *.tmp files
    ... Not sure if it would cleanup outlook attachments or word or excel temporary ... It sure leaves the cookies which are in use. ... give you the options to clean more than just tmp files for making more room. ... I thought at one time there was a command structure for the Delete ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: worm symptoms, and M-S patches wont "stick"
    ... > The command for WinXP is SFC.EXE ... and because after several cycles i found the system restore was NOT ... > | an immediate AVERT rerun was clean. ... > | then AVERT and then adaware were all clean. ...
    (microsoft.public.security.virus)
  • Re: CE 6.0 R2/R3 with Windows 7 build problem
    ... Did a clean sysgen got sysgen0000 error after dotnetV2 module ... My question is which build command I should used after installing a major update like R2/R3 to get my image the first time? ... Choose "Rebuild <your OSDesign name>... ... Windows Embedded support forums in Italian: ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Problem with Query Unload
    ... >> Thanks four your suggestion, Doug, but when I leave the End stmt out and ... Somewhere in your clean up code, ... > Private Sub Form_Unload ... start hitting F8 to single step each command. ...
    (microsoft.public.vb.general.discussion)
  • do loop with msg box
    ... Looking for a "neater coding" method using a Do Loop ... to substitute and clean up code that already works. ... The user clicks a command button to hide the subform. ...
    (microsoft.public.access.formscoding)